On Fri, 13 Mar 2026 08:03:18 GMT, Axel Boldt-Christmas <[email protected]> 
wrote:

>> Stefan Karlsson has updated the pull request with a new target base due to a 
>> merge or a rebase. The pull request now contains 14 commits:
>> 
>>  - Merge remote-tracking branch 'valhalla/lworld' into 
>> lworld_array_klass_cleanups
>>  - Update assert in CollectedHeap::array_allocate
>>  - Merge remote-tracking branch 'valhalla/lworld' into 
>> lworld_array_klass_cleanups
>>  - faKlass => fak
>>  - Stray whitespaces
>>  - Restore jniCheck.cpp
>>  - Array cleanups
>>  - Retype _objectArrayKlass
>>  - allocate_instance
>>  - Small cleanups
>>  - ... and 4 more: 
>> https://git.openjdk.org/valhalla/compare/db5c1873...531d7d01
>
> src/hotspot/share/memory/universe.cpp line 521:
> 
>> 519:     // Create a RefArrayKlass (which is the default) and initialize.
>> 520:     ObjArrayKlass* rak = 
>> ObjArrayKlass::cast(oak)->klass_with_properties(ArrayProperties::Default(), 
>> THREAD);
>> 521:     _objectArrayKlass = RefArrayKlass::cast(rak);
> 
> Should this use `CHECK`. Clearly something is wrong if we fail this early, 
> but in debug build we will crash inside `RefArrayKlass::cast`. 
> 
> Unclear why we used THREAD here at all as genesis will just return, hit an 
> exception mark and exit the VM with an appropriate 
> `vm_exit_during_initialization` message.

Good point. I'll change this to use CHECK.

> src/hotspot/share/runtime/deoptimization.cpp line 1335:
> 
>> 1333:       FlatArrayKlass* ak = FlatArrayKlass::cast(k);
>> 1334:       // Inline type array must be zeroed because not all memory is 
>> reassigned
>> 1335:       // FIXME: Is this missing an InternalOOMEMark?
> 
> I think we should have a `InternalOOMEMark` here. 
> 
> We should neither end up in `report_java_out_of_memory` nor create a 
> backtrace if we fail to allocate here.

I'll fix this in a small, separate PR.

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

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2207#discussion_r2929765661
PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2207#discussion_r2929768991

Reply via email to