RFR: 8361842: Move input validation checks to Java for java.lang.StringCoding intrinsics [v13]
Volkan Yazici
vyazici at openjdk.org
Mon Aug 11 13:47:44 UTC 2025
On Mon, 11 Aug 2025 12:43:38 GMT, Claes Redestad <redestad at openjdk.org> wrote:
>> Volkan Yazici has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 31 additional commits since the last revision:
>>
>> - Merge remote-tracking branch 'upstream/master' into strIntrinCheck
>> - Replace `requireNonNull` with implicit null checks to reduce bytecode size
>> - Add `@bug` tags
>> - Improve wording of `@param len`
>> - Make source array bound checks lenient too
>> - Cap destination array bounds
>> - Fix bit shifting
>> - Remove superseded `@throws` Javadoc
>> - Merge remote-tracking branch 'upstream/master' into strIntrinCheck
>> - Make `StringCoding` encoding intrinsics lenient
>> - ... and 21 more: https://git.openjdk.org/jdk/compare/357546c1...c322f0e0
>
> src/hotspot/share/opto/library_call.cpp line 946:
>
>> 944: Node* count,
>> 945: bool char_count,
>> 946: bool halt) {
>
> Could we rename this to something more descriptive such as `halt_on_oob`?
Changed as requested in 9b721bb9fee.
> src/hotspot/share/opto/library_call.cpp line 964:
>
>> 962:
>> 963: if (bailout->req() > 1) {
>> 964: bailout = _gvn.transform(bailout)->as_Region();
>
> Should this be done only for the case where it's needed, i.e., in the `if (halt)` branch? Not sure it has any side-effect but it seems prudent not to change the default code more than necessary.
Changed as requested in 4d2a7a39c50.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25998#discussion_r2266824420
PR Review Comment: https://git.openjdk.org/jdk/pull/25998#discussion_r2266823319
More information about the hotspot-dev
mailing list