RFR: 8331196: vector api: Remove unnecessary index check in Byte/ShortVector.fromArray/fromArray0Template

Paul Sandoz psandoz at openjdk.org
Wed May 22 18:21:02 UTC 2024


On Fri, 26 Apr 2024 14:06:02 GMT, Hamlin Li <mli at openjdk.org> wrote:

> Hi,
> Can you help to review this simple patch?
> Some index check in Byte/ShortVector.fromArray/fromArray0Template seems not necessary, could be removed.
> Thanks

The intrinsic implementation will not perform bounds checks. I think what you may be observing is the result of bounds checks when Java code is interpreted (or perhaps from compiled C1 code). You need to first ensure the code is compiled to C2 before executing with out of bounds values.

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

PR Comment: https://git.openjdk.org/jdk/pull/18977#issuecomment-2125465612


More information about the core-libs-dev mailing list