On Fri, 8 May 2026 23:31:48 GMT, Serguei Spitsyn <[email protected]> wrote:

>> This update address two enhancements:
>>  - [8380075](https://bugs.openjdk.org/browse/JDK-8380075) [lworld] Update 
>> JVMTI spec to clarify that ObjectFree events are not sent for value objects
>>  - [8384049](https://bugs.openjdk.org/browse/JDK-8384049) [lworld] Minor 
>> GetLocalObject/GetLocalInstance spec wording update
>> 
>> The first one adds an `ObjectFree` event spec clarification that only 
>> identity objects are supported by this event.
>> The second one just slightly reformulates previously added spec 
>> clarifications for the JVMTI  `GetLocalObject` and `GetLocalInstance` 
>> functions, underlying that they work only when preview features are enabled.
>> 
>> The `ObjectFree` implementation does not need any matching update. Strong 
>> references are used for value objects instead of weak references in the 
>> `JvmtiTagMap`, so the value objects are kept alive while they are listed in 
>> the `JvmtiTagMap`. This means there are no `ObjectFree` events can be 
>> generated for value objects.
>> 
>> Testing:
>>  - No testing is needed for pure spec wording changes
>> 
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Serguei Spitsyn has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   review: minor spec tweak

src/hotspot/share/prims/jvmti.xml line 5893:

> 5891:               When preview features are enabled, the frame's method is 
> a value class
> 5892:               constructor and the requested local is a 
> "<code>this</code>" value object,
> 5893:               the value_ptr is set to a snapshot of the 
> "<code>this</code>" object.

I'm not so sure about the change to use "a 'this' value object" instead of "the 
'this' value object". Also, separating out the "value" part might help here:


When preview features are enabled, if the frame's method is a value class
constructor, and the requested local is the “this” object, and “this” is a 
value object,
then value_ptr is set to a snapshot of the "<code>this</code>" object.


and you might want to add the following clarifying statement at the end. I 
think Dean suggested something along these lines:

`… that represents the value object’s state at the point the snapshot is taken.`

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

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

Reply via email to