# HG changeset patch # User Lukas Stadler # Date 1389357613 -3600 # Node ID ba9d33a0bc1613db4d50f702d3f15b032de23057 # Parent 680a7cc8f451da6ba3f11943b3b4085cd3f37973 fix bugs in HotSpotDebugInfoBuilder and CommitAllocationNode diff -r 680a7cc8f451 -r ba9d33a0bc16 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/EscapeAnalysisTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/EscapeAnalysisTest.java Fri Jan 10 12:21:29 2014 +0100 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/EscapeAnalysisTest.java Fri Jan 10 13:40:13 2014 +0100 @@ -245,4 +245,27 @@ new LoopTransformLowPhase().apply(graph); new SchedulePhase().apply(graph); } + + public static void testDeoptMonitorSnippetInner(Object o2, Object t, int i) { + staticField = null; + if (i == 0) { + staticField = o2; + Number n = (Number) t; + n.toString(); + } + } + + public static void testDeoptMonitorSnippet(Object t, int i) { + TestClassObject o = new TestClassObject(); + TestClassObject o2 = new TestClassObject(o); + + synchronized (o) { + testDeoptMonitorSnippetInner(o2, t, i); + } + } + + @Test + public void testDeoptMonitor() { + test("testDeoptMonitorSnippet", new Object(), 0); + } } diff -r 680a7cc8f451 -r ba9d33a0bc16 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotDebugInfoBuilder.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotDebugInfoBuilder.java Fri Jan 10 12:21:29 2014 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotDebugInfoBuilder.java Fri Jan 10 13:40:13 2014 +0100 @@ -29,7 +29,6 @@ import com.oracle.graal.hotspot.meta.*; import com.oracle.graal.lir.*; import com.oracle.graal.nodes.*; -import com.oracle.graal.nodes.virtual.*; /** * Extends {@link DebugInfoBuilder} to allocate the extra debug information required for locks. @@ -56,7 +55,7 @@ StackSlot slot = lockStack.makeLockSlot(lockDepth); ValueNode lock = state.lockAt(lockIndex); Value object = toValue(lock); - boolean eliminated = lock instanceof VirtualObjectNode; + boolean eliminated = object instanceof VirtualObject && state.monitorIdAt(lockIndex) != null; return new HotSpotMonitorValue(object, slot, eliminated); } diff -r 680a7cc8f451 -r ba9d33a0bc16 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/virtual/CommitAllocationNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/virtual/CommitAllocationNode.java Fri Jan 10 12:21:29 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/virtual/CommitAllocationNode.java Fri Jan 10 13:40:13 2014 +0100 @@ -109,7 +109,7 @@ } s.append("]"); if (!getLocks(objIndex).isEmpty()) { - s.append(" locked(").append(locks.get(objIndex)).append(")"); + s.append(" locked(").append(getLocks(objIndex)).append(")"); } properties.put("object(" + virtual.toString(Verbosity.Id) + ")", s.toString()); }