# HG changeset patch # User Thomas Wuerthinger # Date 1292949610 -3600 # Node ID b1f2e875300a58e9b47c92b07ed385f8cba26349 # Parent 2a6ce81e3101c480cbd0eb1df7174b5a87e40937 Small fix to make Graal snippets work with bounds check elimination. diff -r 2a6ce81e3101 -r b1f2e875300a c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotXirGenerator.java --- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotXirGenerator.java Tue Dec 21 17:09:45 2010 +0100 +++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotXirGenerator.java Tue Dec 21 17:40:10 2010 +0100 @@ -937,7 +937,7 @@ @Override public XirSnippet genArrayLoad(XirSite site, XirArgument array, XirArgument index, XirArgument length, CiKind elementKind, RiType elementType) { - if (length == null) { + if (length == null || !site.requiresBoundsCheck()) { return new XirSnippet(arrayLoadTemplates.get(site, elementKind), array, index); } return new XirSnippet(arrayLoadTemplates.get(site, elementKind, GIVEN_LENGTH), array, index, length); @@ -945,7 +945,7 @@ @Override public XirSnippet genArrayStore(XirSite site, XirArgument array, XirArgument index, XirArgument length, XirArgument value, CiKind elementKind, RiType elementType) { - if (length == null) { + if (length == null || !site.requiresBoundsCheck()) { return new XirSnippet(arrayStoreTemplates.get(site, elementKind), array, index, value); } return new XirSnippet(arrayStoreTemplates.get(site, elementKind, GIVEN_LENGTH), array, index, value, length);