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

Refactor the discovery of AOT cache artifacts

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 25
    • None
    • hotspot
    • b06

      In the initial implementation of JEP 483 (JDK-8315737), there are two loops that discover what hidden classes are required, and what classes should be AOT-initialized:

      [1] SystemDictionaryShared::find_all_archivable_classes()
      [2] HeapShared::find_all_aot_initialized_classes()

      These loops look similar -- they scan the classes, the constant pools (and in the case of the second loop, all the heap objects that can be archived) until a stable state is reached.

      This scanning is surprisingly similar to the loop for discovering all the archivable heap objects

      [3] HeapShared::archive_objects()

      =================
      Proposal: consolidate all 3 loops into one -- discover all archivable classes and Java heap objects, and decide which classes need to be aot-initialized.

      This should significantly reduce the complexity and code duplication. The single loop will be similar as we don't need to worry about passing information among the three loops.

      ==================
      [1] https://github.com/iklam/jdk/blob/ce4c93eef7b41a3097a65709550707b25cca4afe/src/hotspot/share/classfile/systemDictionaryShared.cpp#L732
      [2] https://github.com/iklam/jdk/blob/ce4c93eef7b41a3097a65709550707b25cca4afe/src/hotspot/share/cds/heapShared.cpp#L952
      [3] https://github.com/iklam/jdk/blob/ce4c93eef7b41a3097a65709550707b25cca4afe/src/hotspot/share/cds/heapShared.cpp#L767

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

              Created:
              Updated:
              Resolved: