RFR: 8265518: C1: Intrinsic support for Preconditions.checkIndex [v4]

Yi Yang yyang at openjdk.java.net
Thu Apr 29 10:01:52 UTC 2021


On Thu, 29 Apr 2021 09:30:50 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

>> Yi Yang has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   remove extra newline
>
> test/hotspot/jtreg/compiler/c1/TestCheckIndexC1Intrinsic.java line 60:
> 
>> 58:         } catch (IndexOutOfBoundsException e) {
>> 59:             // got it!
>> 60:         }
> 
> In all places where `Precondition.checkIndex` is expected to throw, an AssertionError should  be generated if it doesn't throw:
> 
> 
>         try {
>             Preconditions.checkIndex(1, 1, null);
>             throw new AssertionError("Expected IndexOutOfBoundsException not thrown");
>         } catch (IndexOutOfBoundsException e) {
>             // got it!
>         }

Yes, it does make sense

-------------

PR: https://git.openjdk.java.net/jdk/pull/3615


More information about the hotspot-compiler-dev mailing list