Move interned strings into AOT heap roots array

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 27
    • Affects Version/s: None
    • Component/s: hotspot
    • master

      With AOTMappedHeapLoader, the interned strings are stored inside a cached ObjArray. Because cached ObjArrays cannot be larger than 256KB, we need to split this ObjArray into two levels when there are a lot of interned strings

      https://github.com/openjdk/jdk/blob/fa1b1d677ac492dfdd3110b9303a4c2b009046c8/src/hotspot/share/classfile/stringTable.cpp#L81-L93

      However, we already have a similar mechanism for storing heap roots in multiple ObjArrays that are smaller than 256KB:

      https://github.com/openjdk/jdk/blob/fa1b1d677ac492dfdd3110b9303a4c2b009046c8/src/hotspot/share/cds/aotMappedHeapLoader.cpp#L403-L409

      By storing the interned strings inside the heap roots array, we can get rid of the two-level ObjArray manipulation code in stringTables.cpp.


      Also, this RFE is a prerequisite for JDK-8375569. The function StringTable::allocate_shared_strings_array() requires that the JVM runs only a single Java thread:

      https://github.com/openjdk/jdk/blob/fa1b1d677ac492dfdd3110b9303a4c2b009046c8/src/hotspot/share/classfile/stringTable.cpp#L971-L980

      However, when creating the AOT configuration in the AOT training run, the program can have multiple Java threads, so StringTable::allocate_shared_strings_array() is not going to work. After this RFE is implemented, this function is removed.

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

              Created:
              Updated:
              Resolved: