On Wed, 9 Sep 2026 23:28:39 GMT, Serguei Spitsyn <[email protected]> wrote:
>> Yasumasa Suenaga has updated the pull request with a new target base due to >> a merge or a rebase. The pull request now contains 18 commits: >> >> - Rename to "Value" from "Inline" >> - Merge branch 'master' into JDK-8390106 >> - Merge remote-tracking branch 'origin/master' into JDK-8390106 >> - Update testcase >> - Add override methods >> - Check null marker for value object >> - Merge branch 'master' into JDK-8390106 >> - Update comments >> - Add isInline() >> - Update >> src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/FlattenedInline.java >> >> Co-authored-by: Chris Plummer <[email protected]> >> - ... and 8 more: https://git.openjdk.org/jdk/compare/4c98aa9d...932cbd82 > > src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java line > 186: > >> 184: if (klass instanceof ObjArrayKlass) return new ObjArray(handle, >> this); >> 185: if (klass instanceof InstanceKlass) return new Instance(handle, >> this); >> 186: if (klass instanceof ValueKlass) return new Value(handle, >> this); > > I'm not sure the above line 186 is correct. Should we swap it with the line > 185? > The ValueClass is a sub-class of the InstanceClass, so that the line 185 will > always return newly constructed Instance instead of Value for any class which > is an instance of ValueKlass. I'm pretty sure you are correct. So then the question is why doesn't this cause any failures. I think the reason is because the only meaning override done by Value is to make isValue() return true, and no one calls isValue(). So then the question is why do we have Value? I think we don't actually need it and FlattenValue can inherit from Instance instead, but I think it is a cleaner abstraction to keep Value in place. So I suggest just reverse the order of 185 and 186 and put a comment in explaining how the order matters. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/32310#discussion_r3974152640
