Skip to content

Commit

Permalink
[GR-44222] Truffle Unchained Refactoring Part 5.
Browse files Browse the repository at this point in the history
PullRequest: graal/14940
  • Loading branch information
chumer committed Jul 12, 2023
2 parents f0703c8 + cd13000 commit 96ac55d
Show file tree
Hide file tree
Showing 643 changed files with 20,080 additions and 11,972 deletions.
13 changes: 7 additions & 6 deletions compiler/mx.compiler/mx_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,11 @@ def _unittest_config_participant(config):
# for the junit harness which uses reflection to find @Test methods. In addition, the
# tests widely use JVMCI classes so JVMCI needs to also export all its packages to
# ALL-UNNAMED.
mainClassArgs.extend(['-JUnitOpenPackages', 'jdk.internal.vm.ci/*=jdk.internal.vm.compiler,ALL-UNNAMED'])

mainClassArgs.extend(['-JUnitOpenPackages', 'jdk.internal.vm.ci/*=org.graalvm.truffle.runtime,jdk.internal.vm.compiler,ALL-UNNAMED'])
mainClassArgs.extend(['-JUnitOpenPackages', 'org.graalvm.truffle/*=ALL-UNNAMED'])
mainClassArgs.extend(['-JUnitOpenPackages', 'org.graalvm.truffle.compiler/*=ALL-UNNAMED'])
mainClassArgs.extend(['-JUnitOpenPackages', 'org.graalvm.truffle.runtime/*=ALL-UNNAMED'])

limited_modules = None
for arg in vmArgs:
Expand Down Expand Up @@ -1294,7 +1298,6 @@ class GraalConfig:
def __init__(self):
self.jvmci_dists = []
self.jvmci_jars = []
self.jvmci_parent_dists = []
self.jvmci_parent_jars = []
self.boot_dists = []
self.boot_jars = []
Expand All @@ -1312,10 +1315,9 @@ def __init__(self):
self.boot_dists.append(d)
self.boot_jars.append(d.classpath_repr())

self.jvmci_parent_dists = [mx.distribution('truffle:TRUFFLE_API')]
self.jvmci_parent_jars = [jar.classpath_repr() for jar in self.jvmci_parent_dists]
self.jvmci_parent_jars = []

self.dists = self.jvmci_dists + self.jvmci_parent_dists + self.boot_dists
self.dists = self.jvmci_dists + self.boot_dists
self.jars = self.jvmci_jars + self.jvmci_parent_jars + self.boot_jars

self.dists_dict = {e.suite.name + ':' + e.name : e for e in self.dists}
Expand All @@ -1328,7 +1330,6 @@ def _jvmci_jars():
return [
'compiler:GRAAL',
'compiler:GRAAL_MANAGEMENT',
'compiler:GRAAL_TRUFFLE_JFR_IMPL',
]

# The community compiler component
Expand Down
189 changes: 6 additions & 183 deletions compiler/mx.compiler/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
"sourceDirs" : ["src"],
"dependencies" : [
"sdk:GRAAL_SDK",
"truffle:TRUFFLE_API",
"truffle:TRUFFLE_COMPILER",
],
"requires" : [
"jdk.internal.vm.ci",
Expand Down Expand Up @@ -192,11 +192,8 @@
"org.graalvm.compiler.core.common.CompilerProfiler",
"org.graalvm.compiler.truffle.compiler.substitutions.GraphBuilderInvocationPluginProvider",
"org.graalvm.compiler.truffle.compiler.phases.inlining.InliningPolicyProvider",
"org.graalvm.compiler.truffle.jfr.EventFactory.Provider",
"org.graalvm.compiler.truffle.runtime.FloodControlHandler",
],
"annotationProcessors" : [
"truffle:TRUFFLE_DSL_PROCESSOR",
"GRAAL_PROCESSOR"
],
"checkPackagePrefix": "false",
Expand All @@ -209,7 +206,6 @@
"org.graalvm.libgraal.jni",
"org.graalvm.compiler.replacements",
"org.graalvm.compiler.hotspot.test",
"org.graalvm.nativebridge.processor.test",
"org.graalvm.compiler.replacements.test",
"org.graalvm.compiler.api.directives.test",
"org.graalvm.compiler.test",
Expand All @@ -218,31 +214,10 @@
"org.graalvm.compiler.loop.test",
"org.graalvm.compiler.core.aarch64.test",
"org.graalvm.compiler.jtt",
"org.graalvm.compiler.truffle.options",
"org.graalvm.compiler.truffle.jfr",
"org.graalvm.compiler.truffle.jfr.impl",
"org.graalvm.compiler.truffle.runtime",
"org.graalvm.compiler.truffle.test",
"org.graalvm.compiler.truffle.common.hotspot.libgraal",
"org.graalvm.compiler.truffle.compiler.hotspot.libgraal",
],
},

"jdk.internal.vm.compiler.truffle.jfr" : {
"subDir" : "src",
"sourceDirs" : ["src"],
"dependencies" : [
"jdk.internal.vm.compiler",
],
"requires" : [
"jdk.jfr"
],
"checkPackagePrefix": "false",
"checkstyle" : "jdk.internal.vm.compiler",
"javaCompliance" : "17+",
"jacoco" : "exclude",
},

"jdk.internal.vm.compiler.processor" : {
"subDir" : "src",
"sourceDirs" : ["src"],
Expand All @@ -265,14 +240,15 @@
"JAVA_ALLOCATION_INSTRUMENTER",
"truffle:TRUFFLE_SL_TEST",
"truffle:TRUFFLE_TEST",
"truffle:TRUFFLE_RUNTIME",
],
"requires" : [
"jdk.unsupported",
"java.compiler",
"java.logging",
"java.instrument",
"java.management",
"jdk.jfr"
"jdk.jfr",
],
"requiresConcealed" : {
"java.base" : [
Expand Down Expand Up @@ -306,39 +282,6 @@
"jacoco" : "exclude",
},

"org.graalvm.nativebridge.processor" : {
"subDir" : "src",
"sourceDirs" : ["src"],
"dependencies" : [
"jdk.internal.vm.compiler.processor",
],
"requires" : [
"java.compiler"
],
"annotationProcessors" : [
],
"checkstyle" : "jdk.internal.vm.compiler",
"javaCompliance" : "17+",
"workingSets" : "API,Graal",
},

"org.graalvm.nativebridge.processor.test" : {
"subDir" : "src",
"sourceDirs" : ["src"],
"dependencies" : [
"jdk.internal.vm.compiler",
"mx:JUNIT",
],
"annotationProcessors" : [
"GRAAL_NATIVEBRIDGE_PROCESSOR",
],
"checkstyle" : "jdk.internal.vm.compiler",
"javaCompliance" : "17+",
"workingSets" : "Graal,Test",
"jacoco" : "exclude",
"testProject" : True,
},

"org.graalvm.compiler.management" : {
"subDir" : "src",
"sourceDirs" : ["src"],
Expand Down Expand Up @@ -436,56 +379,6 @@

# ------------- GraalTruffle -------------

"org.graalvm.compiler.truffle.compiler.hotspot.libgraal" : {
"subDir" : "src",
"sourceDirs" : ["src"],
"dependencies" : [
"jdk.internal.vm.compiler",
],
"requiresConcealed" : {
"jdk.internal.vm.ci" : [
"jdk.vm.ci.meta",
"jdk.vm.ci.code",
"jdk.vm.ci.runtime",
"jdk.vm.ci.hotspot",
],
},
"jacoco" : "exclude", # GR-13965
"checkstyle" : "jdk.internal.vm.compiler",
"javaCompliance" : "17+",
"annotationProcessors" : [
"GRAAL_PROCESSOR",
],
},

"org.graalvm.compiler.truffle.libgraal.truffleattach" : {
"subDir" : "src",
"native" : "shared_lib",
"deliverable" : "truffleattach",
"use_jdk_headers" : True,
"buildDependencies" : [
],
"os_arch" : {
"windows" : {
"<others>" : {
"cflags" : ["--std=c++11"]
}
},
"linux" : {
"<others>" : {
"cflags" : ["--std=c++11", "-g", "-Wall", "-Werror", "-D_GNU_SOURCE"],
"ldlibs" : ["-ldl"],
},
},
"<others>" : {
"<others>" : {
"cflags" : ["--std=c++11", "-g", "-Wall", "-Werror"],
"ldlibs" : ["-ldl"],
},
},
},
},

"org.graalvm.compiler.truffle.test.jdk21" : {
"subDir" : "src",
"sourceDirs" : ["src"],
Expand Down Expand Up @@ -552,14 +445,15 @@
"subDir" : "src",
"dependencies" : [
"jdk.internal.vm.compiler.test",
"org.graalvm.nativebridge.processor.test",
"org.graalvm.compiler.hotspot.jdk20.test",
"org.graalvm.compiler.hotspot.jdk21.test",
],
"distDependencies" : [
"GRAAL",
"truffle:TRUFFLE_SL_TEST",
"truffle:TRUFFLE_TEST",
"truffle:TRUFFLE_COMPILER",
"truffle:TRUFFLE_RUNTIME",
"regex:TREGEX"
],
"exclude" : [
Expand All @@ -570,34 +464,6 @@
"maven": False,
},

"GRAAL_TRUFFLE_JFR_IMPL" : {
# This distribution defines a module.
"moduleInfo" : {
"name" : "jdk.internal.vm.compiler.truffle.jfr",
},
"subDir" : "src",
"dependencies" : [
"jdk.internal.vm.compiler.truffle.jfr",
],
"distDependencies" : [
"GRAAL",
],
"maven": False,
},

"GRAAL_TRUFFLE_COMPILER_LIBGRAAL": {
"subDir" : "src",
"dependencies" : [
"org.graalvm.compiler.truffle.compiler.hotspot.libgraal",
],

"distDependencies" : [
"GRAAL",
],
"maven": False,
"javaCompliance" : "17+",
},

"GRAAL_PROCESSOR" : {
"subDir": "src",
"dependencies" : [
Expand All @@ -606,15 +472,6 @@
"maven": False,
},

"GRAAL_NATIVEBRIDGE_PROCESSOR" : {
"subDir" : "src",
"dependencies" : [
"org.graalvm.nativebridge.processor"
],
"distDependencies" : ["GRAAL_PROCESSOR"],
"maven": False,
},

"GRAAL" : {
# This distribution defines a module.
"moduleInfo" : {
Expand All @@ -632,12 +489,9 @@
"org.graalvm.compiler.options to org.graalvm.nativeimage.driver,org.graalvm.nativeimage.junitsupport",
"org.graalvm.compiler.phases.common to org.graalvm.nativeimage.agent.tracing,org.graalvm.nativeimage.configure",
"org.graalvm.compiler.serviceprovider to jdk.internal.vm.compiler.management,org.graalvm.nativeimage.driver,org.graalvm.nativeimage.agent.jvmtibase,org.graalvm.nativeimage.agent.diagnostics",
"org.graalvm.compiler.truffle.jfr to jdk.internal.vm.compiler.truffle.jfr",
"org.graalvm.util.json to org.graalvm.nativeimage.librarysupport,org.graalvm.nativeimage.agent.tracing,org.graalvm.nativeimage.configure,org.graalvm.nativeimage.driver",
],
"uses" : [
"com.oracle.truffle.api.impl.TruffleLocator",
"com.oracle.truffle.api.object.LayoutFactory",
"org.graalvm.compiler.code.DisassemblerProvider",
"org.graalvm.compiler.core.match.MatchStatementSet",
"org.graalvm.compiler.debug.DebugHandlersFactory",
Expand All @@ -651,10 +505,6 @@
"org.graalvm.compiler.serviceprovider.JMXService",
"org.graalvm.compiler.truffle.compiler.hotspot.TruffleCallBoundaryInstrumentationFactory",
"org.graalvm.compiler.truffle.compiler.substitutions.GraphBuilderInvocationPluginProvider",
"org.graalvm.compiler.truffle.runtime.LoopNodeFactory",
"org.graalvm.compiler.truffle.runtime.TruffleTypes",
"org.graalvm.compiler.truffle.runtime.EngineCacheSupport",
"org.graalvm.home.HomeFinder",
],
},
"subDir" : "src",
Expand All @@ -663,7 +513,7 @@
],
"distDependencies" : [
"sdk:GRAAL_SDK",
"truffle:TRUFFLE_API"
"truffle:TRUFFLE_COMPILER",
],
"allowsJavadocWarnings": True,
"description": "The GraalVM compiler and the Graal-truffle optimizer.",
Expand Down Expand Up @@ -740,33 +590,6 @@
},
},

"TRUFFLE_LIBGRAAL_TRUFFLEATTACH" : {
"native" : True,
"platformDependent" : True,
"platforms" : [
"linux-amd64",
"linux-aarch64",
"darwin-amd64",
"darwin-aarch64",
"windows-amd64",
],
"layout" : {
"bin/" : "dependency:org.graalvm.compiler.truffle.libgraal.truffleattach",
},
"description" : "Contains a library to attach Truffle runtime to jvmci runtime.",
"maven": True,
},

"TRUFFLE_LIBGRAAL_TRUFFLEATTACH_GRAALVM_SUPPORT" : {
"native" : True,
"platformDependent" : True,
"layout" : {
"./" : ["dependency:org.graalvm.compiler.truffle.libgraal.truffleattach"],
},
"description" : "Truffle attach library support distribution for the GraalVM",
"maven" : False,
},

"GRAAL_PROFDIFF": {
"subDir" : "src",
"dependencies" : [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ org.graalvm.compiler.replacements.processor.ReplacementsAnnotationProcessor
org.graalvm.compiler.nodeinfo.processor.GraphNodeProcessor
org.graalvm.compiler.lir.processor.IntrinsicStubProcessor
org.graalvm.compiler.lir.processor.StubPortProcessor
org.graalvm.compiler.truffle.compiler.hotspot.libgraal.processor.TruffleFromLibGraalProcessor
org.graalvm.compiler.core.match.processor.MatchProcessor
org.graalvm.compiler.options.processor.OptionProcessor
org.graalvm.compiler.serviceprovider.processor.ServiceProviderProcessor
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ private static String getPackageName(Class<?> c) {
getPackageName(PermanentBailoutException.class),
"jdk.vm.ci",

// Allows GraalTruffleRuntime.handleAnnotationFailure to throw
// a BailoutException since the org.graalvm.compiler.truffle.runtime
// Allows OptimizedTruffleRuntime.handleAnnotationFailure to throw
// a BailoutException since the com.oracle.truffle.runtime
// project can not see the PermanentBailoutException or
// RetryableBailoutException types.
"org.graalvm.compiler.truffle.runtime"
"com.oracle.truffle.runtime"
};
} catch (Throwable t) {
throw new GraalError(t);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ protected void verify(StructuredGraph graph, CoreProviders context) {
// The main method in JVMCIVersionCheck is only called from the shell
return;
} else if (packageName.startsWith("com.oracle.truffle") || packageName.startsWith("org.graalvm.polyglot") ||
packageName.startsWith("org.graalvm.home") || packageName.equals("org.graalvm.compiler.truffle.runtime.hotspot")) {
packageName.startsWith("org.graalvm.home") || packageName.equals("com.oracle.truffle.runtime.hotspot")) {
// Truffle, SDK and Truffle runtime do not depend on JVMCI so they cannot use
// Services.getSavedProperties()
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ protected void verify(StructuredGraph graph, CoreProviders context) {
caller.getName().equals("initUnsafe")) {
// This is the blessed way access Unsafe in Graal and JVMCI
return;
} else if (packageName.startsWith("com.oracle.truffle") || packageName.startsWith("org.graalvm.compiler.truffle.runtime")) {
// Truffle and GraalTruffleRuntime do not depend on Graal and so cannot use
} else if (packageName.startsWith("com.oracle.truffle") || packageName.startsWith("com.oracle.truffle.runtime")) {
// Truffle and OptimizedTruffleRuntime do not depend on Graal and so cannot use
// GraalUnsafeAccess
return;
}
Expand Down
Loading

0 comments on commit 96ac55d

Please sign in to comment.