changeset 13590:ba9d33a0bc16

fix bugs in HotSpotDebugInfoBuilder and CommitAllocationNode
author Lukas Stadler <lukas.stadler@jku.at>
date Fri, 10 Jan 2014 13:40:13 +0100
parents 680a7cc8f451
children 2b5c77ff960e
files graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/EscapeAnalysisTest.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotDebugInfoBuilder.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/virtual/CommitAllocationNode.java
diffstat 3 files changed, 25 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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);
+    }
 }
--- 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);
     }
 
--- 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());
         }