On Sat, 22 Aug 2026 03:14:11 GMT, Yasumasa Suenaga <[email protected]> wrote:
>> src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Inline.java line 37:
>>
>>> 35:
>>> 36: public class Inline extends Instance {
>>> 37:
>>
>> I think a comment here is needed that explains that instances of this class
>> can be used to represent instances of a class that is inline-able
>> (InlineKlass), both flattened instances and heap instances.
>
> Added in new commit.
> Inline represents "inlineOop" in HotSpot in SA
This is the reason I wanted some clarifying comments. I think this is actually
incorrect. An inlineOop in hotspot is always heap allocated / buffered, whereas
in SA Inline can represent a either a heap allocated instance of an inlinable
class, or a flattened instance (not heap buffered). So Instance does always map
to an instanceOop, but Inline does not always map to an inlineOop.
>> src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Inline.java line 53:
>>
>>> 51: super(handle, heap);
>>> 52: this.klass = klass;
>>> 53: isFlattened = klass != null; // Assumes this instance is
>>> flattened if klass is passed.
>>
>> Is klass ever nulll? Seems that it is something that we should assert here,
>> and just always set isFlattened to true.
>
> For consistency, `Inline(OopHandle handle, ObjectHeap heap)` calls this c'tor
> like `this(handle, heap, null)`.
Perhaps it shouldn't do that and instead just call super(). In other words make
it clear that one constructor is for buffered instances of inlinable types and
the other is for flattened instances of inlineable types.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/32310#discussion_r3848442306
PR Review Comment: https://git.openjdk.org/jdk/pull/32310#discussion_r3848457161