Mercurial > hg > graal-jvmci-8
changeset 20175:655e05ece0f5
only force fix an unguarded JavaReadNode
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 07 Apr 2015 12:19:45 +0200 |
parents | 56f721367c0d |
children | 03b4fa99eff8 |
files | graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/DefaultJavaLoweringProvider.java |
diffstat | 1 files changed, 8 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/DefaultJavaLoweringProvider.java Tue Apr 07 02:55:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/DefaultJavaLoweringProvider.java Tue Apr 07 12:19:45 2015 +0200 @@ -327,11 +327,15 @@ Stamp loadStamp = loadStamp(read.stamp(), valueKind, read.isCompressible()); ReadNode memoryRead = graph.add(new ReadNode(read.object(), read.location(), loadStamp, read.getBarrierType())); - // An unsafe read must not float otherwise it may float above - // a test guaranteeing the read is safe. - memoryRead.setForceFixed(true); + GuardingNode guard = read.getGuard(); ValueNode readValue = implicitLoadConvert(graph, valueKind, memoryRead, read.isCompressible()); - memoryRead.setGuard(read.getGuard()); + if (guard == null) { + // An unsafe read must not float otherwise it may float above + // a test guaranteeing the read is safe. + memoryRead.setForceFixed(true); + } else { + memoryRead.setGuard(guard); + } read.replaceAtUsages(readValue); graph.replaceFixed(read, memoryRead); }