Skip to content

Commit 2565638

Browse files
committed
[GR-48318] Add jdk.compiler.graal in addition to jdk.internal.vm.compiler.
PullRequest: labsjdk-ce/18
2 parents 98d21ff + ec1a72b commit 2565638

File tree

10 files changed

+104
-25
lines changed

10 files changed

+104
-25
lines changed

make/common/Modules.gmk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ ifeq ($(INCLUDE_JVMCI), false)
6464
MODULES_FILTER += jdk.internal.vm.ci
6565
MODULES_FILTER += jdk.internal.vm.compiler
6666
MODULES_FILTER += jdk.internal.vm.compiler.management
67+
MODULES_FILTER += jdk.compiler.graal
68+
MODULES_FILTER += jdk.compiler.graal.management
6769
endif
6870

6971
# jpackage is only on windows, macosx, and linux

make/conf/module-loader-map.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ UPGRADEABLE_PLATFORM_MODULES= \
6262
java.compiler \
6363
jdk.internal.vm.compiler \
6464
jdk.internal.vm.compiler.management \
65+
jdk.compiler.graal \
66+
jdk.compiler.graal.management \
6567
#
6668

6769
PLATFORM_MODULES= \

src/java.base/share/lib/security/default.policy

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -167,16 +167,8 @@ grant codeBase "jrt:/jdk.internal.vm.compiler" {
167167
permission java.security.AllPermission;
168168
};
169169

170-
grant codeBase "jrt:/jdk.internal.vm.compiler.management" {
171-
permission java.lang.RuntimePermission "accessClassInPackage.jdk.internal.vm.compiler.collections";
172-
permission java.lang.RuntimePermission "accessClassInPackage.jdk.vm.ci.runtime";
173-
permission java.lang.RuntimePermission "accessClassInPackage.jdk.vm.ci.services";
174-
permission java.lang.RuntimePermission "accessClassInPackage.org.graalvm.compiler.core.common";
175-
permission java.lang.RuntimePermission "accessClassInPackage.org.graalvm.compiler.debug";
176-
permission java.lang.RuntimePermission "accessClassInPackage.org.graalvm.compiler.hotspot";
177-
permission java.lang.RuntimePermission "accessClassInPackage.org.graalvm.compiler.options";
178-
permission java.lang.RuntimePermission "accessClassInPackage.org.graalvm.compiler.phases.common.jmx";
179-
permission java.lang.RuntimePermission "accessClassInPackage.org.graalvm.compiler.serviceprovider";
170+
grant codeBase "jrt:/jdk.compiler.graal" {
171+
permission java.security.AllPermission;
180172
};
181173

182174
grant codeBase "jrt:/jdk.jsobject" {
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* This code is free software; you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License version 2 only, as
7+
* published by the Free Software Foundation. Oracle designates this
8+
* particular file as subject to the "Classpath" exception as provided
9+
* by Oracle in the LICENSE file that accompanied this code.
10+
*
11+
* This code is distributed in the hope that it will be useful, but WITHOUT
12+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+
* version 2 for more details (a copy is included in the LICENSE file that
15+
* accompanied this code).
16+
*
17+
* You should have received a copy of the GNU General Public License version
18+
* 2 along with this work; if not, write to the Free Software Foundation,
19+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+
*
21+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+
* or visit www.oracle.com if you need additional information or have any
23+
* questions.
24+
*/
25+
26+
/**
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.
34+
*
35+
* @moduleGraph
36+
* @since 22
37+
*/
38+
module jdk.compiler.graal.management {
39+
requires jdk.internal.vm.ci;
40+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* This code is free software; you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License version 2 only, as
7+
* published by the Free Software Foundation. Oracle designates this
8+
* particular file as subject to the "Classpath" exception as provided
9+
* by Oracle in the LICENSE file that accompanied this code.
10+
*
11+
* This code is distributed in the hope that it will be useful, but WITHOUT
12+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+
* version 2 for more details (a copy is included in the LICENSE file that
15+
* accompanied this code).
16+
*
17+
* You should have received a copy of the GNU General Public License version
18+
* 2 along with this work; if not, write to the Free Software Foundation,
19+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+
*
21+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+
* or visit www.oracle.com if you need additional information or have any
23+
* questions.
24+
*/
25+
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 22
37+
*/
38+
39+
module jdk.compiler.graal {
40+
requires jdk.internal.vm.ci;
41+
}

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

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,17 @@
2626
module jdk.internal.vm.ci {
2727
exports jdk.vm.ci.services to
2828
jdk.internal.vm.compiler,
29-
jdk.internal.vm.compiler.management;
29+
jdk.internal.vm.compiler.management,
30+
jdk.compiler.graal,
31+
jdk.compiler.graal.management;
3032
exports jdk.vm.ci.runtime to
3133
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;
34+
jdk.internal.vm.compiler.management,
35+
jdk.compiler.graal,
36+
jdk.compiler.graal.management;
37+
exports jdk.vm.ci.meta to jdk.internal.vm.compiler, jdk.compiler.graal;
38+
exports jdk.vm.ci.code to jdk.internal.vm.compiler, jdk.compiler.graal;
39+
exports jdk.vm.ci.hotspot to jdk.internal.vm.compiler, jdk.compiler.graal;
3640

3741
uses jdk.vm.ci.services.JVMCIServiceLocator;
3842
uses jdk.vm.ci.hotspot.HotSpotJVMCIBackendFactory;

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
* @requires vm.graal.enabled & vm.compMode == "Xmixed"
2828
* @library /test/lib /
2929
* @library ../common/patches
30-
* @modules jdk.internal.vm.compiler
3130
* @modules java.base/jdk.internal.misc
3231
* @modules java.base/jdk.internal.org.objectweb.asm
3332
* java.base/jdk.internal.org.objectweb.asm.tree

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -311,12 +311,11 @@ static Set<String> systemModules() {
311311

312312
Set<String> mods = Set.of(
313313
// All JVMCI packages other than jdk.vm.ci.services are dynamically
314-
// exported to jdk.internal.vm.compiler
315-
"jdk.internal.vm.compiler", "jdk.internal.vm.compiler.management"
314+
// exported to Graal
315+
"jdk.compiler.graal", "jdk.compiler.graal.management"
316316
);
317-
// Filters all modules that directly or indirectly require jdk.internal.vm.compiler
318-
// and jdk.internal.vm.compiler.management, as these are upgradeable and
319-
// also provide APIs to add qualified exports dynamically
317+
// Filters all modules that directly or indirectly require Graal modules
318+
// as these are upgradeable and also provide APIs to add qualified exports dynamically
320319
Set<String> filters = mods.stream().flatMap(mn -> findDeps(mn, inverseDeps).stream())
321320
.collect(Collectors.toSet());
322321
System.out.println("Filtered modules: " + filters);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
public class UpgradeableModules {
4545
private static final List<String> UPGRADEABLE_MODULES =
4646
List.of("java.compiler",
47-
"jdk.internal.vm.compiler",
48-
"jdk.internal.vm.compiler.management");
47+
"jdk.compiler.graal",
48+
"jdk.compiler.graal.management");
4949

5050

5151
public static void main(String... args) {

test/jdk/tools/jimage/VerifyJimage.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ private String toClassName(String entry) {
196196
}
197197

198198
// All JVMCI packages other than jdk.vm.ci.services are dynamically
199-
// exported to jdk.internal.vm.compiler
200-
private static Set<String> EXCLUDED_MODULES = Set.of("jdk.internal.vm.compiler");
199+
// exported to jdk.compiler.graal
200+
private static Set<String> EXCLUDED_MODULES = Set.of("jdk.compiler.graal");
201201

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

0 commit comments

Comments
 (0)