Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GR-44222] Truffle Unchained Refactoring Part 5. #6986

Merged
merged 43 commits into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
c3bfd9d
Add new runtime and compiler truffle project.
chumer Jun 18, 2023
bc04f8b
Move Truffle libgraal processor to Truffle until migration to native-…
chumer Jun 18, 2023
3a9bbf9
Move Truffle runtime and compiler interfaces from compiler to truffle…
chumer Jun 19, 2023
09a6ef2
Move truffleattach library to Truffle.
chumer Jun 19, 2023
8abacbc
Changes and cleanup after move from compiler to truffle suite.
chumer Jun 19, 2023
5924c6b
Update license headers to new license UPL.
chumer Jun 19, 2023
7e85fb5
Rename package of compiler interfaces to use the new com.oracle.truff…
chumer Jun 19, 2023
ce30563
Changes and cleanup after moving compiler interfaces to use the new c…
chumer Jun 21, 2023
c52d675
Move org.graalvm.compiler.truffle.compiler.hotspot.libgraal to com.or…
chumer Jun 22, 2023
f687878
Changes and cleanup after move org.graalvm.compiler.truffle.compiler.…
chumer Jun 22, 2023
71cbaaa
Refactor package name from org.graalvm.compiler.truffle.compiler.hots…
chumer Jun 22, 2023
2a22217
Cleanup code in com.oracle.svm.graal.hotspot.libgraal; cleanup annota…
chumer Jun 22, 2023
0c6b6e7
Move native bridge, jniutils to sdk; Move rest of the libgraal utils …
chumer Jun 22, 2023
3af4f35
Update license headers from jniutils and nativebridge to UPL.
chumer Jun 23, 2023
7565cc8
Cleanup code after native bridge move to SDK.
chumer Jun 23, 2023
857483a
Cleanup and fix runtime and project configuration after move.
chumer Jun 28, 2023
e4e08be
Refactor Truffle optimizing runtime package. Note this is an incompat…
chumer Jun 29, 2023
f1a1137
Refactor Truffle runtime classes to consistently use optimizing prefi…
chumer Jun 30, 2023
442c69d
Rename truffle attach projects and distributions.
chumer Jun 30, 2023
d120c0a
Improve truffle runtime resolution warning message and handling.
chumer Jun 30, 2023
9004815
Fix avoid accidently reachable code from records.
chumer Jul 2, 2023
dfc1ee1
Fix eclipseformat.
chumer Jul 3, 2023
191c0ba
Fix createTerminatingThreadLocal might not be available on all JDKs.
chumer Jul 3, 2023
7e6e0fc
Fix JFR exports.
chumer Jul 3, 2023
eb09462
Fix CompileTheWorld.
chumer Jul 3, 2023
c7a501a
Fix findbugs complaining about class name.
chumer Jul 3, 2023
af97768
Fix HotSpotFastThreadLocals need an IntrinsificationPredicate.
chumer Jul 3, 2023
2ac870f
Fix boot module dependencies should allow Truffle.
chumer Jul 3, 2023
93fed3e
Simplify qualified exports.
chumer Jul 3, 2023
37a18f2
Services might not be accessible to JVMCI.
chumer Jul 3, 2023
55446a0
Update error message in test.
chumer Jul 3, 2023
708140a
Fix broken distribution references in vm_gate.py.
chumer Jul 3, 2023
f10a235
Remove JVMCI service loading from default runtime.
chumer Jul 3, 2023
3ae8fbc
Fix access to native image runner for Truffle.
chumer Jul 3, 2023
7a6aff4
Add back support for LibGraal use on JDK 17 when certain methods are …
chumer Jul 4, 2023
5ad19a6
Truffle runtime needs to depend on sdk:JNIUTILS to support exception …
chumer Jul 4, 2023
10696de
Refactor nativebridge and jniutils to components.
chumer Jul 5, 2023
fee12ed
Fix export jvmci to libgraal if it happens to be initialized eagerly.
chumer Jul 5, 2023
a6c1976
Move nativebridge and jniutils into sdk.
chumer Jul 5, 2023
0e2f026
Fix compiler warning in Libgraal.
chumer Jul 5, 2023
51cfeec
Restore OnShutdownCallback implementation.
chumer Jul 5, 2023
5968fde
Improve tracing code in LibGraalNativeBridgeSupport.
chumer Jul 12, 2023
cd13000
Remove unused jvmci_parent_dists.
chumer Jul 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
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