On Tue, 10 Sep 2024 08:37:43 GMT, Roman Kennke <rken...@openjdk.org> wrote:

>>>     could be any value that is not a valid field offset
>> 
>> I understand that that "random value" needs to satisfy this condition.
>
> With compact headers, this value should only be used in C2, and not really as 
> an actual offset. An earlier version of the change had the value in 
> src/hotspot/share/opto/type.hpp instead, and only an assert(!UCOH) in 
> oopDesc::klass_offset_in_bytes(). I think this would be a better solution 
> overall, because it prevents accidental (and wrong) usage of the klass_offset 
> in the runtime. Back then it has been rejected by somebody (don't remember), 
> because it made the C2 diff a little messier, so I kept it like it is now. I 
> would prefer to reinstate it, though.

> (Fwiw, the method is also used during Universe initialization).

Yes, but only in the -UCOH branch.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20677#discussion_r1751604467

Reply via email to