RFR: 8347006: LoadRangeNode floats above array guard in arraycopy intrinsic

Roland Westrelin roland at openjdk.org
Wed Jan 8 12:29:50 UTC 2025


On Wed, 8 Jan 2025 12:23:07 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:

>> src/hotspot/share/opto/library_call.cpp line 5920:
>> 
>>> 5918:     // Keep track of the information that src/dest are arrays to prevent below array specific accesses from floating above.
>>> 5919:     generate_non_array_guard(load_object_klass(src), slow_region);
>>> 5920:     const Type* tary = TypeAryPtr::make(TypePtr::BotPTR, TypeAry::make(Type::BOTTOM, TypeInt::POS), nullptr, false, Type::OffsetBot);
>> 
>> Is this never used elsewhere? Should it a static field in `TypeAryPtr` same as `TypeAryPtr::BYTES` and friends?
>
> I wondered as well and no, we don't use this type anywhere else (the closest would be `TypeAryPtr::RANGE`). We only create it when meeting arrays of primitive and non-primitive element type. Do you think this should still go to `TypeAryPtr::*`?

I would add it to `TypeAryPtr` (maybe as `TypeAryPtr::BOTTOM`) . The main benefit I see is that the new code would more readable if it referred to `TypeAryPtr::BOTTOM` rather than the long type creation expression.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22967#discussion_r1907107453


More information about the hotspot-compiler-dev mailing list