On Fri, 13 Mar 2026 08:33:56 GMT, Stefan Karlsson <[email protected]> wrote:
>> I've been looking over the current state of ArrayKlass and the sub-classes
>> and made various cleanups and simplifications that I'd like to get
>> integrated:
>>
>> * Type Universe::_objectArrayKlass as RefArrayKlass
>> * Remove dead flat array code in code in javaClasses.cpp
>> * Used is_refined_objArray_klass where appropriate
>> * Introduce is_unrefined_objArray for asserts and checks
>> * Restore code and whitespace changes compared to upstream
>> * Renamed faklass to fak in oops/ and GC code (I didn't touch other areas
>> that used that name)
>> * Devirtualized ObjArrayKlass::allocate_instance and simplified related code
>> * Moved ArrayKlass::_properties to after the variables for array dimensions.
>> * Made ArrayKlass::_properties const and non-settable
>> * Unified oop_iterate_elements_range implementations
>> * Added ShouldNotReachHere implementation of ObjArrayKlass::copy_array
>> * Removed redundant check in jniCheck.cpp and restored the file
>
> Stefan Karlsson has updated the pull request incrementally with one
> additional commit since the last revision:
>
> THREAD to CHECK
Looks good! Thanks for the rework.
Oh it's already merged. No wonder the approve button wasn't showing. 🙈
src/hotspot/share/classfile/javaClasses.cpp line 1119:
> 1117: }
> 1118: } else {
> 1119: assert(k->is_unrefined_objArray_klass(), "Must be");
Interesting that this `||` instead of `&&` slipped through... I've gone through
the rest of the code and I think all other instances have been fixed.
src/hotspot/share/gc/shared/collectedHeap.inline.hpp line 42:
> 40:
> 41: inline oop CollectedHeap::array_allocate(Klass* klass, size_t size, int
> length, bool do_zero, TRAPS) {
> 42: assert(!klass->is_unrefined_objArray_klass(), "ObjArrayKlass must never
> be used to allocate array instances directly");
Nit: double negative, I'd prefer `klass->is_refined_objArray_klass()`.
-------------
PR Review:
https://git.openjdk.org/valhalla/pull/2207#pullrequestreview-3942606511
PR Comment: https://git.openjdk.org/valhalla/pull/2207#issuecomment-4053793893
PR Review Comment:
https://git.openjdk.org/valhalla/pull/2207#discussion_r2929947371
PR Review Comment:
https://git.openjdk.org/valhalla/pull/2207#discussion_r2929952554