On Tue, 25 Aug 2026 06:35:37 GMT, Yasumasa Suenaga <[email protected]> wrote:
>>> 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. > > I found following code at `flatArrayOopDesc::obj_at_put()`. `inlineOop` is > used to put the value into the payload. > > https://github.com/openjdk/jdk/blob/cc278dbb8a1ca0754d5842708b9029441055d361/src/hotspot/share/oops/flatArrayOop.inline.hpp#L117-L119 > > It is used like casting, but we can say `inlineOop` is used for both heap > allocated instance and flattened instance. > I understand your comments, but I'm worried how can we handle flattened value > in SA. I think it is simple to use `Inline` (`inlineOop` in HotSpot), but it > is the best to follow HotSpot manner. HotSpot looks like to handle it as > `oop` - should we cast flattened value to `Instance` in SA? It seems like what you've done with Inline is make it a combination of both InlineKlass and FlatValuePayload. I can see the advantage of doing this, but it needs to be well explained here. You might want to consider instead creating a new type called FlattenedInline that subclasses Inline and contains the following constructor: Inline(OopHandle handle, ObjectHeap heap, InlineKlass klass) { And also provides overrides as needed. This separation I think would help to self document what the code is doing. The one thing odd about this setup is that FlattenedInline does not directly map to anything in hotspot type, but I think you can just call that out with a comment. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/32310#discussion_r3859403465
