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

[JVMCI] split jdk.vm.ci module into jdk.vm.ci and jdk.vm.ci.hotspot

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P1
    • Resolution: Won't Fix
    • Affects Version/s: 9, 10
    • Fix Version/s: 10
    • Component/s: hotspot
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      This has come up already when we discussed the jdk.vm.ci module but back then I though if we can't have more module separation (for every project) we could as well just have one.

      It turns out that this is a problem in JDK 9. Having only one module makes it possible to use HotSpot-specific classes in VM-independent compiler code.

      In order to avoid this and for code cleanliness we should have a separate jdk.vm.ci.hotspot module which contains all HotSpot-related classes.

        Activity

        Hide
        twisti Christian Thalinger added a comment -
        [~erikj], since we keep repeating the same pattern, is there a function to match more than one module name in the if?

        diff -r e51a92f0f1ac make/CompileJavaModules.gmk
        --- a/make/CompileJavaModules.gmk Tue Apr 19 15:26:51 2016 -0400
        +++ b/make/CompileJavaModules.gmk Fri Apr 29 12:50:20 2016 -1000
        @@ -483,11 +483,19 @@ MODULESOURCEPATH := $(call GetModuleSrcP
         # Add imported modules to the modulepath
         MODULEPATH := $(call PathList, $(IMPORT_MODULES_CLASSES))
         
        +## WORKAROUND jdk.vm.ci source structure issue
         ifeq ($(MODULE), jdk.vm.ci)
        - ## WORKAROUND jdk.vm.ci source structure issue
           JVMCI_MODULESOURCEPATH := $(MODULESOURCEPATH) \
        - $(subst /$(MODULE)/,/*/, $(filter-out %processor/src, \
        - $(wildcard $(HOTSPOT_TOPDIR)/src/jdk.vm.ci/share/classes/*/src)))
        + $(subst src/$(MODULE)/,src/*/, $(filter-out %processor/src, \
        + $(wildcard $(HOTSPOT_TOPDIR)/src/$(MODULE)/share/classes/*/src)))
        + MODULESOURCEPATH := $(call PathList, $(JVMCI_MODULESOURCEPATH))
        +endif
        +
        +## WORKAROUND jdk.vm.ci.hotspot source structure issue
        +ifeq ($(MODULE), jdk.vm.ci.hotspot)
        + JVMCI_MODULESOURCEPATH := $(MODULESOURCEPATH) \
        + $(subst src/$(MODULE)/,src/*/, $(filter-out %processor/src, \
        + $(wildcard $(HOTSPOT_TOPDIR)/src/$(MODULE)/share/classes/*/src)))
           MODULESOURCEPATH := $(call PathList, $(JVMCI_MODULESOURCEPATH))
         endif
         
        Show
        twisti Christian Thalinger added a comment - [~erikj], since we keep repeating the same pattern, is there a function to match more than one module name in the if? diff -r e51a92f0f1ac make/CompileJavaModules.gmk --- a/make/CompileJavaModules.gmk Tue Apr 19 15:26:51 2016 -0400 +++ b/make/CompileJavaModules.gmk Fri Apr 29 12:50:20 2016 -1000 @@ -483,11 +483,19 @@ MODULESOURCEPATH := $(call GetModuleSrcP  # Add imported modules to the modulepath  MODULEPATH := $(call PathList, $(IMPORT_MODULES_CLASSES))   +## WORKAROUND jdk.vm.ci source structure issue  ifeq ($(MODULE), jdk.vm.ci) - ## WORKAROUND jdk.vm.ci source structure issue    JVMCI_MODULESOURCEPATH := $(MODULESOURCEPATH) \ - $(subst /$(MODULE)/,/*/, $(filter-out %processor/src, \ - $(wildcard $(HOTSPOT_TOPDIR)/src/jdk.vm.ci/share/classes/*/src))) + $(subst src/$(MODULE)/,src/*/, $(filter-out %processor/src, \ + $(wildcard $(HOTSPOT_TOPDIR)/src/$(MODULE)/share/classes/*/src))) + MODULESOURCEPATH := $(call PathList, $(JVMCI_MODULESOURCEPATH)) +endif + +## WORKAROUND jdk.vm.ci.hotspot source structure issue +ifeq ($(MODULE), jdk.vm.ci.hotspot) + JVMCI_MODULESOURCEPATH := $(MODULESOURCEPATH) \ + $(subst src/$(MODULE)/,src/*/, $(filter-out %processor/src, \ + $(wildcard $(HOTSPOT_TOPDIR)/src/$(MODULE)/share/classes/*/src)))    MODULESOURCEPATH := $(call PathList, $(JVMCI_MODULESOURCEPATH))  endif  
        Hide
        erikj Erik Joelsson added a comment -
        The commonly used construct is:

        ifneq ($(filter $(MODULE), jdk.vm.ci jdk.vm.ci.hotspot), )
          ...
        endif
        Show
        erikj Erik Joelsson added a comment - The commonly used construct is: ifneq ($(filter $(MODULE), jdk.vm.ci jdk.vm.ci.hotspot), )   ... endif
        Hide
        twisti Christian Thalinger added a comment -
        Cool. Thanks.
        Show
        twisti Christian Thalinger added a comment - Cool. Thanks.
        Hide
        dnsimon Douglas Simon added a comment -
        This is a nice to have feature but since it's not trivial, it’s only worth doing if there will be separate JVMCI modules for each architecture as well. As such, I've pushed this out to JDK10.
        Show
        dnsimon Douglas Simon added a comment - This is a nice to have feature but since it's not trivial, it’s only worth doing if there will be separate JVMCI modules for each architecture as well. As such, I've pushed this out to JDK10.
        Hide
        dnsimon Douglas Simon added a comment -
        This doesn't make much sense until we want to build separate modules for each architecture *and* only bundle relevant arch modules in a JDK binary build.
        Show
        dnsimon Douglas Simon added a comment - This doesn't make much sense until we want to build separate modules for each architecture *and* only bundle relevant arch modules in a JDK binary build.

          People

          • Assignee:
            dnsimon Douglas Simon
            Reporter:
            twisti Christian Thalinger
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: