RFR: 8265411: Avoid unnecessary Method::init_intrinsic_id calls

David Holmes dholmes at openjdk.java.net
Tue Apr 20 05:23:07 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.

Hi Ioi,

That all appears fine to me.

Is there any startup impact?

Thanks,
David

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

Marked as reviewed by dholmes (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/3564


More information about the hotspot-dev mailing list