On Tue, 16 Dec 2025 10:08:41 GMT, Paul Hübner <[email protected]> wrote:

>> src/hotspot/share/oops/arrayOop.hpp line 59:
>> 
>>> 57:   // Given a type, return true if elements of that type must be aligned 
>>> to 64-bit.
>>> 58:   static bool element_type_should_be_aligned(BasicType type) {
>>> 59:     if (type == T_FLAT_ELEMENT) {
>> 
>> You don't need `EnableValhalla` or `Arguments::is_valhalla_enabled()` as 
>> long as all callers
>> of `element_type_should_be_aligned()` only pass known valid BasicType 
>> values. If any caller
>> passes a non-valid BasicType value as part of a "probing call", then a call 
>> with a value that
>> happens to match `T_FLAT_ELEMENT` by a VM with 
>> `Arguments::is_valhalla_enabled() == false`
>> will return `true` unexpectedly.
>
> I think this should be fine because `T_FLAT_ELEMENT` is hardcoded to `15` 
> regardless of if Valhalla/preview is enabled.

Testing until tier 4 also shows no issue, so I think I'm confident enough to 
leave it as is. Unless someone from compiler has any insights?

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

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/1759#discussion_r2622637514

Reply via email to