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

Avoid unnecessary Method::init_intrinsic_id calls

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 17
    • Fix Version/s: 17
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      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

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

                Dates

                Created:
                Updated:
                Resolved: