RFR: 8347006: LoadRangeNode floats above array guard in arraycopy intrinsic [v2]
Tobias Hartmann
thartmann at openjdk.org
Wed Jan 8 13:56:46 UTC 2025
On Wed, 8 Jan 2025 13:37:31 GMT, Roland Westrelin <roland at openjdk.org> wrote:
> By that you mean have the slow_region feed into the uncommon trap that's only created later.
Right. It's a bit weird but probably still the best solution in terms of complexity. The trap will lead to recompilation and then the `too_many_traps` check will trigger.
> The other thing is shouldn't the cast be added in generate_non_array_guard()? I see it's used elsewhere (LibraryCallKit::inline_native_getLength()): couldn't the same bug occur there?
Right, good catch. I think the use in `LibraryCallKit::inline_native_getLength` has the same problem. We can't easily put the cast into `generate_non_array_guard` though because it operates on the Klass and not on the object. The other `generate*array*guard` methods potentially have the same issue but current uses look good. I guess it's best to fix the `LibraryCallKit::inline_native_getLength` as well, i.e., make it the caller's responsibility to add a cast. What do you think?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22967#discussion_r1907220074
More information about the hotspot-compiler-dev
mailing list