On Fri, 24 Apr 2026 06:31:22 GMT, Dean Long <[email protected]> wrote:

>> This enhancement is to a add JVMTI debugging support for value object 
>> construction.
>> The fix includes:
>>  - Minor `GetLocalObject` and `GetLocalInstance` spec clarifications
>>  - JVMTI functions `GetLocalObject` and `GetLocalInstance` now return a 
>> snapshot of the `THIS` object if it is requested during a value object 
>> construction.
>>  - This update adds new test with a needed test coverage: 
>> `test/hotspot/jtreg/serviceability/jvmti/valhalla/GetCtorLocal`.
>>  - Some corrections in the test 
>> `test/hotspot/jtreg/serviceability/jvmti/valhalla/GetSetLocal` for 
>> unification with the test above.
>> 
>> Testing:
>>   - Tested locally with new test `GetCtorLocal`
>>   - Tested with mach5 tiers 1-6
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> src/hotspot/share/prims/jvmtiImpl.cpp line 641:
> 
>> 639:           if (Arguments::is_valhalla_enabled()) {
>> 640:             bool is_ctor = _jvf->method()->is_object_constructor();
>> 641:             if (is_ctor && _index == 0 && obj != nullptr && 
>> obj->is_inline()) {
> 
> I thought local slots can be recycled, so checking for local 0 is not 
> reliable.  I would think it is necessary to check the LocalVariableTable to 
> find the bci range for the "this" variable.

Thank you for the comment. The `LocalVariableTable` is not always available. 
The implementation has many checks in place. Please, see 
`check_slot_type_lvt()` and `check_slot_type_no_lvt()`.

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

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2363#discussion_r3139229783

Reply via email to