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().
https://github.com/openjdk/jdk/blob/1ac25b8201479be51113ff657b9a87fa29a690e8/src/hotspot/share/classfile/classFileParser.cpp#L5249
https://github.com/openjdk/jdk/blob/1ac25b8201479be51113ff657b9a87fa29a690e8/src/hotspot/share/oops/method.cpp#L1549
Suggested fix:
Method::klass_id_for_intrinsics() should return only classes that are known to have intrinsics.
After the fix, when running "java -Xshare:off -version", the number of classes initialized for intrinsics is reduced from 130 to 30.
https://github.com/openjdk/jdk/blob/1ac25b8201479be51113ff657b9a87fa29a690e8/src/hotspot/share/classfile/classFileParser.cpp#L5249
https://github.com/openjdk/jdk/blob/1ac25b8201479be51113ff657b9a87fa29a690e8/src/hotspot/share/oops/method.cpp#L1549
Suggested fix:
Method::klass_id_for_intrinsics() should return only classes that are known to have intrinsics.
After the fix, when running "java -Xshare:off -version", the number of classes initialized for intrinsics is reduced from 130 to 30.