Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8265411

Avoid unnecessary Method::init_intrinsic_id calls

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 17
    • 17
    • hotspot
    • b19

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              iklam Ioi Lam
              iklam Ioi Lam
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: