RFR: 8265411: Avoid unnecessary Method::init_intrinsic_id calls
Yumin Qi
minqi at openjdk.java.net
Tue Apr 20 18:15:39 UTC 2021
On Mon, 19 Apr 2021 05:52:02 GMT, Ioi Lam <iklam at openjdk.org> wrote:
> `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.
BTW, the the fix works for the problem: adding symbols to vmSymbols.hpp caused debug build failed due to this bug.
-------------
PR: https://git.openjdk.java.net/jdk/pull/3564
More information about the hotspot-dev
mailing list