RFR: 8265411: Avoid unnecessary Method::init_intrinsic_id calls
Ioi Lam
iklam at openjdk.java.net
Mon Apr 19 17:56:56 UTC 2021
`check_methods_for_intrinsics()` in classFileParser.cpp calls `Method::klass_id_for_intrinsics()` to see if a class has intrinsic methods. However, the latter returns any class whose name is included in `vmSymbols`. This causes many unnecessary calls to `Method::init_intrinsic_id()`.
To fix this, we precompute the classes that are known to have intrinsics using `constexpr`. See `vmIntrinsics::class_has_intrinsics`.
After the fix, when running `java -Xshare:off -version`, the number of classes initialized for intrinsics is reduced from 130 to 30.
Testing: mach5 tiers 1~4 passed.
-------------
Commit messages:
- more fixes
- Improve vmIntrinsics with constexpr
Changes: https://git.openjdk.java.net/jdk/pull/3564/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3564&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8265411
Stats: 54 lines in 5 files changed: 47 ins; 0 del; 7 mod
Patch: https://git.openjdk.java.net/jdk/pull/3564.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/3564/head:pull/3564
PR: https://git.openjdk.java.net/jdk/pull/3564
More information about the hotspot-dev
mailing list