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

Share method trampolines in CDS dynamic archive

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b22

      Description

      Currently, apps using CDS dynamic archive (-XX:ArchiveClassesAtExit) have slower start-up time than the same apps using CDS static archive (-Xshare:dump). One reason is that DynamicArchiveBuilder::make_trampolines() allocates a separate trampoline for each Method:

      https://github.com/iklam/jdk/blob/cfd41c0c1dfae823d465711d147373c343977f00/src/hotspot/share/memory/dynamicArchive.cpp#L353

      At run time, whenever an archived Method is linked, we need to compile a trampoline call using SharedRuntime::generate_trampoline(). This is a slow operation.

      https://github.com/iklam/jdk/blob/cfd41c0c1dfae823d465711d147373c343977f00/src/hotspot/share/runtime/sharedRuntime.cpp#L2612

      In contrast, in the static archive, archived Methods with the same AdapterHandlerEntry share the same trampoline. At run time, fewer calls to SharedRuntime::generate_trampoline() are made.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: