On Mon, 16 Nov 2026 19:43:04 GMT, Chris Plummer <[email protected]> wrote:

>> Alan Bateman has updated the pull request with a new target base due to a 
>> merge or a rebase. The incremental webrev excludes the unrelated changes 
>> brought in by the merge/rebase. The pull request contains 19 additional 
>> commits since the last revision:
>> 
>>  - Address review comments with test
>>  - Merge branch 'master' into WatchedField
>>  - Drop: Constructor invocations in caller frames are not considered.
>>  - Update comment
>>  - Ignore this-escape
>>  - Merge branch 'master' into WatchedField
>>  - Add @bug to test
>>  - Merge branch 'master' into WatchedField
>>  - Improve wording, drop some commas
>>  - Spec/docs improvements
>>  - ... and 9 more: https://git.openjdk.org/jdk/compare/d0d97704...cf298eb4
>
> src/jdk.jdi/share/classes/com/sun/jdi/event/AccessWatchpointEvent.java line 
> 41:
> 
>> 39:  * declaring the field is being initialized by the event thread and the 
>> class
>> 40:  * declares strictly-initialized static fields.
>> 41:  * <p>
> 
> The JVMTI spec makes is clear that this applies when then object is in slot 0:
> 
> "...and slot 0 of the local variable array contains a reference to the object 
> containing the watched field."
> 
> We are missing that here, and instead refer to the object being constructed, 
> which might not in slot 0.

The JDI spec is more "user facing" and doesn't currently speak of slot 0, e.g. 
StackFrame::thisObject is specified to return "this" without getting into the 
possibility of funky bytecode that overwrites slot 0. The intent with the 
updates to the JDI request and event classes to try to keep the docs at the 
same level. I can add a sentence if you think we need it, in which case it 
would go into the JDWP spec too.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/33841#discussion_r4596666204

Reply via email to