changeset 7001:46bec43bdfc3

fixed bug causing tomcat to crash: an UnsafeLoadNode must be pinned to its block when lowered This is now necessary since UnsafeLoadNode no longer includes a null check (as per the sun.misc.Unsafe API)
author Gilles Duboscq <duboscq@ssw.jku.at>
date Wed, 21 Nov 2012 23:36:06 +0100
parents bf2ea3ed3bce
children 74f0207b82f5
files graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java	Wed Nov 21 23:33:43 2012 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java	Wed Nov 21 23:36:06 2012 +0100
@@ -513,6 +513,8 @@
             assert load.kind() != Kind.Illegal;
             IndexedLocationNode location = IndexedLocationNode.create(LocationNode.ANY_LOCATION, load.loadKind(), load.displacement(), load.offset(), graph, false);
             ReadNode memoryRead = graph.add(new ReadNode(load.object(), location, load.stamp()));
+            // An unsafe read must not floating outside its block as may float above an explicit null check on its object.
+            memoryRead.dependencies().add(BeginNode.prevBegin(load));
             graph.replaceFixedWithFixed(load, memoryRead);
         } else if (n instanceof UnsafeStoreNode) {
             UnsafeStoreNode store = (UnsafeStoreNode) n;