On Tue, 30 Jun 2026 23:44:43 GMT, Leonid Mesnik <[email protected]> wrote:

>> This update is for Valhalla pre-integration. It introduces new JVMTI 
>> capability `can_support_value_objects`.
>> The variable `_can_support_value_objects_count` is introduced for 
>> optimization. It follows the pattern of the `can_support_virtual_threads` 
>> capability.
>> 
>> Additionally, this update includes test fixes:
>>  - 
>> test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/libHeapMonitorTest.cpp:
>>    - Removed the `if (!jni->HasIdentity(object))` check  because it is not 
>> needed anymore as the JVMTI capability `can_support_value_objects` is no 
>> acquired by the test
>>  
>>  - These two tests are updated to provide both positive and negative 
>> coverage for new capability:
>>     test/hotspot/jtreg/serviceability/jvmti/valhalla/VMObjectAllocValue
>>     test/hotspot/jtreg/serviceability/jvmti/valhalla/SampledObjectAllocValue
>> 
>> Testing:
>> - Ran updated tests locally
>> - Submitted 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/jvmtiExport.cpp line 2980:
> 
>> 2978:       EVT_TRACE(JVMTI_EVENT_VM_OBJECT_ALLOC, ("[%s] Evt vmobject alloc 
>> sent %s",
>> 2979:                                          
>> JvmtiTrace::safe_get_thread_name(thread),
>> 2980:                                          object==nullptr? "null" : 
>> object->klass()->external_name()));
> 
> Seems the 2980 line was incorrect even without the fix.
> The object can't be null. See line 2964.

Thanks. Right. It has caught my eyes, so I decided to simplify this.

> test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/libHeapMonitorTest.cpp 
> line 532:
> 
>> 530:   jvmtiError err;
>> 531: 
>> 532:   if (!jni->HasIdentity(object)) {
> 
> I wonder if it makes sense to update HepMontior tests to work with value 
> classes events enabled? 
> Not needed to implement in this fix, just file RFE for this.

Thank you for the suggestion. I'm not sure about this, but maybe. This test is 
already big and does many checks.

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

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2607#discussion_r3503315781
PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2607#discussion_r3503309955

Reply via email to