On Fri, 20 Nov 2026 21:01:26 GMT, Serguei Spitsyn <[email protected]> wrote:
>> test/hotspot/jtreg/serviceability/jvmti/valhalla/GetCtorLocal/GetCtorLocalStrictInitFields.java
>> line 468:
>>
>>> 466: while (!test.canContinue) {}
>>> 467: }
>>> 468: Reference.reachabilityFence(this);
>>
>> Can you explain the need for this?
>
> This is the case with a value class without fields. JIT compiler can optimize
> it throw away `this`.
> It is needed to keep the real value of this object in slot 0.
Ok. I think it would be good to add a comment about this.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/33526#discussion_r4647972841