Skip to content

Commit d14b835

Browse files
committed
[GR-58574] Add SVM interpreter and JDWP support for Native Image
PullRequest: graal/19521
2 parents 3fcef8b + 3563489 commit d14b835

File tree

196 files changed

+40150
-9
lines changed

Some content is hidden

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

196 files changed

+40150
-9
lines changed

compiler/mx.compiler/suite.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,8 +563,8 @@
563563
org.graalvm.nativeimage.foreign,
564564
org.graalvm.nativeimage.llvm,
565565
com.oracle.svm.svm_enterprise,
566+
com.oracle.svm.jdwp.resident,
566567
com.oracle.svm_enterprise.ml_dataset,
567-
com.oracle.svm.enterprise.jdwp.resident,
568568
org.graalvm.nativeimage.base,
569569
org.graalvm.extraimage.builder,
570570
org.graalvm.extraimage.librarysupport,

substratevm/mx.substratevm/mx_substratevm.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1606,6 +1606,42 @@ def prevent_build_path_in_libgraal():
16061606
)
16071607
mx_sdk_vm.register_graalvm_component(libgraal)
16081608

1609+
libsvmjdwp_build_args = [
1610+
"-H:+UnlockExperimentalVMOptions",
1611+
"-H:+IncludeDebugHelperMethods",
1612+
"-H:-DeleteLocalSymbols",
1613+
"-H:+PreserveFramePointer",
1614+
]
1615+
1616+
libsvmjdwp_lib_config = mx_sdk_vm.LibraryConfig(
1617+
destination="<lib:svmjdwp>",
1618+
jvm_library=True,
1619+
use_modules='image',
1620+
jar_distributions=['substratevm:SVM_JDWP_SERVER'],
1621+
build_args=libsvmjdwp_build_args + [
1622+
'--features=com.oracle.svm.jdwp.server.ServerJDWPFeature',
1623+
],
1624+
headers=False,
1625+
)
1626+
1627+
libsvmjdwp = mx_sdk_vm.GraalVmJreComponent(
1628+
suite=suite,
1629+
name='SubstrateVM JDWP Debugger',
1630+
short_name='svmjdwp',
1631+
dir_name="svm",
1632+
license_files=[],
1633+
third_party_license_files=[],
1634+
dependencies=[],
1635+
jar_distributions=[],
1636+
builder_jar_distributions=['substratevm:SVM_JDWP_COMMON', 'substratevm:SVM_JDWP_RESIDENT'],
1637+
support_distributions=[],
1638+
priority=1,
1639+
library_configs=[libsvmjdwp_lib_config],
1640+
stability="experimental",
1641+
jlink=False,
1642+
)
1643+
mx_sdk_vm.register_graalvm_component(libsvmjdwp)
1644+
16091645
def _native_image_configure_extra_jvm_args():
16101646
packages = ['jdk.graal.compiler/jdk.graal.compiler.phases.common', 'jdk.internal.vm.ci/jdk.vm.ci.meta', 'jdk.internal.vm.ci/jdk.vm.ci.services', 'jdk.graal.compiler/jdk.graal.compiler.core.common.util']
16111647
args = ['--add-exports=' + packageName + '=ALL-UNNAMED' for packageName in packages]

substratevm/mx.substratevm/suite.py

Lines changed: 175 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1537,6 +1537,119 @@
15371537
"jacoco" : "exclude",
15381538
"graalCompilerSourceEdition": "ignore",
15391539
},
1540+
1541+
"com.oracle.svm.interpreter.metadata": {
1542+
"subDir": "src",
1543+
"sourceDirs": ["src"],
1544+
"dependencies": [
1545+
"substratevm:SVM"
1546+
],
1547+
"requiresConcealed" : {
1548+
"jdk.internal.vm.ci" : [
1549+
"jdk.vm.ci.meta",
1550+
],
1551+
},
1552+
"checkstyle": "com.oracle.svm.hosted",
1553+
"javaCompliance": "21+",
1554+
"workingSets": "SVM",
1555+
},
1556+
1557+
"com.oracle.svm.interpreter": {
1558+
"subDir": "src",
1559+
"sourceDirs": ["src"],
1560+
"dependencies": [
1561+
"com.oracle.svm.interpreter.metadata",
1562+
],
1563+
"requires" : [
1564+
"java.base"
1565+
],
1566+
"requiresConcealed" : {
1567+
"jdk.internal.vm.ci" : [
1568+
"jdk.vm.ci.meta",
1569+
"jdk.vm.ci.code",
1570+
],
1571+
"java.base" : [
1572+
"jdk.internal.misc", # Unsafe
1573+
],
1574+
},
1575+
"checkstyle": "com.oracle.svm.hosted",
1576+
"javaCompliance": "21+",
1577+
"annotationProcessors": [
1578+
"compiler:GRAAL_PROCESSOR",
1579+
"substratevm:SVM_PROCESSOR",
1580+
],
1581+
"workingSets": "SVM",
1582+
},
1583+
1584+
# Common project both jdwp.server and jdwp.resident.
1585+
"com.oracle.svm.jdwp.bridge": {
1586+
"subDir": "src",
1587+
"sourceDirs": ["src"],
1588+
"dependencies": [
1589+
"substratevm:SVM",
1590+
],
1591+
"requiresConcealed" : {
1592+
"jdk.internal.vm.ci" : [
1593+
"jdk.vm.ci.meta",
1594+
],
1595+
},
1596+
"checkstyle": "com.oracle.svm.hosted",
1597+
"javaCompliance": "21+",
1598+
"annotationProcessors": [
1599+
"compiler:GRAAL_PROCESSOR",
1600+
"substratevm:SVM_PROCESSOR",
1601+
],
1602+
"workingSets": "SVM",
1603+
},
1604+
1605+
# JDWP server, should run on HotSpot and as a shared library e.g. libsvmjdwp.so
1606+
"com.oracle.svm.jdwp.server": {
1607+
"subDir": "src",
1608+
"sourceDirs": ["src"],
1609+
"dependencies": [
1610+
"com.oracle.svm.interpreter.metadata",
1611+
"com.oracle.svm.jdwp.bridge",
1612+
],
1613+
"requiresConcealed" : {
1614+
"jdk.internal.vm.ci" : [
1615+
"jdk.vm.ci.meta",
1616+
],
1617+
"java.base" : [
1618+
"jdk.internal.misc", # Signal
1619+
],
1620+
},
1621+
"checkstyle": "com.oracle.svm.hosted",
1622+
"javaCompliance": "21+",
1623+
"annotationProcessors": [
1624+
"substratevm:SVM_PROCESSOR",
1625+
],
1626+
"workingSets": "SVM",
1627+
},
1628+
1629+
# JDWP implementation bits that are included in the application.
1630+
"com.oracle.svm.jdwp.resident": {
1631+
"subDir": "src",
1632+
"sourceDirs": ["src"],
1633+
"dependencies": [
1634+
"com.oracle.svm.interpreter",
1635+
"com.oracle.svm.jdwp.bridge",
1636+
],
1637+
"requiresConcealed" : {
1638+
"jdk.internal.vm.ci" : [
1639+
"jdk.vm.ci.meta",
1640+
"jdk.vm.ci.code",
1641+
],
1642+
"java.base" : [
1643+
"jdk.internal.misc", # Signal
1644+
],
1645+
},
1646+
"checkstyle": "com.oracle.svm.hosted",
1647+
"javaCompliance": "21+",
1648+
"annotationProcessors": [
1649+
"substratevm:SVM_PROCESSOR",
1650+
],
1651+
"workingSets": "SVM",
1652+
},
15401653
},
15411654

15421655
"distributions": {
@@ -1596,9 +1709,9 @@
15961709
org.graalvm.extraimage.librarysupport,
15971710
com.oracle.svm.extraimage_enterprise,
15981711
org.graalvm.nativeimage.foreign,
1599-
com.oracle.svm.enterprise.jdwp.common,
1600-
com.oracle.svm.enterprise.jdwp.server,
1601-
com.oracle.svm.enterprise.jdwp.resident,
1712+
com.oracle.svm.jdwp.common,
1713+
com.oracle.svm.jdwp.server,
1714+
com.oracle.svm.jdwp.resident,
16021715
org.graalvm.truffle.runtime.svm,
16031716
com.oracle.truffle.enterprise.svm""",
16041717
"com.oracle.svm.hosted.c.libc to com.oracle.graal.sandbox",
@@ -1611,7 +1724,7 @@
16111724
"com.oracle.svm.hosted.fieldfolding to jdk.graal.compiler",
16121725
"com.oracle.svm.hosted.phases to jdk.graal.compiler",
16131726
"com.oracle.svm.hosted.reflect to jdk.graal.compiler",
1614-
"com.oracle.svm.core.thread to com.oracle.svm.enterprise.jdwp.resident",
1727+
"com.oracle.svm.core.thread to com.oracle.svm.jdwp.resident",
16151728
],
16161729
"requires": [
16171730
"java.management",
@@ -2079,7 +2192,7 @@
20792192
"org.graalvm.collections",
20802193
],
20812194
"exports" : [
2082-
"com.oracle.svm.util to org.graalvm.nativeimage.pointsto,org.graalvm.nativeimage.builder,org.graalvm.nativeimage.librarysupport,org.graalvm.nativeimage.driver,org.graalvm.nativeimage.llvm,org.graalvm.nativeimage.agent.jvmtibase,org.graalvm.nativeimage.agent.tracing,org.graalvm.nativeimage.agent.diagnostics,org.graalvm.nativeimage.junitsupport,com.oracle.svm.svm_enterprise,com.oracle.svm_enterprise.ml_dataset,com.oracle.svm.enterprise.jdwp.resident,org.graalvm.extraimage.builder,com.oracle.svm.extraimage_enterprise,org.graalvm.extraimage.librarysupport,org.graalvm.nativeimage.foreign,org.graalvm.truffle.runtime.svm,com.oracle.truffle.enterprise.svm",
2195+
"com.oracle.svm.util to org.graalvm.nativeimage.pointsto,org.graalvm.nativeimage.builder,org.graalvm.nativeimage.librarysupport,org.graalvm.nativeimage.driver,org.graalvm.nativeimage.llvm,org.graalvm.nativeimage.agent.jvmtibase,org.graalvm.nativeimage.agent.tracing,org.graalvm.nativeimage.agent.diagnostics,org.graalvm.nativeimage.junitsupport,com.oracle.svm.svm_enterprise,com.oracle.svm_enterprise.ml_dataset,com.oracle.svm.jdwp.resident,org.graalvm.extraimage.builder,com.oracle.svm.extraimage_enterprise,org.graalvm.extraimage.librarysupport,org.graalvm.nativeimage.foreign,org.graalvm.truffle.runtime.svm,com.oracle.truffle.enterprise.svm",
20832196
"com.oracle.svm.common.meta to org.graalvm.nativeimage.pointsto,org.graalvm.nativeimage.builder,org.graalvm.nativeimage.llvm,org.graalvm.extraimage.builder,org.graalvm.nativeimage.foreign,org.graalvm.truffle.runtime.svm,com.oracle.truffle.enterprise.svm",
20842197
"com.oracle.svm.common.option to org.graalvm.nativeimage.pointsto,org.graalvm.nativeimage.builder,org.graalvm.nativeimage.driver,org.graalvm.nativeimage.foreign,org.graalvm.truffle.runtime.svm,com.oracle.truffle.enterprise.svm",
20852198
],
@@ -2398,5 +2511,62 @@
23982511
"tag": ["default", "public"],
23992512
},
24002513
},
2514+
2515+
"SVM_JDWP_COMMON": {
2516+
"subDir": "src",
2517+
"dependencies": [
2518+
"com.oracle.svm.interpreter.metadata",
2519+
"com.oracle.svm.jdwp.bridge",
2520+
],
2521+
"distDependencies": [
2522+
"SVM",
2523+
],
2524+
"moduleInfo" : {
2525+
"name" : "com.oracle.svm.jdwp.common",
2526+
"exports" : [
2527+
"com.oracle.svm.jdwp.bridge to com.oracle.svm.jdwp.server,com.oracle.svm.jdwp.resident",
2528+
"com.oracle.svm.jdwp.bridge.nativebridge to com.oracle.svm.jdwp.server,com.oracle.svm.jdwp.resident",
2529+
"com.oracle.svm.jdwp.bridge.jniutils to com.oracle.svm.jdwp.server,com.oracle.svm.jdwp.resident",
2530+
"com.oracle.svm.interpreter.metadata to com.oracle.svm.jdwp.server,com.oracle.svm.jdwp.resident",
2531+
"com.oracle.svm.interpreter.metadata.serialization to com.oracle.svm.jdwp.server,com.oracle.svm.jdwp.resident",
2532+
],
2533+
"requires" : [
2534+
"org.graalvm.collections",
2535+
],
2536+
}
2537+
},
2538+
2539+
"SVM_JDWP_RESIDENT": {
2540+
"subDir": "src",
2541+
"dependencies": [
2542+
"com.oracle.svm.jdwp.resident",
2543+
],
2544+
"distDependencies": [
2545+
"SVM_JDWP_COMMON",
2546+
"sdk:COLLECTIONS",
2547+
"compiler:GRAAL",
2548+
],
2549+
"moduleInfo" : {
2550+
"name" : "com.oracle.svm.jdwp.resident",
2551+
"exports": [
2552+
"com.oracle.svm.interpreter,com.oracle.svm.jdwp.resident to org.graalvm.nativeimage.builder",
2553+
],
2554+
}
2555+
},
2556+
2557+
"SVM_JDWP_SERVER": {
2558+
"subDir": "src",
2559+
"dependencies": [
2560+
"com.oracle.svm.jdwp.server",
2561+
],
2562+
"distDependencies": [
2563+
"substratevm:SVM",
2564+
"SVM_JDWP_COMMON",
2565+
],
2566+
"moduleInfo" : {
2567+
"name" : "com.oracle.svm.jdwp.server",
2568+
}
2569+
},
2570+
24012571
},
24022572
}

0 commit comments

Comments
 (0)