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

Support alternative name to jdk.internal.vm.compiler

    XMLWordPrintable

Details

    • CSR
    • Resolution: Approved
    • P4
    • 22
    • hotspot
    • None
    • binary, behavioral
    • minimal
    • Hide
      An implementation of jdk.internal.vm.compiler that also provides an implementation of the JVMCI service will only continue to work if it is renamed to jdk.graal.compiler. Given the tight coupling of the compiler module and JVMCI, any project maintaining an implementation of the compiler module is already used to evolving with the JDK so this should not be an extra burden.

      Scripts that run jlink to create a run-time image containing the Graal compiler module will need to be updated.
      Show
      An implementation of jdk.internal.vm.compiler that also provides an implementation of the JVMCI service will only continue to work if it is renamed to jdk.graal.compiler. Given the tight coupling of the compiler module and JVMCI, any project maintaining an implementation of the compiler module is already used to evolving with the JDK so this should not be an extra burden. Scripts that run jlink to create a run-time image containing the Graal compiler module will need to be updated.
    • Other
    • Implementation

    Description

      Summary

      Rename the module jdk.internal.vm.compiler to jdk.graal.compiler.

      Problem

      The Graal code base has been undergoing large structural changes to prepare for merging it into OpenJDK under Project Galahad. Making these changes prior to merging the sources into OpenJDK will avoid large changes post-merging into OpenJDK. For example, all code in the jdk.internal.vm.compiler module was consolidated into a single source directory using the standard layout. The commit for this change alone had 3,481 changed files, 317 additions and 1,759 deletions.

      The above change could be made without any JDK changes. The next large change renames the jdk.internal.vm.compiler module to jdk.graal.compiler. Due to the way Java modules work, this requires a JDK change. The service by which HotSpot requests a Graal compilation is defined in JVMCI. Since this service is in the boot layer, it can only be implemented by a provider in the boot layer and jdk.internal.vm.compiler is in the boot layer by virtual of being a platform module. To be implemented by a service in jdk.graal.compiler, this module also needs to be a platform module and the JVMCI service in question needs to be exported to it.

      Solution

      The solution requires adding a jdk.graal.compiler module and updating the qualified exports in the jdk.internal.vm.ci module to target this module. This could be done while preserving the existing jdk.internal.vm.compiler module. However, given that there are no known implementations of this module apart from Graal, it should be removed so as to minimize the number of upgradeable platform modules in the JDK.

      Note that the solution has already been merged.

      Specification

      Add jdk.graal.compiler and jdk.graal.compiler.management modules to replace the jdk.internal.vm.compiler and jdk.internal.vm.compiler.management modules:

      module jdk.graal.compiler { requires jdk.internal.vm.ci; }
      module jdk.graal.compiler.management { requires jdk.internal.vm.ci; }

      Update the qualified exports in the module descriptor of jdk.internal.vm.ci to replace "jdk.internal.vm.compiler" with "jdk.graal.compiler":

      module jdk.internal.vm.ci {
          exports jdk.vm.ci.services to
              jdk.graal.compiler,
              jdk.graal.compiler.management;
              ...
          }
      }

      The full details are in the merged PR.

      Attachments

        Issue Links

          Activity

            People

              dnsimon Douglas Simon
              dnsimon Douglas Simon
              Vladimir Kozlov
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: