Skip to content

Commit 9421c15

Browse files
committed
[GR-60088] Add org.graalvm.nativeimage.libgraal module.
PullRequest: graal/19442
2 parents 0b843a9 + 7d5592a commit 9421c15

File tree

146 files changed

+4569
-6132
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+4569
-6132
lines changed

compiler/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
This changelog summarizes newly introduced optimizations and other compiler related changes.
44

5+
## GraalVM for JDK 25 (Internal Version 25.0.0)
6+
* (GR-60088): This PR adds the `org.graalvm.nativeimage.libgraal` SDK module. With this module, all logic for building
7+
libgraal has been moved into the compiler suite in a new `jdk.graal.compiler.libgraal` module
8+
which has no dependency on Native Image internals. This
9+
is required for Galahad CE where libgraal must be buildable from the Graal compiler sources in the OpenJDK
10+
while using Native Image as an external tool.
11+
512
## GraalVM for JDK 24 (Internal Version 24.2.0)
613
* (GR-57209): The default number of JVMCI threads is now the same as the number of C2 threads (`-XX:JVMCINativeLibraryThreadFraction=0.66`).
714
This benefits the program warmup but could increase the maximum RSS.

compiler/mx.compiler/mx_compiler.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2018, 2025, 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
@@ -1485,6 +1485,7 @@ def __init__(self):
14851485
__graal_config = GraalConfig()
14861486
return __graal_config
14871487

1488+
# The jars needed for jargraal.
14881489
def _jvmci_jars():
14891490
return [
14901491
'compiler:GRAAL',

compiler/mx.compiler/suite.py

Lines changed: 71 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@
218218
"jacoco" : "include",
219219
"jacocoExcludePackages" : [
220220
"jdk.graal.compiler.test",
221-
"org.graalvm.libgraal.jni",
222221
"jdk.graal.compiler.replacements",
223222
"jdk.graal.compiler.hotspot.test",
224223
"jdk.graal.compiler.replacements.test",
@@ -472,13 +471,48 @@
472471
"graalCompilerSourceEdition": "ignore",
473472
},
474473

474+
# ------------- libgraal -------------
475+
476+
# See jdk.graal.compiler.core.common.LibGraalSupport for the SPI
477+
# used by core compiler classes to access libgraal specific
478+
# functionality without requiring the compiler classes to directly
479+
# depend on libgraal specific modules.
480+
"jdk.graal.compiler.libgraal" : {
481+
"subDir" : "src",
482+
"sourceDirs" : ["src"],
483+
"workingSets" : "Graal",
484+
"javaCompliance" : "21+",
485+
"dependencies" : [
486+
"GRAAL",
487+
"sdk:NATIVEIMAGE_LIBGRAAL",
488+
"sdk:JNIUTILS",
489+
"sdk:NATIVEBRIDGE"
490+
],
491+
"requiresConcealed" : {
492+
"java.base" : [
493+
"jdk.internal.module",
494+
"jdk.internal.misc"
495+
],
496+
"jdk.internal.vm.ci" : [
497+
"jdk.vm.ci.code",
498+
"jdk.vm.ci.meta",
499+
"jdk.vm.ci.runtime",
500+
"jdk.vm.ci.services",
501+
"jdk.vm.ci.hotspot",
502+
],
503+
},
504+
"annotationProcessors" : [
505+
"truffle:TRUFFLE_LIBGRAAL_PROCESSOR",
506+
],
507+
},
508+
475509
"jdk.graal.compiler.libgraal.loader" : {
476510
"subDir" : "src",
477511
"sourceDirs" : ["src"],
478512
"workingSets" : "Graal",
479513
"javaCompliance" : "21+",
480514
"dependencies" : [
481-
"jdk.graal.compiler",
515+
"sdk:NATIVEIMAGE_LIBGRAAL",
482516
],
483517
"requiresConcealed" : {
484518
"java.base" : [
@@ -557,7 +591,8 @@
557591
"moduleInfo" : {
558592
"name" : "jdk.graal.compiler",
559593
"exports" : [
560-
"""* to com.oracle.graal.graal_enterprise,
594+
"""* to jdk.graal.compiler.libgraal,
595+
com.oracle.graal.graal_enterprise,
561596
org.graalvm.nativeimage.pointsto,
562597
org.graalvm.nativeimage.builder,
563598
org.graalvm.nativeimage.foreign,
@@ -583,6 +618,7 @@
583618
"uses" : [
584619
"jdk.graal.compiler.code.DisassemblerProvider",
585620
"jdk.graal.compiler.core.match.MatchStatementSet",
621+
"jdk.graal.compiler.core.common.LibGraalSupport",
586622
"jdk.graal.compiler.debug.DebugHandlersFactory",
587623
"jdk.graal.compiler.debug.TTYStreamProvider",
588624
"jdk.graal.compiler.debug.PathUtilitiesProvider",
@@ -634,6 +670,38 @@
634670
},
635671
},
636672

673+
"LIBGRAAL_LOADER" : {
674+
"subDir": "src",
675+
"dependencies" : [
676+
"jdk.graal.compiler.libgraal.loader"
677+
],
678+
"distDependencies" : [
679+
"sdk:NATIVEIMAGE_LIBGRAAL",
680+
"GRAAL",
681+
],
682+
"maven": False,
683+
},
684+
685+
"LIBGRAAL": {
686+
"moduleInfo" : {
687+
"name" : "jdk.graal.compiler.libgraal",
688+
},
689+
"subDir": "src",
690+
"description" : "Module that builds libgraal",
691+
"javaCompliance" : "21+",
692+
"dependencies": [
693+
"jdk.graal.compiler.libgraal",
694+
],
695+
"distDependencies": [
696+
"GRAAL",
697+
"sdk:NATIVEIMAGE_LIBGRAAL",
698+
"sdk:JNIUTILS",
699+
"sdk:NATIVEIMAGE",
700+
"sdk:NATIVEBRIDGE"
701+
],
702+
"maven": False,
703+
},
704+
637705
"GRAAL_COMPILER_WHITEBOX_MICRO_BENCHMARKS" : {
638706
"subDir" : "src",
639707
"dependencies" : [
@@ -711,17 +779,6 @@
711779
"graalCompilerSourceEdition": "ignore",
712780
},
713781

714-
"LIBGRAAL_LOADER" : {
715-
"subDir": "src",
716-
"dependencies" : [
717-
"jdk.graal.compiler.libgraal.loader",
718-
],
719-
"distDependencies" : [
720-
"GRAAL",
721-
],
722-
"maven": False,
723-
},
724-
725782
"GRAAL_PROFDIFF_TEST" : {
726783
"subDir" : "src",
727784
"dependencies" : [

0 commit comments

Comments
 (0)