# HG changeset patch # User Doug Simon # Date 1364298524 -3600 # Node ID abf5a4554bae756c4eed0cc5ca08b0401caecffa # Parent 4316ad0fa3ee92a5afa58e5baa83c245641137d7 made CurrentJavaThreadNode.get() interpretable diff -r 4316ad0fa3ee -r abf5a4554bae graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CurrentJavaThreadNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CurrentJavaThreadNode.java Tue Mar 26 12:46:33 2013 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CurrentJavaThreadNode.java Tue Mar 26 12:48:44 2013 +0100 @@ -22,7 +22,10 @@ */ package com.oracle.graal.hotspot.nodes; +import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*; + import com.oracle.graal.api.code.*; +import com.oracle.graal.graph.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.spi.*; @@ -44,6 +47,16 @@ gen.setResult(this, rawThread.asValue(this.kind())); } + private static int eetopOffset() { + try { + return (int) UnsafeAccess.unsafe.objectFieldOffset(Thread.class.getDeclaredField("eetop")); + } catch (Exception e) { + throw new GraalInternalError(e); + } + } + @NodeIntrinsic - public static native Word get(); + public static Word get() { + return Word.box(unsafeReadWord(Thread.currentThread(), eetopOffset())); + } }