# HG changeset patch # User Christian Wimmer # Date 1409697873 25200 # Node ID 66bf28082a142ad04f45dfa84cb84ca3ea620584 # Parent 3482684330eee12961a3aa72e11163daabdca170 Bugfix: ReadEliminationClosure ignored subclasses of FixedAccessNode that are memory checkpoints diff -r 3482684330ee -r 66bf28082a14 graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/ReadEliminationClosure.java --- a/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/ReadEliminationClosure.java Tue Sep 02 22:19:44 2014 +0200 +++ b/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/ReadEliminationClosure.java Tue Sep 02 15:44:33 2014 -0700 @@ -81,41 +81,39 @@ state.addCacheEntry(identifier, value); } } - } else if (node instanceof FixedAccessNode) { - if (node instanceof ReadNode) { - ReadNode read = (ReadNode) node; - if (read.location() instanceof ConstantLocationNode) { - ValueNode object = GraphUtil.unproxify(read.object()); - ReadCacheEntry identifier = new ReadCacheEntry(object, read.location()); - ValueNode cachedValue = state.getCacheEntry(identifier); - if (cachedValue != null) { - if (read.getGuard() != null && !(read.getGuard() instanceof FixedNode)) { - effects.addFixedNodeBefore(ValueAnchorNode.create((ValueNode) read.getGuard()), read); - } - effects.replaceAtUsages(read, cachedValue); - addScalarAlias(read, cachedValue); - deleted = true; - } else { - state.addCacheEntry(identifier, read); + } else if (node instanceof ReadNode) { + ReadNode read = (ReadNode) node; + if (read.location() instanceof ConstantLocationNode) { + ValueNode object = GraphUtil.unproxify(read.object()); + ReadCacheEntry identifier = new ReadCacheEntry(object, read.location()); + ValueNode cachedValue = state.getCacheEntry(identifier); + if (cachedValue != null) { + if (read.getGuard() != null && !(read.getGuard() instanceof FixedNode)) { + effects.addFixedNodeBefore(ValueAnchorNode.create((ValueNode) read.getGuard()), read); } + effects.replaceAtUsages(read, cachedValue); + addScalarAlias(read, cachedValue); + deleted = true; + } else { + state.addCacheEntry(identifier, read); } - } else if (node instanceof WriteNode) { - WriteNode write = (WriteNode) node; - if (write.location() instanceof ConstantLocationNode) { - ValueNode object = GraphUtil.unproxify(write.object()); - ReadCacheEntry identifier = new ReadCacheEntry(object, write.location()); - ValueNode cachedValue = state.getCacheEntry(identifier); + } + } else if (node instanceof WriteNode) { + WriteNode write = (WriteNode) node; + if (write.location() instanceof ConstantLocationNode) { + ValueNode object = GraphUtil.unproxify(write.object()); + ReadCacheEntry identifier = new ReadCacheEntry(object, write.location()); + ValueNode cachedValue = state.getCacheEntry(identifier); - ValueNode value = getScalarAlias(write.value()); - if (GraphUtil.unproxify(value) == GraphUtil.unproxify(cachedValue)) { - effects.deleteFixedNode(write); - deleted = true; - } - processIdentity(state, write.location().getLocationIdentity()); - state.addCacheEntry(identifier, value); - } else { - processIdentity(state, write.location().getLocationIdentity()); + ValueNode value = getScalarAlias(write.value()); + if (GraphUtil.unproxify(value) == GraphUtil.unproxify(cachedValue)) { + effects.deleteFixedNode(write); + deleted = true; } + processIdentity(state, write.location().getLocationIdentity()); + state.addCacheEntry(identifier, value); + } else { + processIdentity(state, write.location().getLocationIdentity()); } } else if (node instanceof UnsafeAccessNode) { if (node instanceof UnsafeLoadNode) {