Mercurial > hg > truffle
changeset 3485:1e5500ecd6bd
added framestate to unsafe intrinsics - fixes ordering bug
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Thu, 04 Aug 2011 11:10:07 +0200 |
parents | 561f5b2940b1 |
children | a5b02018b843 |
files | graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/InliningPhase.java graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/HotSpotRuntime.java |
diffstat | 2 files changed, 8 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/InliningPhase.java Wed Aug 03 16:54:02 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/InliningPhase.java Thu Aug 04 11:10:07 2011 +0200 @@ -555,7 +555,6 @@ } if (pred instanceof Placeholder) { - System.out.println("preds: " + ((Placeholder) pred).next().predecessor()); FixedNode next = ((Placeholder) pred).next(); ((Placeholder) pred).setNext(null); pred.replaceAndDelete(next);
--- a/graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/HotSpotRuntime.java Wed Aug 03 16:54:02 2011 +0200 +++ b/graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/HotSpotRuntime.java Thu Aug 04 11:10:07 2011 +0200 @@ -553,6 +553,7 @@ } else if (holderName.equals("Lsun/misc/Unsafe;")) { if (fullName.equals("getObject(Ljava/lang/Object;J)Ljava/lang/Object;")) { CompilerGraph graph = new CompilerGraph(this); + Local unsafe = new Local(CiKind.Object, 0, graph); Local object = new Local(CiKind.Object, 1, graph); Local offset = new Local(CiKind.Long, 2, graph); UnsafeLoad load = new UnsafeLoad(object, offset, CiKind.Object, graph); @@ -563,10 +564,17 @@ intrinsicGraphs.put(method, graph); } else if (fullName.equals("putObject(Ljava/lang/Object;JLjava/lang/Object;)V")) { CompilerGraph graph = new CompilerGraph(this); + Local unsafe = new Local(CiKind.Object, 0, graph); Local object = new Local(CiKind.Object, 1, graph); Local offset = new Local(CiKind.Long, 2, graph); Local value = new Local(CiKind.Object, 3, graph); UnsafeStore store = new UnsafeStore(object, offset, value, CiKind.Object, graph); + FrameState frameState = new FrameState(method, 0, parameters.size(), 0, 0, false, graph); + store.setStateAfter(frameState); + frameState.setValueAt(0, unsafe); + frameState.setValueAt(1, object); + frameState.setValueAt(2, offset); + frameState.setValueAt(3, value); Return ret = new Return(null, graph); store.setNext(ret); graph.start().setNext(store);