RFR: JDK-8318563: GetClassFields should not use random access to field [v2]

Chris Plummer cjplummer at openjdk.org
Wed Jan 10 05:31:24 UTC 2024


On Wed, 10 Jan 2024 02:39:33 GMT, Alex Menkov <amenkov at openjdk.org> wrote:

>> FieldStream/FilteredFieldStream classes from reflectionUtils.hpp iterate class fields in the reverse order and use field indexes to access instead of forward iteration. This is performance ineffective (see [JDK-8317692](https://bugs.openjdk.org/browse/JDK-8317692) for details).
>> The change introduces new class FilteredJavaFieldStream as a replacement for FilteredFieldStream.
>> It uses the same FilteredField/FilteredFieldsMap stuff as FilteredJavaFieldStream does.
>> 
>> FieldStream/FilteredFieldStream are still used by heap walking API, will be cleaned by [JDK-8317636](https://bugs.openjdk.org/browse/JDK-8317636)
>> 
>> Testing:
>> - tier1..3
>> - all tests which calls GetClassFields: open/test/hotspot/jtreg/serviceability/jvmti,open/test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetClassFields,open/test/hotspot/jtreg/vmTestbase/nsk/jvmti/IterateThroughHeap,open/test/hotspot/jtreg/vmTestbase/nsk/jvmti/unit/IsSynthetic
>> including
>>   - test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetClassFields/getclfld007.java - tests that GetClassFields returns fields in correct order;
>>   - test/hotspot/jtreg/serviceability/jvmti/GetClassFields/FilteredFields/FilteredFieldsTest.java - test that GetClassFields filters out field like reflection.
>
> Alex Menkov has updated the pull request incrementally with one additional commit since the last revision:
> 
>   copyright headers

src/hotspot/share/prims/jvmtiEnv.cpp line 2910:

> 2908:     result_list[i] = jfieldIDWorkaround::to_jfieldID(
> 2909:           ik, flds.offset(),
> 2910:           flds.access_flags().is_static());

I think the indent here should be 4, not 6.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17094#discussion_r1446894480


More information about the serviceability-dev mailing list