On Fri, 6 Mar 2026 13:38:31 GMT, Coleen Phillimore <[email protected]> wrote:
> This looks really good! I think the mainline and this change can be merged
> easily so can go into both and not need breaking up.
Thanks for reviewing!
> src/hotspot/share/oops/arrayKlass.cpp line 116:
>
>> 114:
>> 115: ArrayKlass::ArrayKlass(int n, Symbol* name, KlassKind kind,
>> ArrayProperties props)
>> 116: : Klass(kind, calc_prototype_header(kind, props)),
>
> Does this prototype header account for the special one for
> UseCompactObjectHeaders? It didn't before so this looks correct but I think
> we should always use prototype_header from the Klass unconditionally as a
> separate RFE.
The UCOH prototype header gets created in the Klass construct:
Klass::Klass(KlassKind kind, markWord prototype_header) : _kind(kind),
_shared_class_path_index(-1) {
set_prototype_header(make_prototype_header(this, prototype_header));
and:
inline markWord Klass::make_prototype_header(const Klass* kls, markWord
prototype) {
if (UseCompactObjectHeaders) {
// With compact object headers, the narrow Klass ID is part of the mark
word.
// We therefore seed the mark word with the narrow Klass ID.
precond(CompressedKlassPointers::is_encodable(kls));
const narrowKlass nk =
CompressedKlassPointers::encode(const_cast<Klass*>(kls));
prototype = prototype.set_narrow_klass(nk);
}
return prototype;
}
-------------
PR Comment: https://git.openjdk.org/valhalla/pull/2117#issuecomment-4011892988
PR Review Comment:
https://git.openjdk.org/valhalla/pull/2117#discussion_r2895896995