On Thu, 1 Oct 2026 23:08:42 GMT, Serguei Spitsyn <[email protected]> wrote:

> When the JVMTI `IterateThroughHeap` has a class filter then the flattened 
> value objects contained in the fields of filtered class objects are not 
> reported. The fix is:
>  - If the object has flattened fields, visit and report them as heap objects 
> even though this object was not reported.
> 
> The update adds new test with a needed coverage:
>   
> `test/hotspot/jtreg/serviceability/jvmti/valhalla/Heapwalking/FlatClassFilterTest.java`
> 
> Testing:
>  - check new test is failing without fix and is passing with the fix
>  - TBD: run 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).

test/hotspot/jtreg/serviceability/jvmti/valhalla/Heapwalking/FlatClassFilterTest.java
 line 79:

> 77:         Value[] arr = 
> (Value[])ValueClass.newNullableAtomicArray(Value.class, 5);
> 78:         for (int i = 0; i < arr.length; i++) {
> 79:             arr[i] = i == 2 ? null : new Value(seed + 10 + i);

Suggestion:

            arr[i] = (i == 2 ? null : new Value(seed + 10 + i));

test/hotspot/jtreg/serviceability/jvmti/valhalla/Heapwalking/libFlatClassFilterTest.cpp
 line 54:

> 52:   callbacks.heap_iteration_callback = heap_iteration;
> 53: 
> 54:   err = jvmti->IterateThroughHeap(0, filter, &callbacks, nullptr);

Have you considered increasing test coverage by also testing with 
JVMTI_HEAP_FILTER_CLASS_UNTAGGED in a separate test case?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/33172#discussion_r4200198178
PR Review Comment: https://git.openjdk.org/jdk/pull/33172#discussion_r4200982479

Reply via email to