RFR(M): 8137168: Replace IfNode with a new RangeCheckNode for range checks

Vladimir Kozlov vladimir.kozlov at oracle.com
Sat Sep 26 02:45:24 UTC 2015

Looks fine to me.


On 9/25/15 11:04 PM, Roland Westrelin wrote:
> This code adds a new ideal node, RangeCheckNode that is inserted during parsing when a range check is emitted. The entire change is code refactoring to accommodate the new node. This is preparation work for 8042997 and 8135248.
> 8135248 will add a new method to java.util.Arrays:
> int checkIndex(int index, int length,
>                 OutOfBoundsToException<T> oobe) throws T, IndexOutOfBoundsException {
>      if (index < 0 || index >= length)
>          throw outOfBounds(index, length, length, oobe);
>      return index;
> }
> 8042997 will intrinsify that method and translate it into a CmpU + RangeCheckNode.
> The benefit of the RangeCheckNode is that it will help the compiler locate range checks to optimize even if they don’t strictly follow the pattern of a range check: CmpU + IfNode + LoadRange. The idea of using a node specifically for range checks is from John.
> http://cr.openjdk.java.net/~roland/8137168/webrev.00/
> Roland.

More information about the hotspot-compiler-dev mailing list