On Fri, 27 Mar 2026 06:35:40 GMT, Stefan Karlsson <[email protected]> wrote:

>> src/hotspot/share/prims/jvm.cpp line 564:
>> 
>>> 562:   Klass* klass = o->klass();
>>> 563: 
>>> 564:   return klass->is_flatArray_klass();
>> 
>> Given the definition:
>> 
>> #ifdef _LP64
>> bool oopDesc::is_flatArray() const {
>>   markWord mrk = mark();
>>   return (mrk.is_unlocked()) ? mrk.is_flat_array() : 
>> klass()->is_flatArray_klass();
>> }
>> 
>> I think this needs to retain the original form and not call 
>> `is_flatArray_klass` directly.
>
> I don't think it does. The mark word is just another way to query the 
> information that we get from by querying the class.
> 
> In fact, I have a prototype that completely removes these `functions` from 
> the mark word and let all C++ code go through the Klass pointer. This cuts 
> down on the complexity and some of the risks of those bits being unstable 
> while inflating object monitors. Left are the JIT compilers using those bits, 
> and having to navigate around the locking code.

If the markword logic is going away then sure. I have to query why we have/had 
two ways of querying this though? Optimization?

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

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2261#discussion_r3000690165

Reply via email to