Mercurial > hg > graal-compiler
changeset 20122:b9f65c441427
allow lowering of UnsafeLoadNode while guards are still floating
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 01 Apr 2015 17:40:02 +0200 |
parents | 5f533a5c2aaf |
children | 374b48caeb9c |
files | graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/FloatingReadPhase.java graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/DefaultJavaLoweringProvider.java |
diffstat | 2 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/FloatingReadPhase.java Wed Apr 01 17:36:51 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/FloatingReadPhase.java Wed Apr 01 17:40:02 2015 +0200 @@ -327,9 +327,9 @@ private static void processFloatable(FloatableAccessNode accessNode, MemoryMapImpl state) { StructuredGraph graph = accessNode.graph(); - assert accessNode.getNullCheck() == false; LocationIdentity locationIdentity = accessNode.location().getLocationIdentity(); if (accessNode.canFloat()) { + assert accessNode.getNullCheck() == false; MemoryNode lastLocationAccess = state.getLastLocationAccess(locationIdentity); FloatingAccessNode floatingNode = accessNode.asFloatingNode(lastLocationAccess); ValueAnchorNode anchor = null;
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/DefaultJavaLoweringProvider.java Wed Apr 01 17:36:51 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/DefaultJavaLoweringProvider.java Wed Apr 01 17:40:02 2015 +0200 @@ -271,12 +271,12 @@ ReadNode memoryRead = createUnsafeRead(graph, load, valueAnchorNode); graph.replaceFixedWithFixed(load, valueAnchorNode); graph.addAfterFixed(valueAnchorNode, memoryRead); - } else if (!graph.getGuardsStage().allowsFloatingGuards()) { + } else { assert load.getKind() != Kind.Illegal; - ReadNode memoryRead = createUnsafeRead(graph, load, null); // An unsafe read must not float outside its block otherwise // it may float above an explicit null check on its object. - memoryRead.setGuard(AbstractBeginNode.prevBegin(load)); + AbstractBeginNode guard = AbstractBeginNode.prevBegin(load); + ReadNode memoryRead = createUnsafeRead(graph, load, guard); graph.replaceFixedWithFixed(load, memoryRead); } }