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

[Leyden] Set UseAOTCodeLoadThread ergonomically

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • repo-leyden
    • repo-leyden
    • hotspot

      During assembly run JVM creates compiler threads "C1 AOT code caching CompilerThread" and "C2 AOT code caching CompilerThread". Their purpose is to load code from AOTCodeCache. However, there is no AOTCodeCache during the assembly run. These threads are only required in production run.

      Turns out this behavior is governed by AOTCodeCache::is_code_load_thread_on() which is defined as:

       bool AOTCodeCache::is_code_load_thread_on() {
        // We cannot trust AOTCodeCache status here, due to bootstrapping circularity.
        // Compilation policy init runs before AOT cache is fully initialized, so the
        // normal AOT cache status check would always fail.
        return UseAOTCodeLoadThread && AOTCodeCaching && CDSConfig::is_using_archive();
        }

      All these conditions are true in both assembly phase and production run. By adding another condition here to check that CDSConfig::is_dumping_final_static_archive() is false, we can make is_code_load_thread_on() to return true only for production run.
      Or, we can set UseAOTCodeLoadThread ergonomically in CDSConfig::setup_compiler_args() where we already set up some flags depending on which phase we are running in.

            asmehra Ashutosh Mehra
            asmehra Ashutosh Mehra
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: