RFR: JDK-8318563: GetClassFields should not use random access to field
Alex Menkov
amenkov at openjdk.org
Wed Dec 13 21:38:54 UTC 2023
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.
-------------
Commit messages:
- GetClassFields
Changes: https://git.openjdk.org/jdk/pull/17094/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17094&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8318563
Stats: 51 lines in 2 files changed: 36 ins; 8 del; 7 mod
Patch: https://git.openjdk.org/jdk/pull/17094.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/17094/head:pull/17094
PR: https://git.openjdk.org/jdk/pull/17094
More information about the hotspot-dev
mailing list