Mercurial > hg > truffle
changeset 11225:038a598da996
fix lowering of StoreIndexedNode (anchor read of element klass)
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Tue, 06 Aug 2013 21:28:58 +0200 |
parents | 679ba643aa71 |
children | cf9603cd8b13 |
files | graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java Tue Aug 06 10:50:53 2013 -0700 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java Tue Aug 06 21:28:58 2013 +0200 @@ -623,7 +623,12 @@ } else { LoadHubNode arrayClass = graph.add(new LoadHubNode(array, wordKind)); LocationNode location = ConstantLocationNode.create(FINAL_LOCATION, wordKind, config.arrayClassElementOffset, graph); - FloatingReadNode arrayElementKlass = graph.unique(new FloatingReadNode(arrayClass, location, null, StampFactory.forKind(wordKind()))); + /* + * Anchor the read of the element klass to the cfg, because it is only valid + * when arrayClass is an object class, which might not be the case in other + * parts of the compiled method. + */ + FloatingReadNode arrayElementKlass = graph.unique(new FloatingReadNode(arrayClass, location, BeginNode.prevBegin(storeIndexed), StampFactory.forKind(wordKind()))); CheckCastDynamicNode checkcast = graph.add(new CheckCastDynamicNode(arrayElementKlass, value, true)); graph.addBeforeFixed(storeIndexed, checkcast); graph.addBeforeFixed(checkcast, arrayClass);