Skip to content

Commit 2effdd1

Browse files
author
Vladimir Kozlov
committed
8267112: JVMCI compiler modules should be kept upgradable
Reviewed-by: mchung, erikj, dnsimon
1 parent da4dfde commit 2effdd1

File tree

9 files changed

+41
-49
lines changed

9 files changed

+41
-49
lines changed

make/common/Modules.gmk

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,10 @@ endif
6262
# Filter out jvmci specific modules if jvmci is disabled
6363
ifeq ($(INCLUDE_JVMCI), false)
6464
MODULES_FILTER += jdk.internal.vm.ci
65+
MODULES_FILTER += jdk.internal.vm.compiler
66+
MODULES_FILTER += jdk.internal.vm.compiler.management
6567
endif
6668

67-
# Filter out Graal specific modules
68-
MODULES_FILTER += jdk.internal.vm.compiler
69-
MODULES_FILTER += jdk.internal.vm.compiler.management
70-
7169
# jpackage is only on windows, macosx, and linux
7270
ifeq ($(call isTargetOs, windows macosx linux), false)
7371
MODULES_FILTER += jdk.jpackage

make/conf/module-loader-map.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ BOOT_MODULES= \
6161
# should carefully be considered if it should be upgradeable or not.
6262
UPGRADEABLE_PLATFORM_MODULES= \
6363
java.compiler \
64+
jdk.internal.vm.compiler \
65+
jdk.internal.vm.compiler.management \
6466
#
6567

6668
PLATFORM_MODULES= \

src/jdk.internal.vm.ci/share/classes/module-info.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -27,12 +27,6 @@
2727
exports jdk.vm.ci.services to
2828
jdk.internal.vm.compiler,
2929
jdk.internal.vm.compiler.management;
30-
exports jdk.vm.ci.runtime to
31-
jdk.internal.vm.compiler,
32-
jdk.internal.vm.compiler.management;
33-
exports jdk.vm.ci.meta to jdk.internal.vm.compiler;
34-
exports jdk.vm.ci.code to jdk.internal.vm.compiler;
35-
exports jdk.vm.ci.hotspot to jdk.internal.vm.compiler;
3630

3731
uses jdk.vm.ci.services.JVMCIServiceLocator;
3832
uses jdk.vm.ci.hotspot.HotSpotJVMCIBackendFactory;

src/jdk.internal.vm.compiler.management/share/classes/module-info.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -24,15 +24,18 @@
2424
*/
2525

2626
/**
27-
* Registers Graal Compiler specific management interfaces for the JVM.
27+
* Registers JVMCI compiler specific management interfaces for the JVM.
28+
*
29+
* This is an empty and upgradeable module that is a placeholder for an
30+
* external implementation of a JVMCI compiler. It must be upgradeable so
31+
* that it can be replaced when jlinking a new JDK image without failing
32+
* the hash check for the qualified exports in jdk.internal.vm.ci's
33+
* module descriptor.
2834
*
2935
* @moduleGraph
3036
* @since 10
3137
*/
3238
module jdk.internal.vm.compiler.management {
33-
requires java.management;
34-
requires jdk.management;
3539
requires jdk.internal.vm.ci;
36-
requires jdk.internal.vm.compiler;
3740
}
3841

src/jdk.internal.vm.compiler/share/classes/module-info.java

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -23,35 +23,19 @@
2323
* questions.
2424
*/
2525

26+
/**
27+
* JVMCI compiler implementation for the JVM.
28+
*
29+
* This is an empty and upgradeable module that is a placeholder for an
30+
* external implementation of a JVMCI compiler. It must be upgradeable so
31+
* that it can be replaced when jlinking a new JDK image without failing
32+
* the hash check for the qualified exports in jdk.internal.vm.ci's
33+
* module descriptor.
34+
*
35+
* @moduleGraph
36+
* @since 9
37+
*/
38+
2639
module jdk.internal.vm.compiler {
27-
requires java.instrument;
28-
requires java.management;
2940
requires jdk.internal.vm.ci;
30-
requires jdk.management;
31-
requires jdk.unsupported; // sun.misc.Unsafe is used
32-
33-
uses org.graalvm.compiler.code.DisassemblerProvider;
34-
uses org.graalvm.compiler.core.match.MatchStatementSet;
35-
uses org.graalvm.compiler.debug.DebugHandlersFactory;
36-
uses org.graalvm.compiler.debug.TTYStreamProvider;
37-
uses org.graalvm.compiler.hotspot.CompilerConfigurationFactory;
38-
uses org.graalvm.compiler.hotspot.HotSpotBackendFactory;
39-
uses org.graalvm.compiler.hotspot.HotSpotCodeCacheListener;
40-
uses org.graalvm.compiler.hotspot.HotSpotGraalManagementRegistration;
41-
uses org.graalvm.compiler.nodes.graphbuilderconf.GeneratedPluginFactory;
42-
uses org.graalvm.compiler.phases.common.jmx.HotSpotMBeanOperationProvider;
43-
uses org.graalvm.compiler.serviceprovider.JMXService;
44-
45-
exports jdk.internal.vm.compiler.collections to jdk.internal.vm.compiler.management;
46-
exports org.graalvm.compiler.core.common to
47-
jdk.internal.vm.compiler.management;
48-
exports org.graalvm.compiler.debug to
49-
jdk.internal.vm.compiler.management;
50-
exports org.graalvm.compiler.hotspot to
51-
jdk.internal.vm.compiler.management;
52-
exports org.graalvm.compiler.options to
53-
jdk.internal.vm.compiler.management;
54-
exports org.graalvm.compiler.phases.common.jmx to jdk.internal.vm.compiler.management;
55-
exports org.graalvm.compiler.serviceprovider to
56-
jdk.internal.vm.compiler.management;
5741
}

test/hotspot/jtreg/compiler/jvmci/compilerToVM/IsCompilableTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
/**
2525
* @test
2626
* @bug 8136421
27-
* @requires vm.jvmci & vm.compMode == "Xmixed"
27+
* @requires vm.graal.enabled & vm.compMode == "Xmixed"
2828
* @library /test/lib /
2929
* @library ../common/patches
3030
* @modules jdk.internal.vm.compiler

test/jdk/java/lang/Class/getDeclaredField/FieldSetAccessibleTest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,11 @@ public Iterator<String> iterator() {
286286
* Filter deployment modules
287287
*/
288288
static Set<String> systemModules() {
289-
Set<String> mods = Set.of("javafx.deploy", "jdk.deploy", "jdk.plugin", "jdk.javaws");
289+
Set<String> mods = Set.of("javafx.deploy", "jdk.deploy", "jdk.plugin", "jdk.javaws",
290+
// All JVMCI packages other than jdk.vm.ci.services are dynamically
291+
// exported to jdk.internal.vm.compiler
292+
"jdk.internal.vm.compiler"
293+
);
290294
return ModuleFinder.ofSystem().findAll().stream()
291295
.map(mref -> mref.descriptor().name())
292296
.filter(mn -> !mods.contains(mn))

test/jdk/jdk/modules/etc/UpgradeableModules.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@
4343

4444
public class UpgradeableModules {
4545
private static final List<String> UPGRADEABLE_MODULES =
46-
List.of("java.compiler");
46+
List.of("java.compiler",
47+
"jdk.internal.vm.compiler",
48+
"jdk.internal.vm.compiler.management");
49+
4750

4851
public static void main(String... args) {
4952
Set<String> hashedModules = hashedModules();

test/jdk/tools/jimage/VerifyJimage.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,11 @@ private String toClassName(String entry) {
196196
}
197197

198198
private static Set<String> EXCLUDED_MODULES =
199-
Set.of("javafx.deploy", "jdk.deploy", "jdk.plugin", "jdk.javaws");
199+
Set.of("javafx.deploy", "jdk.deploy", "jdk.plugin", "jdk.javaws",
200+
// All JVMCI packages other than jdk.vm.ci.services are dynamically
201+
// exported to jdk.internal.vm.compiler
202+
"jdk.internal.vm.compiler"
203+
);
200204

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

0 commit comments

Comments
 (0)