# HG changeset patch # User Doug Simon # Date 1380104527 -7200 # Node ID 56c3ec12a79c748b29603e1ff4f431bf1f82340c # Parent b2c74b9fd4ab7622ebb53866eda6ef54357c9343# Parent a2958b7bf83f1c83f02f7aa51b84d495b19011ba Merge. diff -r a2958b7bf83f -r 56c3ec12a79c graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java Wed Sep 25 12:17:55 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java Wed Sep 25 12:22:07 2013 +0200 @@ -618,7 +618,7 @@ value = checkcastNode; } } else { - LoadHubNode arrayClass = graph.unique(new LoadHubNode(array, wordKind, boundsCheck.asNode())); + FloatingReadNode arrayClass = createReadHub(graph, wordKind, array, boundsCheck); LocationNode location = ConstantLocationNode.create(FINAL_LOCATION, wordKind, config.arrayClassElementOffset, graph); /* * Anchor the read of the element klass to the cfg, because it is only valid @@ -990,13 +990,14 @@ } } - private static GuardingNode createBoundsCheck(AccessIndexedNode n, LoweringTool tool) { - StructuredGraph graph = n.graph(); - ArrayLengthNode arrayLength = graph.add(new ArrayLengthNode(n.array())); - GuardingNode guard = tool.createGuard(graph.unique(new IntegerBelowThanNode(n.index(), arrayLength)), BoundsCheckException, InvalidateReprofile); - - graph.addBeforeFixed(n, arrayLength); - return guard; + private GuardingNode createBoundsCheck(AccessIndexedNode n, LoweringTool tool) { + StructuredGraph g = n.graph(); + ValueNode array = n.array(); + Stamp stamp = StampFactory.positiveInt(); + ReadNode arrayLength = g.add(new ReadNode(array, ConstantLocationNode.create(FINAL_LOCATION, Kind.Int, config.arrayLengthOffset, g), stamp, BarrierType.NONE, false)); + g.addBeforeFixed(n, arrayLength); + tool.createNullCheckGuard(arrayLength, array); + return tool.createGuard(g.unique(new IntegerBelowThanNode(n.index(), arrayLength)), BoundsCheckException, InvalidateReprofile); } public ResolvedJavaType lookupJavaType(Class clazz) {