[deuce-stm] Running Deuce on Jikes

28 views
Skip to first unread message

Richard

unread,
May 24, 2010, 9:17:06 AM5/24/10
to Deuce-STM
Hi Guys,

I need to run Deuce in Jikes. I have a command,

rvm -javaagent:deuceAgent.jar -
Dorg.deuce.exclude="java.*,sun.*,org.eclipse.*,org.deuce.*"
Array.ArrayTest 10 0 200 10000 10000

However I get this error:

java.lang.NoSuchFieldException: theUnsafe
at java.lang.Exception.<init>(Exception.java:78)
at java.lang.NoSuchFieldException.<init>(NoSuchFieldException.java:
71)
at java.lang.Class.throwNoSuchFieldException(Class.java:576)
at java.lang.Class.getDeclaredField(Class.java:1070)
at org.deuce.reflection.UnsafeHolder.<clinit>(Jasmin:0)
at org.jikesrvm.classloader.RVMClass.initialize(RVMClass.java:1547)
at
org.jikesrvm.runtime.RuntimeEntrypoints.initializeClassForDynamicLink(RuntimeEntrypoints.java:
611)
at
org.jikesrvm.classloader.TableBasedDynamicLinker.resolveMember(TableBasedDynamicLinker.java:
76)
at
org.jikesrvm.classloader.TableBasedDynamicLinker.resolveMember(TableBasedDynamicLinker.java:
65)
at org.deuce.transform.asm.Agent.premain(Unknown Source:0)
at org.jikesrvm.classloader.ReflectionBase$
$Reflect38690.invokeInternal(Unknown Source:0)
at org.jikesrvm.runtime.ReflectionBase.invoke(ReflectionBase.java:
180)
at org.jikesrvm.runtime.Reflection.invoke(Reflection.java:74)
at
java.lang.reflect.VMCommonLibrarySupport.invokeStatic(VMCommonLibrarySupport.java:
203)
at
java.lang.reflect.VMCommonLibrarySupport.invoke(VMCommonLibrarySupport.java:
172)

The corresponding hotspot command runs fine. Can Deuce run on Jikes.

Many Thanks,

Richard

--
You received this message because you are subscribed to the Google Groups "Deuce-STM" group.
To post to this group, send email to deuc...@googlegroups.com.
To unsubscribe from this group, send email to deuce-stm+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/deuce-stm?hl=en.

gkor...@gmail.com

unread,
May 24, 2010, 5:24:58 PM5/24/10
to deuc...@googlegroups.com
Sice jikes is not a native based jvm but written in java there is no unsafe in jikes.
You can probably overcome this by hadding such class that uses reflection to provide a similar api.

novazeta

unread,
Oct 5, 2010, 12:22:18 PM10/5/10
to deuc...@googlegroups.com
Hi all,

Has anyone attempted to get Deuce to run under JikesRVM? I'm using Jikes in a project and would now like to integrate Deuce. My project depends on GNU Classpath, hence I would prefer to avoid using Sun's VM. How feasible do you think it would be to get Deuce and Jikes to work nicely together?

Thanks,
Khilan

Guy Korland

unread,
Oct 5, 2010, 2:39:45 PM10/5/10
to deuc...@googlegroups.com
If JikesRVM supports javaagents then it should work.

Regards,
Guy Korland

novazeta

unread,
Oct 7, 2010, 12:39:16 PM10/7/10
to deuc...@googlegroups.com
Hi,

DeuceSTM doesn't seem to work in online mode with Jikes, however, with some updates to sun.misc.Unsafe, I think I'm very close to getting it to work at least in offline mode. So far, I can do int and long field accesses and updates. However, I have a test class which accesses and updates and field of every primitive Java type and also an Object type. However, it seems to be able to access the fields ok, even though I haven't implemented getByte, getBoolean, etc in sun.misc.Unsafe (I have only implemented getInt and getLong). Looking through the Deuce source for 1.3, I see that org.deuce.transaction.lsa.field.Field.getValue specifically makes calls to unsafe.getByte etc. Here is part of my test class:

public class TestInstanceFieldAccessUpdate {

  boolean z = true;
  byte b = 2;
  char c = 'b';
  short s = 3;
  int i = 4;
  long j = 4294967294L;
  float f = 5;
  double d = 4294967295.0D;
  Object l = "hello"; 
  
  @Atomic
  public void testAccessors() {
    System.out.println("z: " + z);
    System.out.println("b: " + b);
    System.out.println("c: " + c);
    System.out.println("s: " + s);
    System.out.println("i: " + i);
    System.out.println("j: " + j);
    System.out.println("f: " + f);
    System.out.println("d: " + d);
    System.out.println("l: " + l);
  }
  ...
  public static void main(String[] args) {
    TestInstanceFieldAccessUpdate t = new TestInstanceFieldAccessUpdate();
    t.testAccessors();
  }
}

I perform offline instrumentation and then run it with Jikes. I have checked and tx calls have been inserted. It prints the correct values even though I haven't implement the methods Unsafe.getByte, Unsafe.getChar, etc as mentioned above. 

Thanks in advance,
Khilan
Reply all
Reply to author
Forward
0 new messages