On Wed, 1 Jul 2026 00:00:02 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 3023: > >> 3021: JvmtiEnvThreadStateIterator it(state); >> 3022: for (JvmtiEnvThreadState* ets = it.first(); ets != nullptr; ets = >> it.next(ets)) { >> 3023: JvmtiEnv *env = ets->get_env(); > > Not related to you fix just general comment for next clean up. > It seems that the 'ets' is needed only to get 'env'. > > So all loop might be rewritten similar to same in the > `void JvmtiExport::post_vm_object_alloc(JavaThread *thread, oop object) {` > to be > > `for (JvmtiEnv* env = it.first(); env != nullptr; env = it.next(env)) {` Thank you for the check. There is the line 3024 which needs the `ets`: ` if (ets->is_enabled(JVMTI_EVENT_SAMPLED_OBJECT_ALLOC) &&` ------------- PR Review Comment: https://git.openjdk.org/valhalla/pull/2607#discussion_r3503340152
