On Wed, 26 Aug 2026 03:27:39 GMT, Chris Plummer <[email protected]> wrote:
>> 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. Thanks for your suggestion! I added `FlattenedInline` and refactored to use it. Also I added comments both `Inline` and `FlattenedInline` of course. How about this? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/32310#discussion_r3859975128
