On Sat, 29 Aug 2026 01:55:33 GMT, Yasumasa Suenaga <[email protected]> wrote:

>> src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/FlattenedInline.java
>>  line 40:
>> 
>>> 38:  * in SA to handle a flattened object in same way as an oop.
>>> 39:  */
>>> 40: public class FlattenedInline extends Inline {
>> 
>> Aren't there a bunch of Oop methods that if called on a FlattenedInline 
>> would fail because they assume `handle` really is a pointer to the start of 
>> the object and expect to find an object header there? Where are the 
>> safeguards for that? It seems the only useful thing FlattenedInline is doing 
>> is supporting getKlass() without the need for an object header, but there is 
>> a bunch of other Oop functionality missing, and I'm not sure if it ever 
>> needed.
>
> I checked base classes `Inline`, `Instance`, and `Oop`. Then I think we have 
> to override (and reports they are not supported in value (flattened) object) 
> `getMark()`, `identityHash()`, and `slowIdentityHash()`.
> 
> I fixed to do that in new commit, and it passed all of serviceability/sa 
> tests.

It looks like no one calls identityHash() and it is the only caller of 
slowIdentityHash(), so neither of those APIs are actually needed. getMark() is 
called by Oop.getKlass(), but FlattenedInline overrides getKlass(). getMark() 
is also called by identityHashValueFor(), but the only caller of 
identityHashValueFor() is slowIdentityHash(), which as pointed out is not 
needed.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/32310#discussion_r3891295272

Reply via email to