On Mon, 9 Sep 2024 15:01:10 GMT, Thomas Schatzl <tscha...@openjdk.org> wrote:

>> Just to be clear, the second part of the quoted sentence is important:
>>> could be any value *that is not a valid field offset*
>
>>     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.

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

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

Reply via email to