Skip to content
Permalink
Browse files
8267112: JVMCI compiler modules should be kept upgradable
Reviewed-by: mchung, erikj, dnsimon
  • Loading branch information
Vladimir Kozlov committed May 17, 2021
1 parent da4dfde commit 2effdd1b6799a15a766b2b2a6cba4806d92122f3
@@ -62,12 +62,10 @@ endif
# Filter out jvmci specific modules if jvmci is disabled
ifeq ($(INCLUDE_JVMCI), false)
MODULES_FILTER += jdk.internal.vm.ci
MODULES_FILTER += jdk.internal.vm.compiler
MODULES_FILTER += jdk.internal.vm.compiler.management
endif

# Filter out Graal specific modules
MODULES_FILTER += jdk.internal.vm.compiler
MODULES_FILTER += jdk.internal.vm.compiler.management

# jpackage is only on windows, macosx, and linux
ifeq ($(call isTargetOs, windows macosx linux), false)
MODULES_FILTER += jdk.jpackage
@@ -61,6 +61,8 @@ BOOT_MODULES= \
# should carefully be considered if it should be upgradeable or not.
UPGRADEABLE_PLATFORM_MODULES= \
java.compiler \
jdk.internal.vm.compiler \
jdk.internal.vm.compiler.management \
#

PLATFORM_MODULES= \
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -27,12 +27,6 @@
exports jdk.vm.ci.services to
jdk.internal.vm.compiler,
jdk.internal.vm.compiler.management;
exports jdk.vm.ci.runtime to
jdk.internal.vm.compiler,
jdk.internal.vm.compiler.management;
exports jdk.vm.ci.meta to jdk.internal.vm.compiler;
exports jdk.vm.ci.code to jdk.internal.vm.compiler;
exports jdk.vm.ci.hotspot to jdk.internal.vm.compiler;

uses jdk.vm.ci.services.JVMCIServiceLocator;
uses jdk.vm.ci.hotspot.HotSpotJVMCIBackendFactory;
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,15 +24,18 @@
*/

/**
* Registers Graal Compiler specific management interfaces for the JVM.
* Registers JVMCI compiler specific management interfaces for the JVM.
*
* This is an empty and upgradeable module that is a placeholder for an
* external implementation of a JVMCI compiler. It must be upgradeable so
* that it can be replaced when jlinking a new JDK image without failing
* the hash check for the qualified exports in jdk.internal.vm.ci's
* module descriptor.
*
* @moduleGraph
* @since 10
*/
module jdk.internal.vm.compiler.management {
requires java.management;
requires jdk.management;
requires jdk.internal.vm.ci;
requires jdk.internal.vm.compiler;
}

@@ -23,35 +23,19 @@
* questions.
*/

/**
* JVMCI compiler implementation for the JVM.
*
* This is an empty and upgradeable module that is a placeholder for an
* external implementation of a JVMCI compiler. It must be upgradeable so
* that it can be replaced when jlinking a new JDK image without failing
* the hash check for the qualified exports in jdk.internal.vm.ci's
* module descriptor.
*
* @moduleGraph
* @since 9
*/

module jdk.internal.vm.compiler {
requires java.instrument;
requires java.management;
requires jdk.internal.vm.ci;
requires jdk.management;
requires jdk.unsupported; // sun.misc.Unsafe is used

uses org.graalvm.compiler.code.DisassemblerProvider;
uses org.graalvm.compiler.core.match.MatchStatementSet;
uses org.graalvm.compiler.debug.DebugHandlersFactory;
uses org.graalvm.compiler.debug.TTYStreamProvider;
uses org.graalvm.compiler.hotspot.CompilerConfigurationFactory;
uses org.graalvm.compiler.hotspot.HotSpotBackendFactory;
uses org.graalvm.compiler.hotspot.HotSpotCodeCacheListener;
uses org.graalvm.compiler.hotspot.HotSpotGraalManagementRegistration;
uses org.graalvm.compiler.nodes.graphbuilderconf.GeneratedPluginFactory;
uses org.graalvm.compiler.phases.common.jmx.HotSpotMBeanOperationProvider;
uses org.graalvm.compiler.serviceprovider.JMXService;

exports jdk.internal.vm.compiler.collections to jdk.internal.vm.compiler.management;
exports org.graalvm.compiler.core.common to
jdk.internal.vm.compiler.management;
exports org.graalvm.compiler.debug to
jdk.internal.vm.compiler.management;
exports org.graalvm.compiler.hotspot to
jdk.internal.vm.compiler.management;
exports org.graalvm.compiler.options to
jdk.internal.vm.compiler.management;
exports org.graalvm.compiler.phases.common.jmx to jdk.internal.vm.compiler.management;
exports org.graalvm.compiler.serviceprovider to
jdk.internal.vm.compiler.management;
}
@@ -24,7 +24,7 @@
/**
* @test
* @bug 8136421
* @requires vm.jvmci & vm.compMode == "Xmixed"
* @requires vm.graal.enabled & vm.compMode == "Xmixed"
* @library /test/lib /
* @library ../common/patches
* @modules jdk.internal.vm.compiler
@@ -286,7 +286,11 @@ static boolean test(String s, boolean addExports) {
* Filter deployment modules
*/
static Set<String> systemModules() {
Set<String> mods = Set.of("javafx.deploy", "jdk.deploy", "jdk.plugin", "jdk.javaws");
Set<String> mods = Set.of("javafx.deploy", "jdk.deploy", "jdk.plugin", "jdk.javaws",
// All JVMCI packages other than jdk.vm.ci.services are dynamically
// exported to jdk.internal.vm.compiler
"jdk.internal.vm.compiler"
);
return ModuleFinder.ofSystem().findAll().stream()
.map(mref -> mref.descriptor().name())
.filter(mn -> !mods.contains(mn))
@@ -43,7 +43,10 @@

public class UpgradeableModules {
private static final List<String> UPGRADEABLE_MODULES =
List.of("java.compiler");
List.of("java.compiler",
"jdk.internal.vm.compiler",
"jdk.internal.vm.compiler.management");


public static void main(String... args) {
Set<String> hashedModules = hashedModules();
@@ -196,7 +196,11 @@ private String toClassName(String entry) {
}

private static Set<String> EXCLUDED_MODULES =
Set.of("javafx.deploy", "jdk.deploy", "jdk.plugin", "jdk.javaws");
Set.of("javafx.deploy", "jdk.deploy", "jdk.plugin", "jdk.javaws",
// All JVMCI packages other than jdk.vm.ci.services are dynamically
// exported to jdk.internal.vm.compiler
"jdk.internal.vm.compiler"
);

private boolean accept(String entry) {
int index = entry.indexOf('/', 1);

0 comments on commit 2effdd1

Please sign in to comment.