Mercurial > hg > graal-compiler
changeset 1934:b1f2e875300a
Small fix to make Graal snippets work with bounds check elimination.
author | Thomas Wuerthinger <wuerthinger@ssw.jku.at> |
---|---|
date | Tue, 21 Dec 2010 17:40:10 +0100 |
parents | 2a6ce81e3101 |
children | 98dbef29f10b |
files | c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotXirGenerator.java |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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);