On Fri, 8 May 2026 18:05:37 GMT, Serguei Spitsyn <[email protected]> wrote:

>> (I'm guessing a "snapshot" is an operation that only makes sense for value 
>> objects, so you would not do it for the BigInteger. But I'm not sure.)
>
> Got it, thank you for checking!
> 
>> do you check whether this is a value object (an Integer, not a BigInteger), 
>> or do you apply the special-case logic to all values of this, whether they 
>> are Integers or BigIntegers?
> 
> We check whether this is a value object and do not care about identity 
> objects like BigIntegers.
> 
>> I'm guessing a "snapshot" is an operation that only makes sense for value 
>> objects, so you would not do it for the BigInteger.
> 
> Yes, exactly.

Okay, then here's how I'd phrase it:

> When preview features are enabled, if the requested local is the 
> "<code>this</code>" variable
> of a constructor, and it references a value object, the value_ptr is set to a 
> snapshot of the
> value object.

-------------

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2412#discussion_r3210585645

Reply via email to