Mercurial > hg > truffle
changeset 14975:478165bd7508
fix null stamp in CurrentJavaThreadNode
author | Lukas Stadler <lukas.stadler@oracle.com> |
---|---|
date | Fri, 04 Apr 2014 16:59:01 +0200 |
parents | 6270e260c23b |
children | 82399ac30721 |
files | graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CurrentJavaThreadNode.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ThreadSubstitutions.java |
diffstat | 2 files changed, 7 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CurrentJavaThreadNode.java Fri Apr 04 15:56:19 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CurrentJavaThreadNode.java Fri Apr 04 16:59:01 2014 +0200 @@ -25,10 +25,12 @@ import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*; import com.oracle.graal.api.code.*; +import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.graal.nodes.type.*; import com.oracle.graal.word.*; /** @@ -36,8 +38,8 @@ */ public final class CurrentJavaThreadNode extends FloatingNode implements LIRLowerable { - private CurrentJavaThreadNode() { - super(null); + private CurrentJavaThreadNode(Kind kind) { + super(StampFactory.forKind(kind)); } @Override @@ -55,7 +57,7 @@ } @NodeIntrinsic(setStampFromReturnType = true) - public static Word get() { + public static Word get(@SuppressWarnings("unused") @ConstantNodeParameter Kind kind) { return Word.unsigned(unsafeReadWord(Thread.currentThread(), eetopOffset())); } }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ThreadSubstitutions.java Fri Apr 04 15:56:19 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ThreadSubstitutions.java Fri Apr 04 16:59:01 2014 +0200 @@ -45,12 +45,12 @@ @MethodSubstitution public static Thread currentThread() { - return PiNode.piCastNonNull(CurrentJavaThreadNode.get().readObject(threadObjectOffset(), LocationIdentity.FINAL_LOCATION), Thread.class); + return PiNode.piCastNonNull(CurrentJavaThreadNode.get(getWordKind()).readObject(threadObjectOffset(), LocationIdentity.FINAL_LOCATION), Thread.class); } @MethodSubstitution(isStatic = false) public static boolean isInterrupted(final Thread thisObject, boolean clearInterrupted) { - Word javaThread = CurrentJavaThreadNode.get(); + Word javaThread = CurrentJavaThreadNode.get(getWordKind()); Object thread = javaThread.readObject(threadObjectOffset(), LocationIdentity.FINAL_LOCATION); if (thisObject == thread) { Word osThread = javaThread.readWord(osThreadOffset(), LocationIdentity.FINAL_LOCATION);