diff --git a/compiler/CHANGELOG.md b/compiler/CHANGELOG.md index 89355c61ff89..606dfc57b0a6 100644 --- a/compiler/CHANGELOG.md +++ b/compiler/CHANGELOG.md @@ -3,6 +3,7 @@ This changelog summarizes newly introduced optimizations and other compiler related changes. ## Version 23.0.0 +* (GR-42212): Remove support for all JDKs earlier than JDK 17. * (GR-42044): Improved output of `-Dgraal.ShowConfiguration=info`. For example: `Using "Graal Community compiler" loaded from a Native Image shared library` instead of: diff --git a/compiler/mx.compiler/suite.py b/compiler/mx.compiler/suite.py index b66af2ece7f5..db47d771075f 100644 --- a/compiler/mx.compiler/suite.py +++ b/compiler/mx.compiler/suite.py @@ -215,7 +215,7 @@ ], }, "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "API,Graal", }, @@ -226,7 +226,7 @@ "java.compiler" # javax.annotation.processing.* ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Codegen", }, @@ -238,7 +238,7 @@ "java.compiler" # javax.annotation.processing.* ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Codegen", }, @@ -251,7 +251,7 @@ "sdk:GRAAL_SDK" ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal", }, @@ -263,7 +263,7 @@ "java.compiler" # javax.annotation.processing.* ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Codegen", }, @@ -275,7 +275,7 @@ "mx:JUNIT", ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal", }, @@ -299,7 +299,7 @@ ], }, "annotationProcessors" : ["GRAAL_PROCESSOR"], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Debug", }, @@ -311,7 +311,7 @@ "org.graalvm.compiler.debug", ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Debug,Test", }, @@ -330,7 +330,7 @@ }, "annotationProcessors" : ["GRAAL_PROCESSOR"], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal", }, @@ -338,7 +338,7 @@ "subDir" : "src", "sourceDirs" : ["src"], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "API,Graal", }, @@ -356,7 +356,7 @@ ], }, "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "API,Graal", }, @@ -376,7 +376,7 @@ ], "spotbugs" : "false", "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "API,Graal", }, @@ -395,7 +395,7 @@ "annotationProcessors" : [ ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "API,Graal", }, @@ -411,7 +411,7 @@ "annotationProcessors" : [ ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "API,Graal", }, @@ -426,7 +426,7 @@ "GRAAL_NATIVEBRIDGE_PROCESSOR", ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Test", "jacoco" : "exclude", "testProject" : True, @@ -447,7 +447,7 @@ ], "jacoco" : "exclude", # GR-13965 "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "API,Graal", }, @@ -456,7 +456,7 @@ "sourceDirs" : ["src"], "dependencies" : [], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal", }, @@ -471,7 +471,7 @@ "java.compiler" # javax.annotation.processing.* ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal", }, @@ -487,7 +487,7 @@ ] }, "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "API,Graal", }, @@ -504,7 +504,7 @@ ] }, "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "API,Graal", }, @@ -520,7 +520,7 @@ ], }, "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "API,Graal", }, @@ -532,7 +532,7 @@ "org.graalvm.compiler.core.test", "JVMCI_HOTSPOT", ], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "API,Graal", }, @@ -543,7 +543,7 @@ "JVMCI_API", ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "API,Graal", }, @@ -562,7 +562,7 @@ ] }, "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "API,Graal,Test", }, @@ -571,7 +571,7 @@ "sourceDirs" : ["src"], "dependencies" : ["JVMCI_API"], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "API,Graal,Replacements", }, @@ -580,6 +580,7 @@ "sourceDirs" : ["src"], "dependencies" : [ "JVMCI_HOTSPOT", + "JFR", "org.graalvm.compiler.api.runtime", "org.graalvm.compiler.printer", "org.graalvm.compiler.replacements", @@ -596,33 +597,7 @@ "annotationProcessors" : [ "GRAAL_PROCESSOR", ], - "javaCompliance" : "11+", - "workingSets" : "Graal,HotSpot", - }, - - "org.graalvm.compiler.hotspot.jdk17" : { - "subDir" : "src", - "sourceDirs" : ["src"], - "dependencies": [ - "org.graalvm.compiler.hotspot", - "JVMCI_HOTSPOT", - "JFR", - ], - "requiresConcealed" : { - "jdk.internal.vm.ci" : [ - "jdk.vm.ci.hotspot", - "jdk.vm.ci.meta", - "jdk.vm.ci.services", - ], - }, - "annotationProcessors" : [ - "GRAAL_PROCESSOR", - ], - "overlayTarget" : "org.graalvm.compiler.hotspot", - "multiReleaseJarVersion" : "17", - "checkstyle" : "org.graalvm.compiler.graph", "javaCompliance" : "17+", - "checkPackagePrefix" : "false", "workingSets" : "Graal,HotSpot", }, @@ -639,7 +614,7 @@ "annotationProcessors" : [ "GRAAL_PROCESSOR", ], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,HotSpot", }, @@ -658,7 +633,7 @@ "annotationProcessors" : [ "GRAAL_PROCESSOR" ], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,HotSpot,AArch64", }, @@ -681,7 +656,7 @@ "annotationProcessors" : [ "GRAAL_PROCESSOR" ], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,HotSpot,AMD64", }, @@ -702,7 +677,7 @@ "annotationProcessors" : [ "GRAAL_PROCESSOR" ], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,HotSpot,RISCV64", }, @@ -727,26 +702,6 @@ "GRAAL_PROCESSOR" ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", - "workingSets" : "Graal,HotSpot,Test", - }, - - "org.graalvm.compiler.hotspot.jdk17.test" : { - "testProject" : True, - "subDir" : "src", - "sourceDirs" : ["src"], - "dependencies" : [ - "org.graalvm.compiler.replacements.test", - ], - "requiresConcealed" : { - "java.base" : [ - "jdk.internal.misc", - ], - "jdk.internal.vm.ci" : [ - "jdk.vm.ci.meta", - ], - }, - "checkstyle": "org.graalvm.compiler.graph", "javaCompliance" : "17+", "workingSets" : "Graal,HotSpot,Test", }, @@ -762,7 +717,7 @@ "JVMCI_HOTSPOT", ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,HotSpot,Test", }, @@ -776,7 +731,7 @@ ], "annotationProcessors" : ["GRAAL_PROCESSOR"], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,HotSpot,AArch64,Test", }, @@ -791,7 +746,7 @@ ], "annotationProcessors" : ["GRAAL_PROCESSOR"], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,HotSpot,AMD64,Test", }, @@ -799,7 +754,7 @@ "subDir" : "src", "sourceDirs" : ["src"], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Graph", }, @@ -811,7 +766,7 @@ "java.compiler" # javax.annotation.processing.* ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Graph", }, @@ -833,7 +788,7 @@ "jdk.vm.ci.services", ], }, - "javaCompliance" : "11+", + "javaCompliance" : "17+", "checkstyleVersion" : "8.36.1", "annotationProcessors" : [ "GRAAL_PROCESSOR" @@ -852,7 +807,7 @@ "org.graalvm.graphio", ], "annotationProcessors" : ["GRAAL_PROCESSOR"], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Graph,Test", }, @@ -870,7 +825,7 @@ ], }, "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Assembler", }, @@ -888,7 +843,7 @@ ], }, "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Assembler,AArch64", }, @@ -900,7 +855,7 @@ ], "annotationProcessors" : ["GRAAL_PROCESSOR"], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Assembler,AMD64", }, @@ -909,7 +864,7 @@ "sourceDirs" : ["src"], "dependencies" : ["JVMCI_API"], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Java", }, @@ -924,7 +879,7 @@ "org.graalvm.compiler.debug", ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Assembler,Test", }, @@ -936,7 +891,7 @@ "org.graalvm.compiler.asm.aarch64", ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Assembler,AArch64,Test", }, @@ -951,7 +906,7 @@ "jdk.unsupported", ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Assembler,AMD64,Test", }, @@ -973,7 +928,7 @@ ], "annotationProcessors" : ["GRAAL_PROCESSOR"], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,LIR", }, @@ -985,7 +940,7 @@ "java.compiler" # javax.annotation.processing.* ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,LIR", }, @@ -997,7 +952,7 @@ ], "annotationProcessors" : ["GRAAL_PROCESSOR"], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,LIR", "spotbugs" : "false", "testProject" : True, @@ -1011,7 +966,7 @@ "org.graalvm.compiler.lir", ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,LIR", }, @@ -1029,7 +984,7 @@ }, "annotationProcessors" : ["GRAAL_PROCESSOR"], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,LIR,AArch64", }, @@ -1042,7 +997,7 @@ ], "annotationProcessors" : ["GRAAL_PROCESSOR"], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,LIR,AMD64", }, @@ -1054,7 +1009,7 @@ "jdk.unsupported" # sun.misc.Unsafe ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "annotationProcessors" : ["GRAAL_PROCESSOR"], "workingSets" : "API,Graal", }, @@ -1079,7 +1034,7 @@ ], }, "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "annotationProcessors" : [ "GRAAL_PROCESSOR", ], @@ -1099,7 +1054,7 @@ ], }, "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "annotationProcessors" : [ "GRAAL_PROCESSOR", ], @@ -1114,7 +1069,7 @@ "org.graalvm.compiler.lir.amd64", ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "annotationProcessors" : [ "GRAAL_PROCESSOR", ], @@ -1145,7 +1100,7 @@ "GRAAL_PROCESSOR", ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Replacements,Test", "jacoco" : "exclude", }, @@ -1158,7 +1113,7 @@ "java.compiler" # javax.annotation.processing.* ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Replacements", }, @@ -1182,7 +1137,7 @@ ], }, "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "annotationProcessors" : [ "GRAAL_PROCESSOR", ], @@ -1194,7 +1149,7 @@ "sourceDirs" : ["src"], "dependencies" : ["org.graalvm.compiler.core.test"], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Graph", }, @@ -1213,7 +1168,7 @@ }, "annotationProcessors" : ["GRAAL_PROCESSOR"], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Phases", }, @@ -1227,7 +1182,7 @@ "GRAAL_PROCESSOR", ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Phases", }, @@ -1245,7 +1200,7 @@ ], }, "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Test", }, @@ -1262,7 +1217,7 @@ "GRAAL_PROCESSOR", ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Phases", }, @@ -1271,7 +1226,7 @@ "sourceDirs" : ["src"], "dependencies" : ["mx:JMH_1_21", "org.graalvm.compiler.microbenchmarks"], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "annotationProcessors" : ["mx:JMH_1_21"], "spotbugsIgnoresGenerated" : True, "workingSets" : "Graal,Bench", @@ -1288,7 +1243,7 @@ "org.graalvm.compiler.runtime", ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "checkPackagePrefix" : "false", "annotationProcessors" : ["mx:JMH_1_21"], "spotbugsIgnoresGenerated" : True, @@ -1304,7 +1259,7 @@ "org.graalvm.compiler.core.test" ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Test", }, @@ -1316,7 +1271,7 @@ ], "annotationProcessors" : ["GRAAL_PROCESSOR"], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Phases", }, @@ -1333,7 +1288,7 @@ ], }, "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "annotationProcessors" : [ "GRAAL_PROCESSOR", ], @@ -1348,7 +1303,7 @@ "java.compiler" # javax.annotation.processing.* ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Codegen", }, @@ -1364,7 +1319,7 @@ "annotationProcessors" : [ "GRAAL_PROCESSOR", ], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,AArch64", }, @@ -1377,7 +1332,7 @@ "JVMCI_HOTSPOT" ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,AArch64,Test", }, @@ -1393,7 +1348,7 @@ "annotationProcessors" : [ "GRAAL_PROCESSOR", ], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,AMD64", }, @@ -1410,7 +1365,7 @@ "jdk.unsupported", ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,AMD64,Test", }, @@ -1424,7 +1379,7 @@ "annotationProcessors" : [ "GRAAL_PROCESSOR", ], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,RISCV64", }, @@ -1433,7 +1388,7 @@ "sourceDirs" : ["src"], "dependencies" : ["org.graalvm.compiler.core"], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal", }, @@ -1445,7 +1400,7 @@ ], "annotationProcessors" : ["GRAAL_PROCESSOR"], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Java", }, @@ -1471,7 +1426,7 @@ ], "annotationProcessors" : ["GRAAL_PROCESSOR"], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Java", }, @@ -1486,7 +1441,7 @@ "GRAAL_PROCESSOR", ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Graph", }, @@ -1502,7 +1457,7 @@ "jdk.unsupported", ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Test", }, @@ -1531,7 +1486,7 @@ }, "annotationProcessors" : ["GRAAL_PROCESSOR"], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Test", "jacoco" : "exclude", }, @@ -1546,7 +1501,7 @@ "jdk.unsupported", ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Test", "jacoco" : "exclude", "spotbugs" : "false", @@ -1565,7 +1520,7 @@ "checkstyle" : "org.graalvm.compiler.graph", "annotationProcessors" : [ ], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Truffle", }, @@ -1580,7 +1535,7 @@ "annotationProcessors" : [ "truffle:TRUFFLE_DSL_PROCESSOR" ], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Truffle", "jacoco" : "exclude", }, @@ -1609,7 +1564,7 @@ "jdk.vm.ci.code", ], }, - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Truffle", }, @@ -1618,7 +1573,7 @@ "sourceDirs" : ["src"], "dependencies" : ["JVMCI_SERVICES"], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Truffle", }, @@ -1631,7 +1586,7 @@ "checkstyle" : "org.graalvm.compiler.graph", "annotationProcessors" : [ ], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Truffle", "jacoco" : "exclude", }, @@ -1646,7 +1601,7 @@ "jdk.jfr" ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Truffle", "jacoco" : "exclude", }, @@ -1673,7 +1628,7 @@ "GRAAL_PROCESSOR", "truffle:TRUFFLE_DSL_PROCESSOR", ], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Truffle", "jacoco" : "exclude", }, @@ -1706,7 +1661,7 @@ "truffle:TRUFFLE_DSL_PROCESSOR" ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Truffle,Test", "jacoco" : "exclude", "testProject" : True, @@ -1738,7 +1693,7 @@ "org.graalvm.compiler.truffle.common", ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "annotationProcessors" : [ "GRAAL_PROCESSOR", ], @@ -1752,7 +1707,7 @@ "org.graalvm.libgraal.jni.annotation" ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Truffle", }, @@ -1765,7 +1720,7 @@ "org.graalvm.compiler.hotspot", ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "annotationProcessors" : [ "GRAAL_PROCESSOR", ], @@ -1780,7 +1735,7 @@ "org.graalvm.compiler.truffle.runtime.hotspot", ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "annotationProcessors" : [ "GRAAL_PROCESSOR", ], @@ -1803,7 +1758,7 @@ ], }, "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "annotationProcessors" : [ "truffle:TRUFFLE_DSL_PROCESSOR", ], @@ -1827,7 +1782,7 @@ }, "jacoco" : "exclude", # GR-13965 "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "annotationProcessors" : [ "GRAAL_LIBGRAAL_PROCESSOR", ], @@ -1845,7 +1800,7 @@ "java.compiler" # javax.annotation.processing.* ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Truffle", }, @@ -1861,22 +1816,7 @@ "jdk.unsupported" # sun.misc.Unsafe ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", - "workingSets" : "Graal,Truffle", - }, - - "org.graalvm.compiler.truffle.runtime.hotspot.jdk17" : { - "subDir" : "src", - "sourceDirs" : ["src"], - "dependencies" : [ - "org.graalvm.compiler.truffle.runtime", - "JVMCI_HOTSPOT", - ], - "checkPackagePrefix" : "false", - "checkstyle" : "org.graalvm.compiler.graph", "javaCompliance" : "17+", - "multiReleaseJarVersion" : "17", - "overlayTarget" : "org.graalvm.compiler.truffle.runtime.hotspot", "workingSets" : "Graal,Truffle", }, @@ -1888,7 +1828,7 @@ "org.graalvm.compiler.hotspot.amd64", ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "annotationProcessors" : [ "GRAAL_PROCESSOR", ], @@ -1903,7 +1843,7 @@ "org.graalvm.compiler.truffle.compiler.hotspot", ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "annotationProcessors" : ["GRAAL_PROCESSOR"], "workingSets" : "Graal,Truffle,AArch64", }, @@ -1917,7 +1857,7 @@ "mx:JMH_1_21", ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "checkPackagePrefix" : "false", "annotationProcessors" : ["mx:JMH_1_21"], "spotbugsIgnoresGenerated" : True, @@ -1932,7 +1872,7 @@ "org.graalvm.compiler.nodes", ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", }, "org.graalvm.profdiff.test" : { @@ -1943,7 +1883,7 @@ "mx:JUNIT", ], "checkstyle" : "org.graalvm.compiler.graph", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Graal,Test", }, }, @@ -1988,7 +1928,6 @@ "org.graalvm.compiler.hotspot.aarch64.test", "org.graalvm.compiler.hotspot.amd64.test", "org.graalvm.compiler.hotspot.lir.test", - "org.graalvm.compiler.hotspot.jdk17.test", "org.graalvm.compiler.options.test", "org.graalvm.compiler.jtt", "org.graalvm.compiler.lir.jtt", @@ -2044,7 +1983,7 @@ "GRAAL", ], "maven": False, - "javaCompliance" : "11+", + "javaCompliance" : "17+", }, "GRAAL_PROCESSOR" : { diff --git a/compiler/src/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotSafepointOp.java b/compiler/src/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotSafepointOp.java index 6a6773811f66..180f9bbfd7be 100644 --- a/compiler/src/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotSafepointOp.java +++ b/compiler/src/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotSafepointOp.java @@ -28,7 +28,6 @@ import org.graalvm.compiler.asm.aarch64.AArch64Address; import org.graalvm.compiler.asm.aarch64.AArch64MacroAssembler; -import org.graalvm.compiler.core.common.NumUtil; import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig; import org.graalvm.compiler.hotspot.HotSpotMarkId; import org.graalvm.compiler.lir.LIRFrameState; @@ -68,46 +67,7 @@ public void emitCode(CompilationResultBuilder crb, AArch64MacroAssembler masm) { emitCode(crb, masm, config, false, thread, scratch, state); } - /** - * Conservatively checks whether we can load the safepoint polling address with a single ldr - * instruction or not. - * - * @return true if it is guaranteed that polling page offset will always fit into a 21-bit - * signed integer, false otherwise. - */ - private static boolean isPollingPageFar(GraalHotSpotVMConfig config) { - final long pollingPageAddress = config.safepointPollingAddress; - return !NumUtil.isSignedNbit(21, pollingPageAddress - config.codeCacheLowBound) || !NumUtil.isSignedNbit(21, pollingPageAddress - config.codeCacheHighBound); - } - public static void emitCode(CompilationResultBuilder crb, AArch64MacroAssembler masm, GraalHotSpotVMConfig config, boolean onReturn, Register thread, Register scratch, LIRFrameState state) { - if (config.useThreadLocalPolling) { - emitThreadLocalPoll(crb, masm, config, onReturn, thread, scratch, state); - } else { - emitGlobalPoll(crb, masm, config, onReturn, scratch, state); - } - } - - private static void emitGlobalPoll(CompilationResultBuilder crb, AArch64MacroAssembler masm, GraalHotSpotVMConfig config, boolean onReturn, Register scratch, LIRFrameState state) { - if (isPollingPageFar(config)) { - crb.recordMark(onReturn ? HotSpotMarkId.POLL_RETURN_FAR : HotSpotMarkId.POLL_FAR); - masm.movNativeAddress(scratch, config.safepointPollingAddress); - crb.recordMark(onReturn ? HotSpotMarkId.POLL_RETURN_FAR : HotSpotMarkId.POLL_FAR); - if (state != null) { - crb.recordInfopoint(masm.position(), state, InfopointReason.SAFEPOINT); - } - masm.deadLoad(32, AArch64Address.createBaseRegisterOnlyAddress(32, scratch), false); - } else { - crb.recordMark(onReturn ? HotSpotMarkId.POLL_RETURN_NEAR : HotSpotMarkId.POLL_NEAR); - if (state != null) { - crb.recordInfopoint(masm.position(), state, InfopointReason.SAFEPOINT); - } - masm.deadLoad(32, AArch64Address.createPCLiteralAddress(32), false); - } - } - - private static void emitThreadLocalPoll(CompilationResultBuilder crb, AArch64MacroAssembler masm, GraalHotSpotVMConfig config, boolean onReturn, Register thread, Register scratch, - LIRFrameState state) { assert config.threadPollingPageOffset >= 0; masm.ldr(64, scratch, masm.makeAddress(64, thread, config.threadPollingPageOffset)); crb.recordMark(onReturn ? HotSpotMarkId.POLL_RETURN_FAR : HotSpotMarkId.POLL_FAR); @@ -116,5 +76,4 @@ private static void emitThreadLocalPoll(CompilationResultBuilder crb, AArch64Mac } masm.deadLoad(32, AArch64Address.createBaseRegisterOnlyAddress(32, scratch), false); } - } diff --git a/compiler/src/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotSafepointOp.java b/compiler/src/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotSafepointOp.java index b5c181ff4d77..561100cf09d9 100644 --- a/compiler/src/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotSafepointOp.java +++ b/compiler/src/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotSafepointOp.java @@ -24,17 +24,7 @@ */ package org.graalvm.compiler.hotspot.amd64; -import static jdk.vm.ci.amd64.AMD64.k0; -import static jdk.vm.ci.amd64.AMD64.k1; -import static jdk.vm.ci.amd64.AMD64.k2; -import static jdk.vm.ci.amd64.AMD64.k3; -import static jdk.vm.ci.amd64.AMD64.k4; -import static jdk.vm.ci.amd64.AMD64.k5; -import static jdk.vm.ci.amd64.AMD64.k6; -import static jdk.vm.ci.amd64.AMD64.k7; import static jdk.vm.ci.amd64.AMD64.rax; -import static jdk.vm.ci.amd64.AMD64.rip; -import static org.graalvm.compiler.core.common.NumUtil.isInt; import java.util.EnumSet; @@ -49,7 +39,6 @@ import org.graalvm.compiler.lir.amd64.AMD64LIRInstruction; import org.graalvm.compiler.lir.asm.CompilationResultBuilder; import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; -import org.graalvm.compiler.serviceprovider.JavaVersionUtil; import jdk.vm.ci.amd64.AMD64; import jdk.vm.ci.amd64.AMD64.CPUFeature; @@ -57,7 +46,6 @@ import jdk.vm.ci.code.RegisterValue; import jdk.vm.ci.code.site.InfopointReason; import jdk.vm.ci.meta.AllocatableValue; -import jdk.vm.ci.meta.Value; /** * Emits a safepoint poll. @@ -73,30 +61,14 @@ public final class AMD64HotSpotSafepointOp extends AMD64LIRInstruction { private final GraalHotSpotVMConfig config; private final Register thread; - private static final AllocatableValue[] MASK_REGISTERS = new AllocatableValue[]{k0.asValue(), k1.asValue(), k2.asValue(), k3.asValue(), k4.asValue(), k5.asValue(), k6.asValue(), k7.asValue()}; - public AMD64HotSpotSafepointOp(LIRFrameState state, GraalHotSpotVMConfig config, NodeLIRBuilderTool tool, Register thread) { super(TYPE); this.state = state; this.config = config; this.thread = thread; - if (config.useThreadLocalPolling || isPollingPageFar(config)) { - temp = tool.getLIRGeneratorTool().newVariable(LIRKind.value(tool.getLIRGeneratorTool().target().arch.getWordKind())); - } else { - // Don't waste a register if it's unneeded - temp = Value.ILLEGAL; - } + temp = tool.getLIRGeneratorTool().newVariable(LIRKind.value(tool.getLIRGeneratorTool().target().arch.getWordKind())); EnumSet features = ((AMD64) tool.getLIRGeneratorTool().target().arch).getFeatures(); - if (JavaVersionUtil.JAVA_SPEC < 17 && features.contains(AMD64.CPUFeature.AVX512F)) { - /* - * Hotspot doesn't save AVX512 opmask registers on JDK11. Mark them as killed to force - * spilling around safepoints. - */ - killedMaskRegisters = MASK_REGISTERS; - } else { - killedMaskRegisters = AllocatableValue.NONE; - } - + killedMaskRegisters = AllocatableValue.NONE; } @Override @@ -105,46 +77,6 @@ public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler asm) { } public static void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler asm, GraalHotSpotVMConfig config, boolean atReturn, LIRFrameState state, Register thread, Register scratch) { - if (config.useThreadLocalPolling) { - emitThreadLocalPoll(crb, asm, config, atReturn, state, thread, scratch); - } else { - emitGlobalPoll(crb, asm, config, atReturn, state, scratch); - } - } - - /** - * Tests if the polling page address can be reached from the code cache with 32-bit - * displacements. - */ - private static boolean isPollingPageFar(GraalHotSpotVMConfig config) { - final long pollingPageAddress = config.safepointPollingAddress; - return config.forceUnreachable || !isInt(pollingPageAddress - config.codeCacheLowBound) || !isInt(pollingPageAddress - config.codeCacheHighBound); - } - - private static void emitGlobalPoll(CompilationResultBuilder crb, AMD64MacroAssembler asm, GraalHotSpotVMConfig config, boolean atReturn, LIRFrameState state, Register scratch) { - assert !atReturn || state == null : "state is unneeded at return"; - if (isPollingPageFar(config)) { - asm.movq(scratch, config.safepointPollingAddress); - crb.recordMark(atReturn ? HotSpotMarkId.POLL_RETURN_FAR : HotSpotMarkId.POLL_FAR); - final int pos = asm.position(); - if (state != null) { - crb.recordInfopoint(pos, state, InfopointReason.SAFEPOINT); - } - asm.testl(rax, new AMD64Address(scratch)); - } else { - crb.recordMark(atReturn ? HotSpotMarkId.POLL_RETURN_NEAR : HotSpotMarkId.POLL_NEAR); - final int pos = asm.position(); - if (state != null) { - crb.recordInfopoint(pos, state, InfopointReason.SAFEPOINT); - } - // The C++ code transforms the polling page offset into an RIP displacement - // to the real address at that offset in the polling page. - asm.testl(rax, new AMD64Address(rip, 0)); - } - } - - private static void emitThreadLocalPoll(CompilationResultBuilder crb, AMD64MacroAssembler asm, GraalHotSpotVMConfig config, boolean atReturn, LIRFrameState state, Register thread, - Register scratch) { assert !atReturn || state == null : "state is unneeded at return"; assert config.threadPollingPageOffset >= 0; diff --git a/compiler/src/org.graalvm.compiler.hotspot.jdk17/src/org/graalvm/compiler/hotspot/HotSpotGraalServices.java b/compiler/src/org.graalvm.compiler.hotspot.jdk17/src/org/graalvm/compiler/hotspot/HotSpotGraalServices.java deleted file mode 100644 index 2eb673a92752..000000000000 --- a/compiler/src/org.graalvm.compiler.hotspot.jdk17/src/org/graalvm/compiler/hotspot/HotSpotGraalServices.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.graalvm.compiler.hotspot; - -import java.util.Objects; - -import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; -import jdk.vm.ci.hotspot.HotSpotObjectConstantScope; -import jdk.vm.ci.hotspot.HotSpotSpeculationLog; -import jdk.vm.ci.meta.SpeculationLog; -import jdk.vm.ci.services.Services; - -/** - * JDK 17+ version of {@code HotSpotGraalServices}. - */ -public class HotSpotGraalServices { - - public static CompilationContext enterGlobalCompilationContext() { - HotSpotObjectConstantScope impl = HotSpotObjectConstantScope.enterGlobalScope(); - return impl == null ? null : new CompilationContext(impl); - } - - public static CompilationContext openLocalCompilationContext(Object description) { - HotSpotObjectConstantScope impl = HotSpotObjectConstantScope.openLocalScope(Objects.requireNonNull(description)); - return impl == null ? null : new CompilationContext(impl); - } - - public static void exit(int status, HotSpotJVMCIRuntime runtime) { - if (Services.IS_IN_NATIVE_IMAGE) { - runtime.exitHotSpot(status); - } else { - System.exit(status); - } - } - - public static SpeculationLog newHotSpotSpeculationLog(long cachedFailedSpeculationsAddress) { - return new HotSpotSpeculationLog(cachedFailedSpeculationsAddress); - } -} diff --git a/compiler/src/org.graalvm.compiler.hotspot.jdk17/src/org/graalvm/compiler/hotspot/IsGraalPredicate.java b/compiler/src/org.graalvm.compiler.hotspot.jdk17/src/org/graalvm/compiler/hotspot/IsGraalPredicate.java deleted file mode 100644 index 71ed9b927214..000000000000 --- a/compiler/src/org.graalvm.compiler.hotspot.jdk17/src/org/graalvm/compiler/hotspot/IsGraalPredicate.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.graalvm.compiler.hotspot; - -import static jdk.vm.ci.hotspot.HotSpotJVMCICompilerFactory.CompilationLevelAdjustment.None; - -import org.graalvm.compiler.debug.GraalError; - -import jdk.vm.ci.hotspot.HotSpotJVMCICompilerFactory; -import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; - -/** - * Determines if a given class is a JVMCI or Graal class for the purpose of - * {@link HotSpotGraalCompilerFactory.Options#CompileGraalWithC1Only}. - */ -class IsGraalPredicate extends IsGraalPredicateBase { - /** - * Module containing {@link HotSpotJVMCICompilerFactory}. - */ - private final Module jvmciModule; - - /** - * Module containing {@link HotSpotGraalCompilerFactory}. - */ - private final Module graalModule; - - /** - * Module containing the {@linkplain CompilerConfigurationFactory#selectFactory selected} - * configuration. - */ - private Module compilerConfigurationModule; - - IsGraalPredicate() { - jvmciModule = HotSpotJVMCICompilerFactory.class.getModule(); - graalModule = HotSpotGraalCompilerFactory.class.getModule(); - } - - @Override - void onCompilerConfigurationFactorySelection(HotSpotJVMCIRuntime runtime, CompilerConfigurationFactory factory) { - compilerConfigurationModule = factory.getClass().getModule(); - runtime.excludeFromJVMCICompilation(jvmciModule, graalModule, compilerConfigurationModule); - } - - @Override - boolean apply(Class declaringClass) { - throw GraalError.shouldNotReachHere(); - } - - @Override - HotSpotJVMCICompilerFactory.CompilationLevelAdjustment getCompilationLevelAdjustment() { - return None; - } - -} diff --git a/compiler/src/org.graalvm.compiler.hotspot.jdk17.test/src/org/graalvm/compiler/hotspot/jdk17/test/CheckIndexLongTest.java b/compiler/src/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CheckIndexLongTest.java similarity index 99% rename from compiler/src/org.graalvm.compiler.hotspot.jdk17.test/src/org/graalvm/compiler/hotspot/jdk17/test/CheckIndexLongTest.java rename to compiler/src/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CheckIndexLongTest.java index 88e3ee9e1de5..15f2a6f9ab7a 100644 --- a/compiler/src/org.graalvm.compiler.hotspot.jdk17.test/src/org/graalvm/compiler/hotspot/jdk17/test/CheckIndexLongTest.java +++ b/compiler/src/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CheckIndexLongTest.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package org.graalvm.compiler.hotspot.jdk17.test; +package org.graalvm.compiler.hotspot.test; import java.nio.ByteBuffer; import java.nio.ByteOrder; diff --git a/compiler/src/org.graalvm.compiler.hotspot.jdk17.test/src/org/graalvm/compiler/hotspot/jdk17/test/ClassReplacementsTest.java b/compiler/src/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ClassReplacementsTest.java similarity index 97% rename from compiler/src/org.graalvm.compiler.hotspot.jdk17.test/src/org/graalvm/compiler/hotspot/jdk17/test/ClassReplacementsTest.java rename to compiler/src/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ClassReplacementsTest.java index f6c1cb3cf209..99c31154bc51 100644 --- a/compiler/src/org.graalvm.compiler.hotspot.jdk17.test/src/org/graalvm/compiler/hotspot/jdk17/test/ClassReplacementsTest.java +++ b/compiler/src/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ClassReplacementsTest.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package org.graalvm.compiler.hotspot.jdk17.test; +package org.graalvm.compiler.hotspot.test; import org.graalvm.compiler.replacements.test.MethodSubstitutionTest; import org.junit.Test; diff --git a/compiler/src/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ClassSubstitutionsTests.java b/compiler/src/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ClassSubstitutionsTests.java index 4ab136874f9e..8d07394262ae 100644 --- a/compiler/src/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ClassSubstitutionsTests.java +++ b/compiler/src/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ClassSubstitutionsTests.java @@ -25,14 +25,11 @@ package org.graalvm.compiler.hotspot.test; -import static org.junit.Assume.assumeTrue; - import java.lang.reflect.Field; import org.graalvm.compiler.core.test.GraalCompilerTest; import org.graalvm.compiler.debug.DebugContext; import org.graalvm.compiler.graph.Node; -import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig; import org.graalvm.compiler.nodes.ConstantNode; import org.graalvm.compiler.nodes.Invoke; import org.graalvm.compiler.nodes.ParameterNode; @@ -150,7 +147,6 @@ static void init() { @Test public void testUnsafeFoldComponentType() { - assumeTrue(GraalHotSpotVMConfig.jvmciGE(GraalHotSpotVMConfig.JVMCI_20_3_b04)); runTest = new Runnable() { @Override public void run() { diff --git a/compiler/src/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotMethodSubstitutionTest.java b/compiler/src/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotMethodSubstitutionTest.java index 08b16eee61ec..889f8e3cafa9 100644 --- a/compiler/src/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotMethodSubstitutionTest.java +++ b/compiler/src/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotMethodSubstitutionTest.java @@ -31,7 +31,6 @@ import org.graalvm.compiler.api.directives.GraalDirectives; import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig; import org.graalvm.compiler.hotspot.HotSpotBackend; -import org.graalvm.compiler.nodes.IfNode; import org.graalvm.compiler.replacements.test.MethodSubstitutionTest; import org.junit.Test; @@ -135,16 +134,9 @@ public static Class getComponentType(Class clazz) { public void testThreadSubstitutions() { GraalHotSpotVMConfig config = ((HotSpotBackend) getBackend()).getRuntime().getVMConfig(); testGraph("currentThread"); - if (config.osThreadInterruptedOffset != Integer.MAX_VALUE) { - assertInGraph(testGraph("threadIsInterrupted", "isInterrupted", true), IfNode.class); - assertInGraph(testGraph("threadInterrupted", "isInterrupted", true), IfNode.class); - } Thread currentThread = Thread.currentThread(); test("currentThread", currentThread); - if (config.osThreadInterruptedOffset != Integer.MAX_VALUE) { - test("threadIsInterrupted", currentThread); - } } @SuppressWarnings("all") diff --git a/compiler/src/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/JVMCIVersionCheckTest.java b/compiler/src/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/JVMCIVersionCheckTest.java index 5e2d19a51439..aba76cdebdbf 100644 --- a/compiler/src/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/JVMCIVersionCheckTest.java +++ b/compiler/src/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/JVMCIVersionCheckTest.java @@ -64,13 +64,13 @@ public void test01() { String javaVmVersion = String.format("prefix-jvmci-%s-suffix", version); if (!version.isLessThan(minVersion)) { try { - JVMCIVersionCheck.check(props, minVersion, "11", javaVmVersion, false); + JVMCIVersionCheck.check(props, minVersion, "17", javaVmVersion, false); } catch (InternalError e) { throw new AssertionError("Failed " + JVMCIVersionCheckTest.class.getSimpleName() + " with -Dtest.seed=" + seed, e); } } else { try { - JVMCIVersionCheck.check(props, minVersion, "11", javaVmVersion, false); + JVMCIVersionCheck.check(props, minVersion, "17", javaVmVersion, false); Assert.fail("expected to fail checking " + javaVmVersion + " against " + minVersion + " (-Dtest.seed=" + seed + ")"); } catch (InternalError e) { // pass diff --git a/compiler/src/org.graalvm.compiler.hotspot.jdk17.test/src/org/graalvm/compiler/hotspot/jdk17/test/ReferenceTest.java b/compiler/src/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ReferenceTest.java similarity index 98% rename from compiler/src/org.graalvm.compiler.hotspot.jdk17.test/src/org/graalvm/compiler/hotspot/jdk17/test/ReferenceTest.java rename to compiler/src/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ReferenceTest.java index 1ba625ce4b66..9a33ec1b1a51 100644 --- a/compiler/src/org.graalvm.compiler.hotspot.jdk17.test/src/org/graalvm/compiler/hotspot/jdk17/test/ReferenceTest.java +++ b/compiler/src/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ReferenceTest.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package org.graalvm.compiler.hotspot.jdk17.test; +package org.graalvm.compiler.hotspot.test; import java.lang.ref.PhantomReference; import java.lang.ref.ReferenceQueue; diff --git a/compiler/src/org.graalvm.compiler.hotspot.jdk17.test/src/org/graalvm/compiler/hotspot/jdk17/test/UnsafeWritebackMemoryTest.java b/compiler/src/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/UnsafeWritebackMemoryTest.java similarity index 97% rename from compiler/src/org.graalvm.compiler.hotspot.jdk17.test/src/org/graalvm/compiler/hotspot/jdk17/test/UnsafeWritebackMemoryTest.java rename to compiler/src/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/UnsafeWritebackMemoryTest.java index dcca0256bb93..9181dccea7db 100644 --- a/compiler/src/org.graalvm.compiler.hotspot.jdk17.test/src/org/graalvm/compiler/hotspot/jdk17/test/UnsafeWritebackMemoryTest.java +++ b/compiler/src/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/UnsafeWritebackMemoryTest.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package org.graalvm.compiler.hotspot.jdk17.test; +package org.graalvm.compiler.hotspot.test; import org.graalvm.compiler.replacements.test.MethodSubstitutionTest; import org.graalvm.compiler.test.AddExports; diff --git a/compiler/src/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/WriteBarrierAdditionTest.java b/compiler/src/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/WriteBarrierAdditionTest.java index a7d86cc240c4..c1dc7d8ca37d 100644 --- a/compiler/src/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/WriteBarrierAdditionTest.java +++ b/compiler/src/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/WriteBarrierAdditionTest.java @@ -82,7 +82,7 @@ public class WriteBarrierAdditionTest extends HotSpotGraalCompilerTest { * The set of GCs known at the time of writing of this test. The number of expected barrier * might need to be adjusted for new GCs implementations. */ - private static EnumSet knownSupport = EnumSet.of(HotSpotGC.G1, HotSpotGC.CMS, HotSpotGC.Parallel, HotSpotGC.Serial); + private static EnumSet knownSupport = EnumSet.of(HotSpotGC.G1, HotSpotGC.Parallel, HotSpotGC.Serial); private final GraalHotSpotVMConfig config = runtime().getVMConfig(); diff --git a/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java b/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java index fffd0902472b..cfc3a91d60b1 100644 --- a/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java +++ b/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java @@ -70,7 +70,7 @@ public class GraalHotSpotVMConfig extends GraalHotSpotVMConfigAccess { private final CompressEncoding oopEncoding; private final CompressEncoding klassEncoding; - private final String markWord = JDK < 14 ? "markOop" : "markWord"; // JDK-8229258 + private final String markWord = "markWord"; // JDK-8229258 public CompressEncoding getOopEncoding() { return oopEncoding; @@ -80,10 +80,6 @@ public CompressEncoding getKlassEncoding() { return klassEncoding; } - private final boolean gr21761 = (JVMCI ? jvmciGE(JVMCI_20_0_b03) : JDK >= 15); - - private final boolean jdk13Backport = JVMCI ? jvmciGE(JVMCI_19_3_b03) : JDK >= 13; - public final boolean cAssertions = getConstant("ASSERT", Boolean.class); public final int codeEntryAlignment = getFlag("CodeEntryAlignment", Integer.class); @@ -93,7 +89,6 @@ public CompressEncoding getKlassEncoding() { public final int hugeMethodLimit = getFlag("HugeMethodLimit", Integer.class); public final boolean printInlining = getFlag("PrintInlining", Boolean.class); public final boolean inline = getFlag("Inline", Boolean.class); - public final boolean inlineNotify = true; public final boolean useFastLocking = getFlag("JVMCIUseFastLocking", Boolean.class); public final boolean forceUnreachable = getFlag("ForceUnreachable", Boolean.class); public final boolean foldStableValues = getFlag("FoldStableValues", Boolean.class); @@ -110,17 +105,6 @@ public CompressEncoding getKlassEncoding() { public final boolean useAESCTRIntrinsics = getFlag("UseAESCTRIntrinsics", Boolean.class); public final boolean useCRC32Intrinsics = getFlag("UseCRC32Intrinsics", Boolean.class); public final boolean useCRC32CIntrinsics = getFlag("UseCRC32CIntrinsics", Boolean.class); // JDK-8073583 - public final boolean useThreadLocalPolling; - { - if (JDK >= 14) { - // JDK-8220049, JDK-8220051 - useThreadLocalPolling = true; - } else if (JDK >= 10) { - useThreadLocalPolling = getFlag("ThreadLocalHandshakes", Boolean.class); - } else { - useThreadLocalPolling = false; - } - } private final boolean useMultiplyToLenIntrinsic = getFlag("UseMultiplyToLenIntrinsic", Boolean.class); private final boolean useSHA1Intrinsics = getFlag("UseSHA1Intrinsics", Boolean.class); private final boolean useSHA256Intrinsics = getFlag("UseSHA256Intrinsics", Boolean.class); @@ -132,15 +116,15 @@ public CompressEncoding getKlassEncoding() { private final boolean useSquareToLenIntrinsic = getFlag("UseSquareToLenIntrinsic", Boolean.class); public final boolean useVectorizedMismatchIntrinsic = getFlag("UseVectorizedMismatchIntrinsic", Boolean.class); public final boolean useFMAIntrinsics = getFlag("UseFMA", Boolean.class); - public final int useAVX3Threshold = getFlag("AVX3Threshold", Integer.class, 4096, osArch.equals("amd64") && (JDK >= 14 || (JDK == 11 && JDK_UPDATE >= 6))); + public final int useAVX3Threshold = getFlag("AVX3Threshold", Integer.class, 4096, osArch.equals("amd64")); public final boolean preserveFramePointer = getFlag("PreserveFramePointer", Boolean.class); - public final int diagnoseSyncOnValueBasedClasses = getFlag("DiagnoseSyncOnValueBasedClasses", Integer.class, 0, JDK >= 16); + public final int diagnoseSyncOnValueBasedClasses = getFlag("DiagnoseSyncOnValueBasedClasses", Integer.class); /* * These are methods because in some JDKs the flags are visible but the stubs themselves haven't - * been exported so we have to check both if the flag is on and if we have the stub. + * been exported, so we have to check both if the flag is on and if we have the stub. */ public boolean useMultiplyToLenIntrinsic() { return useMultiplyToLenIntrinsic && multiplyToLen != 0; @@ -179,11 +163,11 @@ public boolean useSquareToLenIntrinsic() { } public boolean inlineNotify() { - return inlineNotify && notifyAddress != 0; + return notifyAddress != 0; } public boolean inlineNotifyAll() { - return inlineNotify && notifyAllAddress != 0; + return notifyAllAddress != 0; } public boolean useCRC32Intrinsics() { @@ -203,7 +187,6 @@ public boolean useVectorizedMismatchIntrinsic() { } public final boolean useG1GC = getFlag("UseG1GC", Boolean.class); - public final boolean useCMSGC = getFlag("UseConcMarkSweepGC", Boolean.class, false, JDK < 14); // JDK-8231559 public final int allocatePrefetchStyle = getFlag("AllocatePrefetchStyle", Integer.class); public final int allocatePrefetchInstr = getFlag("AllocatePrefetchInstr", Integer.class); @@ -239,8 +222,6 @@ public final int logMinObjAlignment() { public final int logKlassAlignment = getConstant("LogKlassAlignmentInBytes", Integer.class); public final int stackShadowPages = getFlag("StackShadowPages", Integer.class); - public final boolean useStackBanging = getFlag("UseStackBanging", Boolean.class, true, JDK < 17); - public final int stackBias = getConstant("STACK_BIAS", Integer.class, 0, JDK < 15); public final int vmPageSize = getFieldValue("CompilerToVM::Data::vm_page_size", Integer.class, "int"); public final int markOffset = getFieldOffset("oopDesc::_mark", Integer.class, markWord); @@ -251,13 +232,8 @@ public final int logMinObjAlignment() { public final int secondarySuperCacheOffset = getFieldOffset("Klass::_secondary_super_cache", Integer.class, "Klass*"); public final int secondarySupersOffset = getFieldOffset("Klass::_secondary_supers", Integer.class, "Array*"); - public final boolean classMirrorIsHandle; - public final int classMirrorOffset; - { - // JDK-8186777 - classMirrorIsHandle = true; - classMirrorOffset = getFieldOffset("Klass::_java_mirror", Integer.class, "OopHandle"); - } + // JDK-8186777 + public final int classMirrorOffset = getFieldOffset("Klass::_java_mirror", Integer.class, "OopHandle"); public final int klassSuperKlassOffset = getFieldOffset("Klass::_super", Integer.class, "Klass*"); public final int klassModifierFlagsOffset = getFieldOffset("Klass::_modifier_flags", Integer.class, "jint"); @@ -271,9 +247,9 @@ public final int logMinObjAlignment() { public final int layoutHelperHeaderSizeMask = getConstant("Klass::_lh_header_size_mask", Integer.class); public final int instanceKlassInitStateOffset = getFieldOffset("InstanceKlass::_init_state", Integer.class, JDK >= 20 ? "InstanceKlass::ClassState" : "u1"); - public final int instanceKlassInitThreadOffset = getFieldOffset("InstanceKlass::_init_thread", Integer.class, "Thread*", -1, JDK >= 15 || (JVMCI && jvmciGE(JVMCI_20_0_b03))); + public final int instanceKlassInitThreadOffset = getFieldOffset("InstanceKlass::_init_thread", Integer.class, "Thread*"); - public final int instanceKlassStateBeingInitialized = getConstant("InstanceKlass::being_initialized", Integer.class, -1, (JVMCI ? jvmciGE(JVMCI_20_0_b03) : JDK >= 14)); + public final int instanceKlassStateBeingInitialized = getConstant("InstanceKlass::being_initialized", Integer.class); public final int instanceKlassStateFullyInitialized = getConstant("InstanceKlass::fully_initialized", Integer.class); public final int arrayOopDescSize = getFieldValue("CompilerToVM::Data::sizeof_arrayOopDesc", Integer.class, "int"); @@ -294,7 +270,7 @@ public final int arrayOopDescLengthOffset() { public final int jvmAccHasFinalizer = getConstant("JVM_ACC_HAS_FINALIZER", Integer.class); public final int jvmAccWrittenFlags = getConstant("JVM_ACC_WRITTEN_FLAGS", Integer.class); - public final int jvmAccIsHiddenClass = getConstant("JVM_ACC_IS_HIDDEN_CLASS", Integer.class, 0, JDK >= 15); // JDK-8219607 + public final int jvmAccIsHiddenClass = getConstant("JVM_ACC_IS_HIDDEN_CLASS", Integer.class); // JDK-8219607 public final int jvmAccIsValueBasedClass = verifyConstant("JVM_ACC_IS_VALUE_BASED_CLASS", Integer.class, 0x08000000); public final int jvmciCompileStateCanPostOnExceptionsOffset = getJvmciJvmtiCapabilityOffset("_jvmti_can_post_on_exceptions"); @@ -317,22 +293,16 @@ private int getJvmciJvmtiCapabilityOffset(String name) { public final int threadTlabOffset = getFieldOffset("Thread::_tlab", Integer.class, "ThreadLocalAllocBuffer"); public final int javaThreadAnchorOffset = getFieldOffset("JavaThread::_anchor", Integer.class, "JavaFrameAnchor"); - public final int javaThreadShouldPostOnExceptionsFlagOffset = getFieldOffset("JavaThread::_should_post_on_exceptions_flag", Integer.class, "int", Integer.MIN_VALUE, JVMCI || JDK >= 12); + public final int javaThreadShouldPostOnExceptionsFlagOffset = getFieldOffset("JavaThread::_should_post_on_exceptions_flag", Integer.class, "int"); - public final boolean threadObjectFieldIsHandle; /** * The offset of the {@code JavaThread} field containing the reference to the current thread. */ public final int threadCurrentThreadObjectOffset; { - if (JDK <= 15) { - threadObjectFieldIsHandle = false; - threadCurrentThreadObjectOffset = getFieldOffset("JavaThread::_threadObj", Integer.class, "oop"); - } else if (JDK < 19) { - threadObjectFieldIsHandle = true; + if (JDK < 19) { threadCurrentThreadObjectOffset = getFieldOffset("JavaThread::_threadObj", Integer.class, "OopHandle"); } else { - threadObjectFieldIsHandle = true; /* * With virtual threads, the value returned by Thread.currentThread() is the new * _vthread field. The _threadObj field is still present but refers to the carrier @@ -345,30 +315,27 @@ private int getJvmciJvmtiCapabilityOffset(String name) { public final int osThreadOffset = getFieldOffset("JavaThread::_osthread", Integer.class, "OSThread*"); public final int threadObjectResultOffset = getFieldOffset("JavaThread::_vm_result", Integer.class, "oop"); public final int jvmciCountersThreadOffset = getFieldOffset("JavaThread::_jvmci_counters", Integer.class, "jlong*"); + public final int jvmciReserved0Offset; { int offset; try { - offset = getFieldOffset("JavaThread::_jvmci_reserved0", Integer.class, "jlong", -1, hasJVMCIReservedFields()); + offset = getFieldOffset("JavaThread::_jvmci_reserved0", Integer.class, "jlong"); } catch (jdk.vm.ci.common.JVMCIError t) { // at some point the field was migrated to jlong - offset = getFieldOffset("JavaThread::_jvmci_reserved0", Integer.class, "intptr_t*", -1, hasJVMCIReservedFields()); + offset = getFieldOffset("JavaThread::_jvmci_reserved0", Integer.class, "intptr_t*"); } jvmciReserved0Offset = offset; } - public final int jvmciReservedReference0Offset = getFieldOffset("JavaThread::_jvmci_reserved_oop0", Integer.class, "oop", -1, hasJVMCIReservedFields()); + public final int jvmciReservedReference0Offset = getFieldOffset("JavaThread::_jvmci_reserved_oop0", Integer.class, "oop"); - private static boolean hasJVMCIReservedFields() { - return JVMCI ? jvmciGE(JVMCI_21_1_b02) : JDK >= 17 || (IS_OPENJDK && JDK == 11 && JDK_UPDATE >= 13); - } - - public final int doingUnsafeAccessOffset = getFieldOffset("JavaThread::_doing_unsafe_access", Integer.class, "bool", Integer.MAX_VALUE, JVMCI || JDK >= 14); + public final int doingUnsafeAccessOffset = getFieldOffset("JavaThread::_doing_unsafe_access", Integer.class, "bool"); // @formatter:off public final int javaThreadReservedStackActivationOffset = JDK <= 15 ? getFieldOffset("JavaThread::_reserved_stack_activation", Integer.class, "address"): // JDK-8046936 getFieldOffset("JavaThread::_stack_overflow_state._reserved_stack_activation", Integer.class, "address"); // JDK-8253717 // @formatter:on - public final int jniEnvironmentOffset = getFieldOffset("JavaThread::_jni_environment", Integer.class, "JNIEnv", Integer.MIN_VALUE, JVMCI || JDK >= 14); + public final int jniEnvironmentOffset = getFieldOffset("JavaThread::_jni_environment", Integer.class, "JNIEnv"); public boolean requiresReservedStackCheck(List methods) { if (enableStackReservedZoneAddress != 0 && methods != null) { @@ -429,22 +396,20 @@ public int threadLastJavaFpOffset() { public final int frameInterpreterFrameSenderSpOffset = getConstant("frame::interpreter_frame_sender_sp_offset", Integer.class, 0, osArch.equals("amd64")); public final int frameInterpreterFrameLastSpOffset = getConstant("frame::interpreter_frame_last_sp_offset", Integer.class, 0, osArch.equals("amd64")); - public final int osThreadInterruptedOffset = getFieldOffset("OSThread::_interrupted", Integer.class, "jint", Integer.MAX_VALUE, JDK < 14); - public final int biasedLockMaskInPlace = getConstant(markWordField("biased_lock_mask_in_place"), Integer.class, -1, JDK < 18); public final int ageMaskInPlace = getConstant(markWordField("age_mask_in_place"), Integer.class); public final int epochMaskInPlace = getConstant(markWordField("epoch_mask_in_place"), Integer.class, -1, JDK < 18); public final int unlockedMask = getConstant(markWordField("unlocked_value"), Integer.class); - public final int monitorMask = getConstant(markWordField("monitor_value"), Integer.class, -1, gr21761); + public final int monitorMask = getConstant(markWordField("monitor_value"), Integer.class); public final int biasedLockPattern = getConstant(markWordField("biased_lock_pattern"), Integer.class, -1, JDK < 18); // This field has no type in vmStructs.cpp - public final int objectMonitorOwner = getFieldOffset("ObjectMonitor::_owner", Integer.class, null, -1, gr21761); - public final int objectMonitorRecursions = getFieldOffset("ObjectMonitor::_recursions", Integer.class, "intptr_t", -1, gr21761); - public final int objectMonitorCxq = getFieldOffset("ObjectMonitor::_cxq", Integer.class, "ObjectWaiter*", -1, jdk13Backport); - public final int objectMonitorEntryList = getFieldOffset("ObjectMonitor::_EntryList", Integer.class, "ObjectWaiter*", -1, jdk13Backport); - public final int objectMonitorSucc = getFieldOffset("ObjectMonitor::_succ", Integer.class, JDK < 17 ? "Thread*" : "JavaThread*", -1, jdk13Backport); + public final int objectMonitorOwner = getFieldOffset("ObjectMonitor::_owner", Integer.class, null); + public final int objectMonitorRecursions = getFieldOffset("ObjectMonitor::_recursions", Integer.class, "intptr_t"); + public final int objectMonitorCxq = getFieldOffset("ObjectMonitor::_cxq", Integer.class, "ObjectWaiter*"); + public final int objectMonitorEntryList = getFieldOffset("ObjectMonitor::_EntryList", Integer.class, "ObjectWaiter*"); + public final int objectMonitorSucc = getFieldOffset("ObjectMonitor::_succ", Integer.class, "JavaThread*"); public final int markWordNoHashInPlace = getConstant(markWordField("no_hash_in_place"), Integer.class); public final int markWordNoLockInPlace = getConstant(markWordField("no_lock_in_place"), Integer.class); @@ -507,8 +472,6 @@ private static String markWordField(String simpleName) { */ public final int maxOopMapStackOffset = getFieldValue("CompilerToVM::Data::_max_oop_map_stack_offset", Integer.class, "int"); - public final long safepointPollingAddress = getFieldValue("os::_polling_page", Long.class, "address"); - // G1 Collector Related Values. public final byte dirtyCardValue; public final byte g1YoungCardValue; @@ -533,20 +496,9 @@ private static String markWordField(String simpleName) { public final int basicLockSize = getFieldValue("CompilerToVM::Data::sizeof_BasicLock", Integer.class, "int"); public final int basicLockDisplacedHeaderOffset = getFieldOffset("BasicLock::_displaced_header", Integer.class, markWord); - public final int threadPollingPageOffset; - { - // JDK-8237497 - if (JDK < 15) { - threadPollingPageOffset = getFieldOffset("Thread::_polling_page", Integer.class, "address"); - } else if (JDK < 16) { - threadPollingPageOffset = getFieldOffset("Thread::_polling_page", Integer.class, "volatile void*"); - } else { - // JDK-8253180 & JDK-8265932 - String name = JDK == 16 ? "Thread::_poll_data" : "JavaThread::_poll_data"; - threadPollingPageOffset = getFieldOffset(name, Integer.class, "SafepointMechanism::ThreadData") + - getFieldOffset("SafepointMechanism::ThreadData::_polling_page", Integer.class, "volatile uintptr_t"); - } - } + // JDK-8253180 & JDK-8265932 + public final int threadPollingPageOffset = getFieldOffset("JavaThread::_poll_data", Integer.class, "SafepointMechanism::ThreadData") + + getFieldOffset("SafepointMechanism::ThreadData::_polling_page", Integer.class, "volatile uintptr_t"); private final int threadLocalAllocBufferEndOffset = getFieldOffset("ThreadLocalAllocBuffer::_end", Integer.class, "HeapWord*"); private final int threadLocalAllocBufferTopOffset = getFieldOffset("ThreadLocalAllocBuffer::_top", Integer.class, "HeapWord*"); @@ -569,8 +521,7 @@ public int threadTlabTopOffset() { public final long handleWrongMethodStub = getFieldValue("CompilerToVM::Data::SharedRuntime_handle_wrong_method_stub", Long.class, "address"); public final long deoptBlobUnpack = getFieldValue("CompilerToVM::Data::SharedRuntime_deopt_blob_unpack", Long.class, "address"); - public final long deoptBlobUnpackWithExceptionInTLS = getFieldValue("CompilerToVM::Data::SharedRuntime_deopt_blob_unpack_with_exception_in_tls", Long.class, "address", 0L, - JVMCI ? jvmciGE(JVMCI_19_3_b07) : JDK >= 14); + public final long deoptBlobUnpackWithExceptionInTLS = getFieldValue("CompilerToVM::Data::SharedRuntime_deopt_blob_unpack_with_exception_in_tls", Long.class, "address"); public final long deoptBlobUncommonTrap = getFieldValue("CompilerToVM::Data::SharedRuntime_deopt_blob_uncommon_trap", Long.class, "address"); public final long codeCacheLowBound = getFieldValue("CodeCache::_low_bound", Long.class, "address"); @@ -583,23 +534,23 @@ public int threadTlabTopOffset() { public final long updateBytesCRC32Stub = getFieldValue("StubRoutines::_updateBytesCRC32", Long.class, "address"); public final long crcTableAddress = getFieldValue("StubRoutines::_crc_table_adr", Long.class, "address"); - public final long md5ImplCompress = getFieldValue("StubRoutines::_md5_implCompress", Long.class, "address", 0L, JVMCI ? jvmciGE(JVMCI_22_1_b01) && JDK >= 17 : JDK >= 19); - public final long md5ImplCompressMultiBlock = getFieldValue("StubRoutines::_md5_implCompressMB", Long.class, "address", 0L, JVMCI ? jvmciGE(JVMCI_22_1_b01) && JDK >= 17 : JDK >= 19); + public final long md5ImplCompress = getFieldValue("StubRoutines::_md5_implCompress", Long.class, "address", 0L, JVMCI ? JDK >= 17 : JDK >= 19); + public final long md5ImplCompressMultiBlock = getFieldValue("StubRoutines::_md5_implCompressMB", Long.class, "address", 0L, JVMCI ? JDK >= 17 : JDK >= 19); public final long sha1ImplCompress = getFieldValue("StubRoutines::_sha1_implCompress", Long.class, "address"); public final long sha1ImplCompressMultiBlock = getFieldValue("StubRoutines::_sha1_implCompressMB", Long.class, "address"); public final long sha256ImplCompress = getFieldValue("StubRoutines::_sha256_implCompress", Long.class, "address"); public final long sha256ImplCompressMultiBlock = getFieldValue("StubRoutines::_sha256_implCompressMB", Long.class, "address"); public final long sha512ImplCompress = getFieldValue("StubRoutines::_sha512_implCompress", Long.class, "address"); public final long sha512ImplCompressMultiBlock = getFieldValue("StubRoutines::_sha512_implCompressMB", Long.class, "address"); - public final long sha3ImplCompress = getFieldValue("StubRoutines::_sha3_implCompress", Long.class, "address", 0L, JVMCI ? jvmciGE(JVMCI_22_1_b01) && JDK >= 17 : JDK >= 19); - public final long sha3ImplCompressMultiBlock = getFieldValue("StubRoutines::_sha3_implCompressMB", Long.class, "address", 0L, JVMCI ? jvmciGE(JVMCI_22_1_b01) && JDK >= 17 : JDK >= 19); + public final long sha3ImplCompress = getFieldValue("StubRoutines::_sha3_implCompress", Long.class, "address", 0L, JVMCI ? JDK >= 17 : JDK >= 19); + public final long sha3ImplCompressMultiBlock = getFieldValue("StubRoutines::_sha3_implCompressMB", Long.class, "address", 0L, JVMCI ? JDK >= 17 : JDK >= 19); public final long multiplyToLen = getFieldValue("StubRoutines::_multiplyToLen", Long.class, "address"); public final long counterModeAESCrypt = getFieldValue("StubRoutines::_counterMode_AESCrypt", Long.class, "address"); public final long ghashProcessBlocks = getFieldValue("StubRoutines::_ghash_processBlocks", Long.class, "address"); public final long base64EncodeBlock = getFieldValue("StubRoutines::_base64_encodeBlock", Long.class, "address"); - public final long base64DecodeBlock = getFieldValue("StubRoutines::_base64_decodeBlock", Long.class, "address", 0L, JDK >= 16); + public final long base64DecodeBlock = getFieldValue("StubRoutines::_base64_decodeBlock", Long.class, "address"); public static final boolean base64DecodeBlockHasIsMIMEParameter() { try { @@ -607,8 +558,6 @@ public static final boolean base64DecodeBlockHasIsMIMEParameter() { return true; } catch (NoSuchMethodException e) { return false; - } catch (SecurityException e) { - throw new AssertionError(e); } } @@ -621,8 +570,8 @@ public static final boolean base64DecodeBlockHasIsMIMEParameter() { public final long montgomerySquare = getFieldValue("StubRoutines::_montgomerySquare", Long.class, "address"); public final long vectorizedMismatch = getFieldValue("StubRoutines::_vectorizedMismatch", Long.class, "address"); - public final long bigIntegerLeftShiftWorker = getFieldValue("StubRoutines::_bigIntegerLeftShiftWorker", Long.class, "address", 0L, JDK >= 14); - public final long bigIntegerRightShiftWorker = getFieldValue("StubRoutines::_bigIntegerRightShiftWorker", Long.class, "address", 0L, JDK >= 14); + public final long bigIntegerLeftShiftWorker = getFieldValue("StubRoutines::_bigIntegerLeftShiftWorker", Long.class, "address"); + public final long bigIntegerRightShiftWorker = getFieldValue("StubRoutines::_bigIntegerRightShiftWorker", Long.class, "address"); public final long electronicCodeBookEncrypt = getFieldValue("StubRoutines::_electronicCodeBook_encryptAESCrypt", Long.class, "address"); public final long electronicCodeBookDecrypt = getFieldValue("StubRoutines::_electronicCodeBook_decryptAESCrypt", Long.class, "address"); @@ -668,13 +617,12 @@ public static final boolean base64DecodeBlockHasIsMIMEParameter() { public final long dynamicNewInstanceAddress = getAddress("JVMCIRuntime::dynamic_new_instance"); // Allocation stubs that return null when allocation fails - public final long newInstanceOrNullAddress = getAddress("JVMCIRuntime::new_instance_or_null", 0L, JVMCI || JDK >= 12 || (!IS_OPENJDK && JDK == 11 && JDK_UPDATE >= 7)); - public final long newArrayOrNullAddress = getAddress("JVMCIRuntime::new_array_or_null", 0L, JVMCI || JDK >= 12 || (!IS_OPENJDK && JDK == 11 && JDK_UPDATE >= 7)); - public final long newMultiArrayOrNullAddress = getAddress("JVMCIRuntime::new_multi_array_or_null", 0L, JVMCI || JDK >= 12 || (!IS_OPENJDK && JDK == 11 && JDK_UPDATE >= 7)); - public final long dynamicNewInstanceOrNullAddress = getAddress("JVMCIRuntime::dynamic_new_instance_or_null", 0L, JVMCI || JDK >= 12 || (!IS_OPENJDK && JDK == 11 && JDK_UPDATE >= 7)); + public final long newInstanceOrNullAddress = getAddress("JVMCIRuntime::new_instance_or_null"); + public final long newArrayOrNullAddress = getAddress("JVMCIRuntime::new_array_or_null"); + public final long newMultiArrayOrNullAddress = getAddress("JVMCIRuntime::new_multi_array_or_null"); + public final long dynamicNewInstanceOrNullAddress = getAddress("JVMCIRuntime::dynamic_new_instance_or_null"); - public final long invokeJavaMethodAddress = getAddress("JVMCIRuntime::invoke_static_method_one_arg", 0L, - JVMCI ? jvmciGE(JVMCI_21_1_b02) : (JDK >= 17 || (IS_OPENJDK && JDK == 11 && JDK_UPDATE >= 13))); + public final long invokeJavaMethodAddress = getAddress("JVMCIRuntime::invoke_static_method_one_arg"); public boolean areNullAllocationStubsAvailable() { return newInstanceOrNullAddress != 0L; @@ -765,61 +713,28 @@ private boolean checkNullAllocationStubs() { // JDK-8231756, GR-16685 public final boolean deoptimizationSupportLargeAccessByteArrayVirtualization = // - getConstant("Deoptimization::_support_large_access_byte_array_virtualization", Boolean.class, false, JVMCI || JDK >= 15); - - private static final boolean JDK_8245443 = ((JDK == 11 && JDK_UPDATE >= 8) || JDK >= 15); + getConstant("Deoptimization::_support_large_access_byte_array_virtualization", Boolean.class); // Checkstyle: stop - public final int VMINTRINSIC_FIRST_MH_SIG_POLY = getConstant("vmIntrinsics::FIRST_MH_SIG_POLY", Integer.class, -1, (JVMCI ? jvmciGE(JVMCI_20_2_b01) : JDK >= 16)); - public final int VMINTRINSIC_LAST_MH_SIG_POLY = getConstant("vmIntrinsics::LAST_MH_SIG_POLY", Integer.class, -1, (JVMCI ? jvmciGE(JVMCI_20_2_b01) : JDK >= 16)); - public final int VMINTRINSIC_INVOKE_GENERIC = getConstant("vmIntrinsics::_invokeGeneric", Integer.class, -1, (JVMCI ? jvmciGE(JVMCI_20_2_b01) : JDK >= 16)); - public final int VMINTRINSIC_COMPILED_LAMBDA_FORM = getConstant("vmIntrinsics::_compiledLambdaForm", Integer.class, -1, (JVMCI ? jvmciGE(JVMCI_20_2_b01) : JDK >= 16)); + public final int VMINTRINSIC_FIRST_MH_SIG_POLY = getConstant("vmIntrinsics::FIRST_MH_SIG_POLY", Integer.class); + public final int VMINTRINSIC_LAST_MH_SIG_POLY = getConstant("vmIntrinsics::LAST_MH_SIG_POLY", Integer.class); + public final int VMINTRINSIC_INVOKE_GENERIC = getConstant("vmIntrinsics::_invokeGeneric", Integer.class); + public final int VMINTRINSIC_COMPILED_LAMBDA_FORM = getConstant("vmIntrinsics::_compiledLambdaForm", Integer.class); public final boolean CPU_HAS_INTEL_JCC_ERRATUM = getFieldValue("VM_Version::_has_intel_jcc_erratum", Boolean.class, "bool", - true, "amd64".equals(osArch) && (JVMCI ? jvmciGE(JVMCI_20_1_b01) : JDK >= 15)); + true, "amd64".equals(osArch)); // Checkstyle: resume - private static void checkForMissingRequiredValue(HotSpotMarkId markId, boolean required) { - if (!markId.isAvailable() && required) { - GraalHotSpotVMConfigAccess.reportError("Unsupported Mark " + markId); - } - } - private void populateMarkConstants() { - boolean jdk13JvmciBackport = JVMCI ? jvmciGE(JVMCI_19_3_b03) : JDK > 9; - boolean verifyOopsMarkSupported = JDK >= 16; Map constants = getStore().getConstants(); for (HotSpotMarkId markId : HotSpotMarkId.values()) { - Integer value = null; String key = "CodeInstaller::" + markId.name(); Long result = constants.get(key); - if (result != null) { - value = result.intValue(); - } - markId.setValue(value); - switch (markId) { - case FRAME_COMPLETE: - checkForMissingRequiredValue(markId, JVMCI ? jvmciGE(JVMCI_20_1_b01) : JDK_8245443); - break; - case DEOPT_MH_HANDLER_ENTRY: - checkForMissingRequiredValue(markId, JVMCI ? jvmciGE(JVMCI_20_2_b01) : JDK >= 16); - break; - case NARROW_KLASS_BASE_ADDRESS: - case CRC_TABLE_ADDRESS: - case NARROW_OOP_BASE_ADDRESS: - case LOG_OF_HEAP_REGION_GRAIN_BYTES: - checkForMissingRequiredValue(markId, jdk13JvmciBackport); - break; - case VERIFY_OOPS: - case VERIFY_OOP_BITS: - case VERIFY_OOP_MASK: - case VERIFY_OOP_COUNT_ADDRESS: - checkForMissingRequiredValue(markId, verifyOopsMarkSupported); - break; - default: - checkForMissingRequiredValue(markId, true); + if (result == null) { + GraalHotSpotVMConfigAccess.reportError("Unsupported Mark " + markId); } + markId.setValue(result.intValue()); } } diff --git a/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfigAccess.java b/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfigAccess.java index 9791ea11ab0c..ac0a7b08fc8d 100644 --- a/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfigAccess.java +++ b/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfigAccess.java @@ -36,8 +36,6 @@ import org.graalvm.compiler.debug.Assertions; import org.graalvm.compiler.hotspot.JVMCIVersionCheck.Version; -import org.graalvm.compiler.serviceprovider.GraalServices; -import org.graalvm.compiler.serviceprovider.JavaVersionUtil; import jdk.vm.ci.common.JVMCIError; import jdk.vm.ci.hotspot.HotSpotVMConfigAccess; @@ -124,23 +122,13 @@ protected static String getProperty(String name) { public final String osArch; protected static final Version JVMCI_23_0_b04 = new Version(23, 0, 4); - protected static final Version JVMCI_22_1_b01 = new Version(22, 1, 1); - protected static final Version JVMCI_21_1_b02 = new Version(21, 1, 2); - public static final Version JVMCI_20_3_b04 = new Version(20, 3, 4); - protected static final Version JVMCI_20_2_b04 = new Version(20, 2, 4); - protected static final Version JVMCI_20_2_b01 = new Version(20, 2, 1); - protected static final Version JVMCI_20_1_b01 = new Version(20, 1, 1); - protected static final Version JVMCI_20_0_b03 = new Version(20, 0, 3); - protected static final Version JVMCI_19_3_b03 = new Version(19, 3, 3); - protected static final Version JVMCI_19_3_b04 = new Version(19, 3, 4); - protected static final Version JVMCI_19_3_b07 = new Version(19, 3, 7); public static boolean jvmciGE(Version v) { return JVMCI && !JVMCI_VERSION.isLessThan(v); } - public static final int JDK = JavaVersionUtil.JAVA_SPEC; - public static final int JDK_UPDATE = GraalServices.getJavaUpdateVersion(); + static final int JDK = Runtime.version().feature(); + static final int JDK_UPDATE = Runtime.version().update(); public static final boolean IS_OPENJDK = getProperty("java.vm.name", "").startsWith("OpenJDK"); public static final Version JVMCI_VERSION; public static final boolean JVMCI; diff --git a/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalRuntime.java b/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalRuntime.java index 762aa3340535..855a5d5f9e9b 100644 --- a/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalRuntime.java +++ b/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalRuntime.java @@ -27,7 +27,6 @@ import static jdk.vm.ci.common.InitTimer.timer; import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime; import static org.graalvm.compiler.core.common.GraalOptions.HotSpotPrintInlining; -import static org.graalvm.compiler.hotspot.GraalHotSpotVMConfigAccess.JDK; import java.io.PrintStream; import java.util.ArrayList; @@ -206,31 +205,20 @@ public GlobalMetrics getMetricValues() { */ public enum HotSpotGC { // Supported GCs - Serial(true, JDK >= 11, "UseSerialGC", true), - Parallel(true, JDK >= 11, "UseParallelGC", true, "UseParallelOldGC", JDK < 15, "UseParNewGC", JDK < 10), - CMS(true, JDK >= 11 && JDK <= 14, "UseConcMarkSweepGC", JDK < 14), - G1(true, JDK >= 11, "UseG1GC", true), + Serial(true, true, "UseSerialGC", true), + Parallel(true, true, "UseParallelGC", true), + G1(true, true, "UseG1GC", true), // Unsupported GCs - Epsilon(false, JDK >= 11, "UseEpsilonGC", JDK >= 11), - Z(false, JDK >= 11, "UseZGC", JDK >= 11), - Shenandoah(false, JDK >= 12, "UseShenandoahGC", JDK >= 12); - - HotSpotGC(boolean supported, boolean expectNamePresent, - String flag1, boolean expectFlagPresent1, - String flag2, boolean expectFlagPresent2, - String flag3, boolean expectFlagPresent3) { - this.supported = supported; - this.expectNamePresent = expectNamePresent; - this.expectFlagsPresent = new boolean[]{expectFlagPresent1, expectFlagPresent2, expectFlagPresent3}; - this.flags = new String[]{flag1, flag2, flag3}; - } + Epsilon(false, true, "UseEpsilonGC", true), + Z(false, true, "UseZGC", true), + Shenandoah(false, true, "UseShenandoahGC", true); HotSpotGC(boolean supported, boolean expectNamePresent, String flag, boolean expectFlagPresent) { this.supported = supported; this.expectNamePresent = expectNamePresent; - this.expectFlagsPresent = new boolean[]{expectFlagPresent}; - this.flags = new String[]{flag}; + this.expectFlagPresent = expectFlagPresent; + this.flag = flag; } /** @@ -245,28 +233,18 @@ public enum HotSpotGC { final boolean expectNamePresent; /** - * The VM flags that will select this GC. + * The VM flag that will select this GC. */ - private final String[] flags; + private final String flag; /** - * Specifies which {@link #flags} are expected to be present in the VM. + * Specifies if {@link #flag} is expected to be present in the VM. */ - final boolean[] expectFlagsPresent; + final boolean expectFlagPresent; public boolean isSelected(GraalHotSpotVMConfig config) { - boolean selected = false; - for (int i = 0; i < flags.length; i++) { - final boolean notPresent = false; - if (config.getFlag(flags[i], Boolean.class, notPresent, expectFlagsPresent[i])) { - selected = true; - if (!Assertions.assertionsEnabled()) { - // When asserting, check that isSelected works for all flag names - break; - } - } - } - return selected; + final boolean notPresent = false; + return config.getFlag(flag, Boolean.class, notPresent, expectFlagPresent); } /** diff --git a/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalServices.java b/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalServices.java index fb60f33d26fd..09239fa6df06 100644 --- a/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalServices.java +++ b/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalServices.java @@ -24,13 +24,12 @@ */ package org.graalvm.compiler.hotspot; -import static org.graalvm.compiler.debug.GraalError.shouldNotReachHere; - import java.lang.reflect.Constructor; import java.lang.reflect.Method; import java.util.Objects; import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; +import jdk.vm.ci.hotspot.HotSpotObjectConstantScope; import jdk.vm.ci.hotspot.HotSpotSpeculationLog; import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.SpeculationLog; @@ -88,16 +87,8 @@ public class HotSpotGraalServices { * this thread is currently in the global context */ public static CompilationContext enterGlobalCompilationContext() { - if (scopeEnterGlobalScope != null) { - try { - AutoCloseable impl = (AutoCloseable) scopeEnterGlobalScope.invoke(null); - return impl == null ? null : new CompilationContext(impl); - } catch (Throwable throwable) { - throw new InternalError(throwable); - } - } else { - return null; - } + HotSpotObjectConstantScope impl = HotSpotObjectConstantScope.enterGlobalScope(); + return impl == null ? null : new CompilationContext(impl); } /** @@ -109,16 +100,8 @@ public static CompilationContext enterGlobalCompilationContext() { * @return {@code null} if the current runtime does not support remote object references */ public static CompilationContext openLocalCompilationContext(Object description) { - if (scopeOpenLocalScope != null) { - try { - AutoCloseable impl = (AutoCloseable) scopeOpenLocalScope.invoke(null, Objects.requireNonNull(description)); - return impl == null ? null : new CompilationContext(impl); - } catch (Throwable throwable) { - throw new InternalError(throwable); - } - } else { - return null; - } + HotSpotObjectConstantScope impl = HotSpotObjectConstantScope.openLocalScope(Objects.requireNonNull(description)); + return impl == null ? null : new CompilationContext(impl); } /** @@ -129,25 +112,13 @@ public static CompilationContext openLocalCompilationContext(Object description) */ public static void exit(int status, HotSpotJVMCIRuntime runtime) { if (Services.IS_IN_NATIVE_IMAGE) { - try { - runtimeExitHotSpot.invoke(runtime, status); - } catch (Throwable throwable) { - throw new InternalError(throwable); - } + runtime.exitHotSpot(status); } else { System.exit(status); } } public static SpeculationLog newHotSpotSpeculationLog(long cachedFailedSpeculationsAddress) { - if (hotSpotSpeculationLogConstructor != null) { - try { - return hotSpotSpeculationLogConstructor.newInstance(cachedFailedSpeculationsAddress); - } catch (Throwable e) { - throw new InternalError(e); - } - } else { - throw shouldNotReachHere(); - } + return new HotSpotSpeculationLog(cachedFailedSpeculationsAddress); } } diff --git a/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotHostBackend.java b/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotHostBackend.java index bf4fbb8c0bc2..92a75f25142f 100644 --- a/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotHostBackend.java +++ b/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotHostBackend.java @@ -130,39 +130,35 @@ protected CallingConvention makeCallingConvention(StructuredGraph graph, Stub st } public void emitStackOverflowCheck(CompilationResultBuilder crb) { - if (config.useStackBanging) { - // Each code entry causes one stack bang n pages down the stack where n - // is configurable by StackShadowPages. The setting depends on the maximum - // depth of VM call stack or native before going back into java code, - // since only java code can raise a stack overflow exception using the - // stack banging mechanism. The VM and native code does not detect stack - // overflow. - // The code in JavaCalls::call() checks that there is at least n pages - // available, so all entry code needs to do is bang once for the end of - // this shadow zone. - // The entry code may need to bang additional pages if the framesize - // is greater than a page. - - int pageSize = config.vmPageSize; - int bangEnd = NumUtil.roundUp(config.stackShadowPages * 4 * K, pageSize); - - // This is how far the previous frame's stack banging extended. - int bangEndSafe = bangEnd; - - int frameSize = Math.max(crb.frameMap.frameSize(), crb.compilationResult.getMaxInterpreterFrameSize()); - if (frameSize > pageSize) { - bangEnd += frameSize; - } - - int bangOffset = bangEndSafe; - if (bangOffset <= bangEnd) { - crb.blockComment("[stack overflow check]"); - } - while (bangOffset <= bangEnd) { - // Need at least one stack bang at end of shadow zone. - bangStackWithOffset(crb, bangOffset); - bangOffset += pageSize; - } + /* + * Each code entry causes one stack bang n pages down the stack where n is configurable by + * StackShadowPages. The setting depends on the maximum depth of VM call stack or native + * before going back into java code, since only java code can raise a stack overflow + * exception using the stack banging mechanism. The VM and native code does not detect stack + * overflow. The code in JavaCalls::call() checks that there is at least n pages available, + * so all entry code needs to do is bang once for the end of this shadow zone. The entry + * code may need to bang additional pages if the framesize is greater than a page. + */ + + int pageSize = config.vmPageSize; + int bangEnd = NumUtil.roundUp(config.stackShadowPages * 4 * K, pageSize); + + // This is how far the previous frame's stack banging extended. + int bangEndSafe = bangEnd; + + int frameSize = Math.max(crb.frameMap.frameSize(), crb.compilationResult.getMaxInterpreterFrameSize()); + if (frameSize > pageSize) { + bangEnd += frameSize; + } + + int bangOffset = bangEndSafe; + if (bangOffset <= bangEnd) { + crb.blockComment("[stack overflow check]"); + } + while (bangOffset <= bangEnd) { + // Need at least one stack bang at end of shadow zone. + bangStackWithOffset(crb, bangOffset); + bangOffset += pageSize; } } diff --git a/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/IsGraalPredicate.java b/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/IsGraalPredicate.java index 48126547554d..74b95a026f6f 100644 --- a/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/IsGraalPredicate.java +++ b/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/IsGraalPredicate.java @@ -26,8 +26,6 @@ import static jdk.vm.ci.hotspot.HotSpotJVMCICompilerFactory.CompilationLevelAdjustment.None; -import java.lang.reflect.Method; - import org.graalvm.compiler.debug.GraalError; import jdk.vm.ci.hotspot.HotSpotJVMCICompilerFactory; @@ -60,50 +58,19 @@ class IsGraalPredicate extends IsGraalPredicateBase { graalModule = HotSpotGraalCompilerFactory.class.getModule(); } - // NOTE: The use of Methods to access JVMCI API is to support - // compiling on JDKs with varying versions of JVMCI. - - static final Method runtimeExcludeFromJVMCICompilation; - - static { - Method excludeFromJVMCICompilation = null; - try { - excludeFromJVMCICompilation = HotSpotJVMCIRuntime.class.getDeclaredMethod("excludeFromJVMCICompilation", Module[].class); - } catch (Exception e) { - // excludeFromJVMCICompilation not available - } - runtimeExcludeFromJVMCICompilation = excludeFromJVMCICompilation; - } - @Override void onCompilerConfigurationFactorySelection(HotSpotJVMCIRuntime runtime, CompilerConfigurationFactory factory) { compilerConfigurationModule = factory.getClass().getModule(); - if (runtimeExcludeFromJVMCICompilation != null) { - try { - Module[] modules = {jvmciModule, graalModule, compilerConfigurationModule}; - runtimeExcludeFromJVMCICompilation.invoke(runtime, (Object) modules); - } catch (Throwable throwable) { - throw new InternalError(throwable); - } - } + runtime.excludeFromJVMCICompilation(jvmciModule, graalModule, compilerConfigurationModule); } @Override boolean apply(Class declaringClass) { - if (runtimeExcludeFromJVMCICompilation != null) { - throw GraalError.shouldNotReachHere(); - } else { - Module module = declaringClass.getModule(); - return jvmciModule == module || graalModule == module || compilerConfigurationModule == module; - } + throw GraalError.shouldNotReachHere(); } @Override HotSpotJVMCICompilerFactory.CompilationLevelAdjustment getCompilationLevelAdjustment() { - if (runtimeExcludeFromJVMCICompilation != null) { - return None; - } else { - return super.getCompilationLevelAdjustment(); - } + return None; } } diff --git a/compiler/src/org.graalvm.compiler.hotspot.jdk17/src/org/graalvm/compiler/hotspot/JFRCompilerProfiler.java b/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/JFRCompilerProfiler.java similarity index 100% rename from compiler/src/org.graalvm.compiler.hotspot.jdk17/src/org/graalvm/compiler/hotspot/JFRCompilerProfiler.java rename to compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/JFRCompilerProfiler.java diff --git a/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/JVMCIVersionCheck.java b/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/JVMCIVersionCheck.java index a33abe5b991d..27ec75cc4e28 100644 --- a/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/JVMCIVersionCheck.java +++ b/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/JVMCIVersionCheck.java @@ -43,7 +43,15 @@ */ public final class JVMCIVersionCheck { - private static final Version JVMCI_MIN_VERSION = new Version(20, 2, 1); + /** + * Minimum JVMCI version supported by Graal. + */ + private static final Version JVMCI_MIN_VERSION = new Version(22, 3, 11); + + /** + * Minimum Java release supported by Graal. + */ + private static final int JAVA_MIN_RELEASE = 17; public static class Version { private final int major; @@ -123,10 +131,10 @@ private void failVersionCheck(boolean exit, String reason, Object... args) { errorMessage.format("this error or to \"warn\" to emit a warning and continue execution.%n"); errorMessage.format("Currently used Java home directory is %s.%n", javaHome); errorMessage.format("Currently used VM configuration is: %s%n", vmName); - if (javaSpecVersion.compareTo("11") == 0 && vmVersion.contains("-jvmci-")) { + if (vmVersion.contains("-jvmci-")) { errorMessage.format("Download the latest Labs OpenJDK from " + OPEN_LABSJDK_RELEASE_URL_PATTERN); } else { - errorMessage.format("Download JDK 11 or later."); + errorMessage.format("Download JDK %s or later.", JAVA_MIN_RELEASE); } String value = System.getenv("JVMCI_VERSION_CHECK"); if ("warn".equals(value)) { @@ -168,8 +176,8 @@ public static void check(Map props, } private void run(boolean exitOnFailure, Version minVersion, boolean quiet) { - if (javaSpecVersion.compareTo("11") < 0) { - failVersionCheck(exitOnFailure, "Graal requires JDK 11 or later.%n"); + if (javaSpecVersion.compareTo(Integer.toString(JAVA_MIN_RELEASE)) < 0) { + failVersionCheck(exitOnFailure, "Graal requires JDK " + JAVA_MIN_RELEASE + " or later.%n"); } else { if (vmVersion.contains("SNAPSHOT")) { return; @@ -193,7 +201,7 @@ private void run(boolean exitOnFailure, Version minVersion, boolean quiet) { failVersionCheck(exitOnFailure, "The VM does not support the minimum JVMCI API version required by Graal.%n" + "Cannot read JVMCI version from java.vm.version property: %s.%n", vmVersion); } else { - // Graal is compatible with all JDK versions as of 11 GA. + // Graal is compatible with all JDK versions as of JAVA_MIN_RELEASE } } } diff --git a/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/DefaultHotSpotLoweringProvider.java b/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/DefaultHotSpotLoweringProvider.java index ec8ceab4b8db..1b09bc682d71 100644 --- a/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/DefaultHotSpotLoweringProvider.java +++ b/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/DefaultHotSpotLoweringProvider.java @@ -658,13 +658,11 @@ private void lowerHubGetClassNode(HubGetClassNode n, LoweringTool tool) { assert !hub.isConstant(); AddressNode mirrorAddress = createOffsetAddress(graph, hub, vmConfig.classMirrorOffset); FloatingReadNode read = graph.unique( - new FloatingReadNode(mirrorAddress, CLASS_MIRROR_LOCATION, null, vmConfig.classMirrorIsHandle ? StampFactory.forKind(target.wordJavaKind) : n.stamp(NodeView.DEFAULT), + new FloatingReadNode(mirrorAddress, CLASS_MIRROR_LOCATION, null, StampFactory.forKind(target.wordJavaKind), null, BarrierType.NONE)); - if (vmConfig.classMirrorIsHandle) { - // Read the Object from the OopHandle - AddressNode address = createOffsetAddress(graph, read, 0); - read = graph.unique(new FloatingReadNode(address, HOTSPOT_OOP_HANDLE_LOCATION, null, n.stamp(NodeView.DEFAULT), null, BarrierType.NONE)); - } + // Read the Object from the OopHandle + AddressNode address = createOffsetAddress(graph, read, 0); + read = graph.unique(new FloatingReadNode(address, HOTSPOT_OOP_HANDLE_LOCATION, null, n.stamp(NodeView.DEFAULT), null, BarrierType.NONE)); n.replaceAtUsagesAndDelete(read); } diff --git a/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraphBuilderPlugins.java b/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraphBuilderPlugins.java index 4d8c898f3d71..830a13ac67c3 100644 --- a/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraphBuilderPlugins.java +++ b/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraphBuilderPlugins.java @@ -25,8 +25,6 @@ package org.graalvm.compiler.hotspot.meta; import static jdk.vm.ci.services.Services.IS_IN_NATIVE_IMAGE; -import static org.graalvm.compiler.core.common.calc.Condition.EQ; -import static org.graalvm.compiler.core.common.calc.Condition.NE; import static org.graalvm.compiler.hotspot.HotSpotBackend.BASE64_DECODE_BLOCK; import static org.graalvm.compiler.hotspot.HotSpotBackend.BASE64_ENCODE_BLOCK; import static org.graalvm.compiler.hotspot.HotSpotBackend.CRC_TABLE_LOCATION; @@ -49,7 +47,6 @@ import org.graalvm.compiler.api.directives.GraalDirectives; import org.graalvm.compiler.api.replacements.SnippetReflectionProvider; -import org.graalvm.compiler.core.common.calc.CanonicalCondition; import org.graalvm.compiler.core.common.calc.Condition; import org.graalvm.compiler.core.common.memory.MemoryOrderMode; import org.graalvm.compiler.core.common.spi.ForeignCallDescriptor; @@ -58,7 +55,6 @@ import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig; import org.graalvm.compiler.hotspot.HotSpotBackend; import org.graalvm.compiler.hotspot.HotSpotGraalRuntimeProvider; -import org.graalvm.compiler.hotspot.nodes.CurrentJavaThreadNode; import org.graalvm.compiler.hotspot.nodes.HotSpotLoadReservedReferenceNode; import org.graalvm.compiler.hotspot.nodes.HotSpotStoreReservedReferenceNode; import org.graalvm.compiler.hotspot.replacements.CallSiteTargetNode; @@ -578,34 +574,6 @@ public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Rec return true; } }); - - // This substitution is no longer in used when threadObj is a handle - r.registerConditional(config.osThreadInterruptedOffset != Integer.MAX_VALUE && !config.threadObjectFieldIsHandle, new InvocationPlugin("isInterrupted", Receiver.class, boolean.class) { - @Override - public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode clearInterrupted) { - try (HotSpotInvocationPluginHelper helper = new HotSpotInvocationPluginHelper(b, targetMethod, config)) { - ValueNode receiverThreadObject = receiver.get(); - CurrentJavaThreadNode thread = b.add(new CurrentJavaThreadNode(helper.getWordKind())); - ValueNode currentThreadObject = helper.readCurrentThreadObject(thread); - - // if (this != Thread.currentThread()) do fallback - helper.doFallbackIf(receiverThreadObject, NE, currentThreadObject, GraalDirectives.UNLIKELY_PROBABILITY); - ValueNode osThread = helper.readOsThread(thread); - ValueNode interrupted = helper.readOsThreadInterrupted(osThread); - - // if (thread._osthread._isinterrupted == 0) return false - helper.emitReturnIf(interrupted, EQ, ConstantNode.forInt(0), ConstantNode.forBoolean(false), GraalDirectives.LIKELY_PROBABILITY); - - // if (clearInterrupted) fallback to invoke - helper.doFallbackIf(clearInterrupted, EQ, ConstantNode.forBoolean(true), GraalDirectives.UNLIKELY_PROBABILITY); - - // return interrupted == 0 ? false : true - LogicNode test = helper.createCompare(interrupted, CanonicalCondition.EQ, ConstantNode.forInt(0)); - helper.emitFinalReturn(JavaKind.Boolean, ConditionalNode.create(test, ConstantNode.forBoolean(false), ConstantNode.forBoolean(true), NodeView.DEFAULT)); - } - return true; - } - }); } public static boolean isIntrinsicName(GraalHotSpotVMConfig config, String className, String name) { diff --git a/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotInvocationPluginHelper.java b/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotInvocationPluginHelper.java index 98527522a876..af01d3cd3350 100644 --- a/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotInvocationPluginHelper.java +++ b/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotInvocationPluginHelper.java @@ -26,14 +26,13 @@ import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.ARRAY_KLASS_COMPONENT_MIRROR; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.CLASS_ARRAY_KLASS_LOCATION; -import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.HOTSPOT_OOP_HANDLE_LOCATION; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.HOTSPOT_CURRENT_THREAD_OOP_HANDLE_LOCATION; +import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.HOTSPOT_OOP_HANDLE_LOCATION; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.JAVA_THREAD_CURRENT_THREAD_OBJECT_LOCATION; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.JAVA_THREAD_OSTHREAD_LOCATION; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.KLASS_ACCESS_FLAGS_LOCATION; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.KLASS_MODIFIER_FLAGS_LOCATION; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.KLASS_SUPER_KLASS_LOCATION; -import static org.graalvm.word.LocationIdentity.any; import java.util.function.Function; @@ -117,7 +116,6 @@ enum HotSpotVMConfigField { KLASS_MODIFIER_FLAGS_OFFSET(config -> config.klassModifierFlagsOffset, KLASS_MODIFIER_FLAGS_LOCATION, StampFactory.forKind(JavaKind.Int)), KLASS_SUPER_KLASS_OFFSET(config -> config.klassSuperKlassOffset, KLASS_SUPER_KLASS_LOCATION, KlassPointerStamp.klass()), CLASS_ARRAY_KLASS_OFFSET(config -> config.arrayKlassOffset, CLASS_ARRAY_KLASS_LOCATION, KlassPointerStamp.klassNonNull()), - OS_THREAD_INTERRUPTED_OFFSET(config -> config.osThreadInterruptedOffset, any(), StampFactory.forKind(JavaKind.Int)), JAVA_THREAD_OSTHREAD_OFFSET(config -> config.osThreadOffset, JAVA_THREAD_OSTHREAD_LOCATION), JAVA_THREAD_THREAD_OBJECT(config -> config.threadCurrentThreadObjectOffset, JAVA_THREAD_CURRENT_THREAD_OBJECT_LOCATION, null), KLASS_ACCESS_FLAGS_OFFSET(config -> config.klassAccessFlagsOffset, KLASS_ACCESS_FLAGS_LOCATION, StampFactory.forKind(JavaKind.Int)), @@ -212,14 +210,13 @@ public ValueNode readCurrentThreadObject() { public ValueNode readCurrentThreadObject(CurrentJavaThreadNode thread) { // JavaThread::_threadObj is never compressed ObjectStamp threadStamp = StampFactory.objectNonNull(TypeReference.create(b.getAssumptions(), b.getMetaAccess().lookupJavaType(Thread.class))); - Stamp fieldStamp = config.threadObjectFieldIsHandle ? StampFactory.forKind(getWordKind()) : threadStamp; + Stamp fieldStamp = StampFactory.forKind(getWordKind()); ValueNode value = readLocation(thread, HotSpotVMConfigField.JAVA_THREAD_THREAD_OBJECT, fieldStamp); - if (config.threadObjectFieldIsHandle) { - // Read the Object from the OopHandle - ValueNode handleOffset = ConstantNode.forIntegerKind(getWordKind(), 0, b.getGraph()); - AddressNode handleAddress = b.add(new OffsetAddressNode(value, handleOffset)); - value = b.add(new ReadNode(handleAddress, HOTSPOT_CURRENT_THREAD_OOP_HANDLE_LOCATION, threadStamp, BarrierType.NONE, MemoryOrderMode.PLAIN)); - } + + // Read the Object from the OopHandle + ValueNode handleOffset = ConstantNode.forIntegerKind(getWordKind(), 0, b.getGraph()); + AddressNode handleAddress = b.add(new OffsetAddressNode(value, handleOffset)); + value = b.add(new ReadNode(handleAddress, HOTSPOT_CURRENT_THREAD_OOP_HANDLE_LOCATION, threadStamp, BarrierType.NONE, MemoryOrderMode.PLAIN)); return value; } @@ -229,11 +226,4 @@ public ValueNode readCurrentThreadObject(CurrentJavaThreadNode thread) { public ValueNode readOsThread(CurrentJavaThreadNode thread) { return readLocation(thread, HotSpotVMConfigField.JAVA_THREAD_OSTHREAD_OFFSET); } - - /** - * Reads {@code OSThread::_interrupted}. - */ - public ValueNode readOsThreadInterrupted(ValueNode osThread) { - return readLocation(osThread, HotSpotVMConfigField.OS_THREAD_INTERRUPTED_OFFSET); - } } diff --git a/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotReplacementsUtil.java b/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotReplacementsUtil.java index 23aec7c2a42d..0ad0db5e2825 100644 --- a/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotReplacementsUtil.java +++ b/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotReplacementsUtil.java @@ -398,11 +398,6 @@ public static int invocationCounterShift(@InjectedParameter GraalHotSpotVMConfig return config.invocationCounterShift; } - @Fold - public static int stackBias(@InjectedParameter GraalHotSpotVMConfig config) { - return config.stackBias; - } - @NodeIntrinsic(value = KlassLayoutHelperNode.class) public static native int readLayoutHelper(KlassPointer object); diff --git a/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/MonitorSnippets.java b/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/MonitorSnippets.java index 2ec5ef1227f7..38b4f939c409 100644 --- a/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/MonitorSnippets.java +++ b/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/MonitorSnippets.java @@ -63,7 +63,6 @@ import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.pageSize; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.prototypeMarkWordOffset; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.registerAsWord; -import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.stackBias; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.unlockedMask; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.useBiasedLocking; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.verifyOop; @@ -316,7 +315,7 @@ public static void monitorenter(Object object, KlassPointer hub, @ConstantParame // assuming both the stack pointer and page_size have their least // significant 2 bits cleared and page_size is a power of 2 final Word alignedMask = unsigned(wordSize() - 1); - final Word stackPointer = registerAsWord(stackPointerRegister).add(stackBias(INJECTED_VMCONFIG)); + final Word stackPointer = registerAsWord(stackPointerRegister); if (probability(FAST_PATH_PROBABILITY, currentMark.subtract(stackPointer).and(alignedMask.subtract(pageSize(INJECTED_VMCONFIG))).equal(0))) { // Recursively locked => write 0 to the lock slot lock.writeWord(lockDisplacedMarkOffset(INJECTED_VMCONFIG), zero(), DISPLACED_MARK_WORD_LOCATION); diff --git a/compiler/src/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv2.java b/compiler/src/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv2.java index 0ab73b3d6919..8d3a6a490a3e 100644 --- a/compiler/src/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv2.java +++ b/compiler/src/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv2.java @@ -51,6 +51,16 @@ public void run1() throws Throwable { @Test public void run2() throws Throwable { + runTest("test", MAX, -1L); + } + + @Test + public void run3() throws Throwable { + runTest("test", MAX, 1L); + } + + @Test + public void run4() throws Throwable { runTest("test", MIN, MAX); } } diff --git a/compiler/src/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathPowOp.java b/compiler/src/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathPowOp.java index 47527fd7a1fd..72e7740e0aee 100644 --- a/compiler/src/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathPowOp.java +++ b/compiler/src/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathPowOp.java @@ -54,7 +54,6 @@ import org.graalvm.compiler.lir.StubPort; import org.graalvm.compiler.lir.asm.ArrayDataPointerConstant; import org.graalvm.compiler.lir.asm.CompilationResultBuilder; -import org.graalvm.compiler.serviceprovider.JavaVersionUtil; import jdk.vm.ci.code.Register; @@ -941,19 +940,17 @@ public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) { // Note: Math.pow(Double.MAX_VALUE, 0.5) changes from 0x5ff0000000000000 to // 0x5fefffffffffffff on Java 17, possibly due to the change in macroAssembler_x86_pow.cpp // as ported below (JDK-8265325). - if (JavaVersionUtil.JAVA_SPEC >= 17) { - // Special case: pow(x, 0.5) => sqrt(x) - // For pow(x, y), check whether y == 0.5 - masm.cmpq(tmp1, recordExternalAddress(crb, double0Point5)); - masm.jccb(ConditionFlag.NotEqual, block58); - masm.movdq(tmp2, xmm0); - // pow(x, 0.5) => sqrt(x) only for x >= 0.0 or x is +inf/NaN - masm.cmpq(tmp2, recordExternalAddress(crb, double0)); - masm.jccb(ConditionFlag.Less, block58); - masm.sqrtsd(xmm0, xmm0); - masm.jmp(block56); - masm.bind(block58); - } + // Special case: pow(x, 0.5) => sqrt(x) + // For pow(x, y), check whether y == 0.5 + masm.cmpq(tmp1, recordExternalAddress(crb, double0Point5)); + masm.jccb(ConditionFlag.NotEqual, block58); + masm.movdq(tmp2, xmm0); + // pow(x, 0.5) => sqrt(x) only for x >= 0.0 or x is +inf/NaN + masm.cmpq(tmp2, recordExternalAddress(crb, double0)); + masm.jccb(ConditionFlag.Less, block58); + masm.sqrtsd(xmm0, xmm0); + masm.jmp(block56); + masm.bind(block58); masm.pextrw(rax, xmm0, 3); masm.xorpd(xmm2, xmm2); diff --git a/compiler/src/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/CanonicalizerTool.java b/compiler/src/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/CanonicalizerTool.java index 24cb2ec36750..be067cd22025 100644 --- a/compiler/src/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/CanonicalizerTool.java +++ b/compiler/src/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/CanonicalizerTool.java @@ -74,8 +74,8 @@ default boolean finalCanonicalization() { /** * Indicates whether the target platform complies with the JVM specification semantics for - * {@code idiv} and {@code ldiv} when the dividend is {@link Integer#MAX_VALUE} or - * {@link Long#MAX_VALUE} respectively and the divisor is {@code -1}. The specified result for + * {@code idiv} and {@code ldiv} when the dividend is {@link Integer#MIN_VALUE} or + * {@link Long#MIN_VALUE} respectively and the divisor is {@code -1}. The specified result for * this case is the dividend. */ boolean divisionOverflowIsJVMSCompliant(); diff --git a/compiler/src/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/GraphUtil.java b/compiler/src/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/GraphUtil.java index e694a230ceb9..081acbd13c8f 100644 --- a/compiler/src/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/GraphUtil.java +++ b/compiler/src/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/GraphUtil.java @@ -1059,7 +1059,7 @@ public boolean divisionOverflowIsJVMSCompliant() { if (getLowerer() != null) { return getLowerer().divisionOverflowIsJVMSCompliant(); } else { - // prevent accidental floating of divs if we dont know the target arch + // prevent accidental floating of divs if we don't know the target arch return false; } } diff --git a/compiler/src/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64GraphBuilderPlugins.java b/compiler/src/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64GraphBuilderPlugins.java index 53e715082f60..d8e1755a7f58 100644 --- a/compiler/src/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64GraphBuilderPlugins.java +++ b/compiler/src/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64GraphBuilderPlugins.java @@ -66,7 +66,6 @@ import org.graalvm.compiler.replacements.InvocationPluginHelper; import org.graalvm.compiler.replacements.SnippetSubstitutionInvocationPlugin; import org.graalvm.compiler.replacements.SnippetTemplate; -import org.graalvm.compiler.replacements.StandardGraphBuilderPlugins.StringLatin1IndexOfCharPlugin; import org.graalvm.compiler.replacements.StringLatin1InflateNode; import org.graalvm.compiler.replacements.StringLatin1Snippets; import org.graalvm.compiler.replacements.StringUTF16CompressNode; @@ -363,17 +362,13 @@ public SnippetTemplate.SnippetInfo getSnippet(StringLatin1Snippets.Templates tem return templates.indexOf; } }); - if (JavaVersionUtil.JAVA_SPEC < 16) { - r.register(new StringLatin1IndexOfCharPlugin()); - } else { - r.register(new InvocationPlugin("indexOfChar", byte[].class, int.class, int.class, int.class) { - @Override - public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode value, ValueNode ch, ValueNode fromIndex, ValueNode max) { - b.addPush(JavaKind.Int, ArrayIndexOfNode.createIndexOfSingle(b, JavaKind.Byte, Stride.S1, value, max, fromIndex, ch)); - return true; - } - }); - } + r.register(new InvocationPlugin("indexOfChar", byte[].class, int.class, int.class, int.class) { + @Override + public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode value, ValueNode ch, ValueNode fromIndex, ValueNode max) { + b.addPush(JavaKind.Int, ArrayIndexOfNode.createIndexOfSingle(b, JavaKind.Byte, Stride.S1, value, max, fromIndex, ch)); + return true; + } + }); } private static void registerStringUTF16Plugins(InvocationPlugins plugins, Replacements replacements) { diff --git a/compiler/src/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64GraphBuilderPlugins.java b/compiler/src/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64GraphBuilderPlugins.java index 94ae0ce9abd9..858cfdaaf325 100644 --- a/compiler/src/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64GraphBuilderPlugins.java +++ b/compiler/src/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64GraphBuilderPlugins.java @@ -70,7 +70,6 @@ import org.graalvm.compiler.replacements.SnippetSubstitutionInvocationPlugin; import org.graalvm.compiler.replacements.SnippetTemplate; import org.graalvm.compiler.replacements.StandardGraphBuilderPlugins.ArrayEqualsInvocationPlugin; -import org.graalvm.compiler.replacements.StandardGraphBuilderPlugins.StringLatin1IndexOfCharPlugin; import org.graalvm.compiler.replacements.StringLatin1InflateNode; import org.graalvm.compiler.replacements.StringLatin1Snippets; import org.graalvm.compiler.replacements.StringUTF16CompressNode; @@ -403,17 +402,13 @@ public SnippetTemplate.SnippetInfo getSnippet(StringLatin1Snippets.Templates tem return templates.indexOf; } }); - if (JavaVersionUtil.JAVA_SPEC < 16) { - r.register(new StringLatin1IndexOfCharPlugin()); - } else { - r.register(new InvocationPlugin("indexOfChar", byte[].class, int.class, int.class, int.class) { - @Override - public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode value, ValueNode ch, ValueNode fromIndex, ValueNode max) { - b.addPush(JavaKind.Int, ArrayIndexOfNode.createIndexOfSingle(b, JavaKind.Byte, Stride.S1, value, max, fromIndex, ch)); - return true; - } - }); - } + r.register(new InvocationPlugin("indexOfChar", byte[].class, int.class, int.class, int.class) { + @Override + public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode value, ValueNode ch, ValueNode fromIndex, ValueNode max) { + b.addPush(JavaKind.Int, ArrayIndexOfNode.createIndexOfSingle(b, JavaKind.Byte, Stride.S1, value, max, fromIndex, ch)); + return true; + } + }); } private static void registerStringUTF16Plugins(InvocationPlugins plugins, Replacements replacements) { diff --git a/compiler/src/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StandardGraphBuilderPlugins.java b/compiler/src/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StandardGraphBuilderPlugins.java index a0b0722008ef..89fdb905f0c1 100644 --- a/compiler/src/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StandardGraphBuilderPlugins.java +++ b/compiler/src/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StandardGraphBuilderPlugins.java @@ -46,8 +46,6 @@ import org.graalvm.compiler.api.directives.GraalDirectives; import org.graalvm.compiler.api.replacements.SnippetReflectionProvider; -import org.graalvm.compiler.core.common.Stride; -import org.graalvm.compiler.core.common.calc.CanonicalCondition; import org.graalvm.compiler.core.common.calc.Condition; import org.graalvm.compiler.core.common.calc.Condition.CanonicalizedCondition; import org.graalvm.compiler.core.common.calc.UnsignedMath; @@ -168,7 +166,6 @@ import org.graalvm.compiler.replacements.nodes.AESNode; import org.graalvm.compiler.replacements.nodes.AESNode.CryptMode; import org.graalvm.compiler.replacements.nodes.ArrayEqualsNode; -import org.graalvm.compiler.replacements.nodes.ArrayIndexOfNode; import org.graalvm.compiler.replacements.nodes.CipherBlockChainingAESNode; import org.graalvm.compiler.replacements.nodes.CounterModeAESNode; import org.graalvm.compiler.replacements.nodes.GHASHProcessBlocksNode; @@ -527,7 +524,7 @@ private static Class getJavaClass(JavaKind kind) { } private static String[] getKindNames(boolean isSunMiscUnsafe, JavaKind kind) { - if (kind == JavaKind.Object && !isSunMiscUnsafe && JavaVersionUtil.JAVA_SPEC >= 17) { + if (kind == JavaKind.Object && !isSunMiscUnsafe) { /* * JDK 17 renamed all Object-type-related methods in jdk.internal.misc.Unsafe from * "Object" to "Reference", but kept the "Object" version as deprecated. We want to @@ -1595,11 +1592,6 @@ public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Rec b.add(new CacheWritebackSyncNode(isPreSync)); return true; } - - @Override - public boolean isOptional() { - return JavaVersionUtil.JAVA_SPEC < 14; - } } private static final SpeculationReasonGroup DIRECTIVE_SPECULATIONS = new SpeculationReasonGroup("GraalDirective", BytecodePosition.class); @@ -2074,12 +2066,7 @@ public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Rec private static void registerPreconditionsPlugins(InvocationPlugins plugins, Replacements replacements) { final Registration preconditions = new Registration(plugins, "jdk.internal.util.Preconditions", replacements); preconditions.register(new CheckIndexPlugin(int.class)); - preconditions.register(new CheckIndexPlugin(long.class) { - @Override - public boolean isOptional() { - return JavaVersionUtil.JAVA_SPEC < 16; - } - }); + preconditions.register(new CheckIndexPlugin(long.class)); } /** @@ -2099,36 +2086,6 @@ public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Rec }); } - public static class StringLatin1IndexOfCharPlugin extends InvocationPlugin { - - public StringLatin1IndexOfCharPlugin() { - super("indexOf", byte[].class, int.class, int.class); - } - - @SuppressWarnings("try") - @Override - public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode value, ValueNode ch, ValueNode origFromIndex) { - if (!b.canMergeIntrinsicReturns()) { - return false; - } - try (InvocationPluginHelper helper = new InvocationPluginHelper(b, targetMethod)) { - ConstantNode zero = ConstantNode.forInt(0); - // if (ch >>> 8 != 0) return -1 - helper.emitReturnIf(helper.ushr(ch, 8), Condition.NE, zero, ConstantNode.forInt(-1), GraalDirectives.UNLIKELY_PROBABILITY); - ValueNode nonNullValue = b.nullCheckedValue(value); - - // if (fromIndex >= value.length) return -1 - ValueNode length = helper.arraylength(nonNullValue); - helper.emitReturnIf(origFromIndex, Condition.GE, length, ConstantNode.forInt(-1), GraalDirectives.UNLIKELY_PROBABILITY); - LogicNode condition = helper.createCompare(origFromIndex, CanonicalCondition.LT, zero); - // fromIndex = max(fromIndex, 0) - ValueNode fromIndex = ConditionalNode.create(condition, zero, origFromIndex, NodeView.DEFAULT); - helper.emitFinalReturn(JavaKind.Int, ArrayIndexOfNode.createIndexOfSingle(b, JavaKind.Byte, Stride.S1, nonNullValue, length, fromIndex, ch)); - } - return true; - } - } - public abstract static class AESCryptPluginBase extends InvocationPlugin { protected final CryptMode mode; diff --git a/compiler/src/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BinaryMathIntrinsicNode.java b/compiler/src/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BinaryMathIntrinsicNode.java index 35f8de66e278..a7b773a73713 100644 --- a/compiler/src/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BinaryMathIntrinsicNode.java +++ b/compiler/src/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BinaryMathIntrinsicNode.java @@ -50,7 +50,6 @@ import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.Value; -import org.graalvm.compiler.serviceprovider.JavaVersionUtil; @NodeInfo(nameTemplate = "MathIntrinsic#{p#operation/s}", cycles = CYCLES_1024, cyclesRationale = "stub based math intrinsics all have roughly the same high cycle count", size = SIZE_1) public final class BinaryMathIntrinsicNode extends BinaryNode implements ArithmeticLIRLowerable, Lowerable { @@ -155,12 +154,10 @@ public ValueNode canonical(CanonicalizerTool tool, ValueNode forX, ValueNode for } // x**0.5 = sqrt(x) - if (JavaVersionUtil.JAVA_SPEC >= 17) { - // Note that Math.pow(Double.MAX_VALUE, 0.5) returns different value than - // Math.sqrt(Double.MAX_VALUE) until Java 17. - if (yValue == 0.5D && x.stamp(view) instanceof FloatStamp && ((FloatStamp) x.stamp(view)).lowerBound() >= 0.0D) { - return SqrtNode.create(x, view); - } + // Note that Math.pow(Double.MAX_VALUE, 0.5) returns different value than + // Math.sqrt(Double.MAX_VALUE) until Java 17. + if (yValue == 0.5D && x.stamp(view) instanceof FloatStamp && ((FloatStamp) x.stamp(view)).lowerBound() >= 0.0D) { + return SqrtNode.create(x, view); } } break; diff --git a/compiler/src/org.graalvm.compiler.truffle.runtime.hotspot.jdk17/src/org/graalvm/compiler/truffle/runtime/hotspot/HotSpotTruffleRuntimeServices.java b/compiler/src/org.graalvm.compiler.truffle.runtime.hotspot.jdk17/src/org/graalvm/compiler/truffle/runtime/hotspot/HotSpotTruffleRuntimeServices.java deleted file mode 100644 index d6aacfc894d4..000000000000 --- a/compiler/src/org.graalvm.compiler.truffle.runtime.hotspot.jdk17/src/org/graalvm/compiler/truffle/runtime/hotspot/HotSpotTruffleRuntimeServices.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.graalvm.compiler.truffle.runtime.hotspot; - -import org.graalvm.compiler.truffle.runtime.OptimizedCallTarget; - -import jdk.vm.ci.hotspot.HotSpotSpeculationLog; -import jdk.vm.ci.meta.SpeculationLog; - -/** - * JDK 13+ version of {@link HotSpotTruffleRuntimeServices}. - */ -class HotSpotTruffleRuntimeServices { - - /** - * A wrapper that holds a strong reference to another speculation log that - * {@linkplain HotSpotSpeculationLog#managesFailedSpeculations() manages} the failed - * speculations list. - */ - static class CompilationSpeculationLog extends HotSpotSpeculationLog { - private final HotSpotSpeculationLog wrappedLog; - - CompilationSpeculationLog(HotSpotSpeculationLog wrappedLog) { - super(wrappedLog.getFailedSpeculationsAddress()); - this.wrappedLog = wrappedLog; - } - - @Override - public String toString() { - return wrappedLog.toString(); - } - } - - /** - * Gets a speculation log to be used for compiling {@code callTarget}. - */ - public static SpeculationLog getCompilationSpeculationLog(OptimizedCallTarget callTarget) { - HotSpotSpeculationLog wrappedLog = (HotSpotSpeculationLog) callTarget.getSpeculationLog(); - CompilationSpeculationLog compilationSpeculationLog = new CompilationSpeculationLog(wrappedLog); - compilationSpeculationLog.collectFailedSpeculations(); - return compilationSpeculationLog; - } -} diff --git a/compiler/src/org.graalvm.compiler.truffle.runtime.hotspot/src/org/graalvm/compiler/truffle/runtime/hotspot/HotSpotTruffleRuntimeServices.java b/compiler/src/org.graalvm.compiler.truffle.runtime.hotspot/src/org/graalvm/compiler/truffle/runtime/hotspot/HotSpotTruffleRuntimeServices.java index 197706cf97a2..5bd664cb7b73 100644 --- a/compiler/src/org.graalvm.compiler.truffle.runtime.hotspot/src/org/graalvm/compiler/truffle/runtime/hotspot/HotSpotTruffleRuntimeServices.java +++ b/compiler/src/org.graalvm.compiler.truffle.runtime.hotspot/src/org/graalvm/compiler/truffle/runtime/hotspot/HotSpotTruffleRuntimeServices.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,9 +24,6 @@ */ package org.graalvm.compiler.truffle.runtime.hotspot; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; - import org.graalvm.compiler.truffle.runtime.OptimizedCallTarget; import jdk.vm.ci.hotspot.HotSpotSpeculationLog; @@ -35,43 +32,36 @@ /** * JDK versioned functionality used by the HotSpot Truffle runtime. * - * This version is for JDK 11 without the changes from JDK-8220623. + * This version is for JDK 17+. */ class HotSpotTruffleRuntimeServices { - private static final Constructor sharedHotSpotSpeculationLogConstructor; + /** + * A wrapper that holds a strong reference to another speculation log that + * {@linkplain HotSpotSpeculationLog#managesFailedSpeculations() manages} the failed + * speculations list. + */ + static class CompilationSpeculationLog extends HotSpotSpeculationLog { + private final HotSpotSpeculationLog wrappedLog; - static { - Constructor constructor = null; - try { - @SuppressWarnings("unchecked") - Class theClass = (Class) Class.forName("jdk.vm.ci.hotspot.SharedHotSpotSpeculationLog"); - constructor = theClass.getDeclaredConstructor(HotSpotSpeculationLog.class); - } catch (ClassNotFoundException e) { - } catch (NoSuchMethodException e) { - throw new InternalError("SharedHotSpotSpeculationLog exists but constructor is missing", e); + CompilationSpeculationLog(HotSpotSpeculationLog wrappedLog) { + super(wrappedLog.getFailedSpeculationsAddress()); + this.wrappedLog = wrappedLog; + } + + @Override + public String toString() { + return wrappedLog.toString(); } - sharedHotSpotSpeculationLogConstructor = constructor; } /** * Gets a speculation log to be used for compiling {@code callTarget}. */ public static SpeculationLog getCompilationSpeculationLog(OptimizedCallTarget callTarget) { - if (sharedHotSpotSpeculationLogConstructor != null) { - HotSpotSpeculationLog log = (HotSpotSpeculationLog) callTarget.getSpeculationLog(); - try { - SpeculationLog compilationSpeculationLog = sharedHotSpotSpeculationLogConstructor.newInstance(log); - compilationSpeculationLog.collectFailedSpeculations(); - return compilationSpeculationLog; - } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) { - throw new InternalError(e); - } - } - SpeculationLog log = callTarget.getSpeculationLog(); - if (log != null) { - log.collectFailedSpeculations(); - } - return log; + HotSpotSpeculationLog wrappedLog = (HotSpotSpeculationLog) callTarget.getSpeculationLog(); + CompilationSpeculationLog compilationSpeculationLog = new CompilationSpeculationLog(wrappedLog); + compilationSpeculationLog.collectFailedSpeculations(); + return compilationSpeculationLog; } } diff --git a/compiler/src/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/VirtualizerToolImpl.java b/compiler/src/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/VirtualizerToolImpl.java index 8272db53811f..e4b5ec02b9b2 100644 --- a/compiler/src/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/VirtualizerToolImpl.java +++ b/compiler/src/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/VirtualizerToolImpl.java @@ -414,7 +414,7 @@ public boolean divisionOverflowIsJVMSCompliant() { if (getLowerer() != null) { return getLowerer().divisionOverflowIsJVMSCompliant(); } - // prevent accidental floating of divs if we dont know the target arch + // prevent accidental floating of divs if we don't know the target arch return false; } } diff --git a/espresso/mx.espresso/suite.py b/espresso/mx.espresso/suite.py index 3fb5c1f1e464..88caea2bb4cf 100644 --- a/espresso/mx.espresso/suite.py +++ b/espresso/mx.espresso/suite.py @@ -109,7 +109,7 @@ "sourceDirs": ["src"], "dependencies": [ ], - "javaCompliance": "11+", + "javaCompliance" : "8+", "checkstyle": "com.oracle.truffle.espresso.polyglot", "checkstyleVersion": "8.8", "license": "UPL", @@ -120,7 +120,7 @@ "sourceDirs": ["src"], "dependencies": [ ], - "javaCompliance": "11+", + "javaCompliance" : "8+", "checkstyle": "com.oracle.truffle.espresso.polyglot", "license": "UPL", }, @@ -139,7 +139,7 @@ "jdk.unsupported", # sun.misc.Signal ], "annotationProcessors": ["truffle:TRUFFLE_DSL_PROCESSOR", "ESPRESSO_PROCESSOR"], - "javaCompliance": "11+", + "javaCompliance" : "17+", "checkstyle": "com.oracle.truffle.espresso", "checkstyleVersion": "8.8", }, @@ -164,7 +164,7 @@ "requires": [ "java.compiler" ], - "javaCompliance": "11+", + "javaCompliance" : "17+", "checkstyle": "com.oracle.truffle.espresso", }, @@ -175,7 +175,7 @@ "sdk:GRAAL_SDK", "sdk:LAUNCHER_COMMON", ], - "javaCompliance": "11+", + "javaCompliance" : "17+", "checkstyle": "com.oracle.truffle.espresso", }, @@ -189,7 +189,7 @@ "requires": [ "java.logging", ], - "javaCompliance": "11+", + "javaCompliance" : "17+", "checkstyle": "com.oracle.truffle.espresso", }, @@ -201,7 +201,7 @@ "truffle:TRUFFLE_NFI", ], "annotationProcessors": ["truffle:TRUFFLE_DSL_PROCESSOR"], - "javaCompliance": "11+", + "javaCompliance" : "17+", "checkstyle": "com.oracle.truffle.espresso.jdwp", }, diff --git a/java-benchmarks/mx.java-benchmarks/suite.py b/java-benchmarks/mx.java-benchmarks/suite.py index 0622c2f7998c..920ab4b1f988 100644 --- a/java-benchmarks/mx.java-benchmarks/suite.py +++ b/java-benchmarks/mx.java-benchmarks/suite.py @@ -360,7 +360,7 @@ "dependencies" : [ "mx:JMH_1_21", ], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "checkPackagePrefix" : "false", "annotationProcessors" : ["mx:JMH_1_21"], "spotbugsIgnoresGenerated" : True, @@ -373,7 +373,7 @@ "dependencies" : [ "mx:JMH_1_21", ], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "checkPackagePrefix" : "false", "annotationProcessors" : ["mx:JMH_1_21"], "spotbugsIgnoresGenerated" : True, @@ -386,7 +386,7 @@ "dependencies" : [ "SCALAFMT" ], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "checkPackagePrefix" : "false", "workingSets" : "Graal,Bench", "testProject" : True, diff --git a/regex/mx.regex/suite.py b/regex/mx.regex/suite.py index 33ed1ed436d7..e553aa50be4d 100644 --- a/regex/mx.regex/suite.py +++ b/regex/mx.regex/suite.py @@ -99,7 +99,7 @@ "com.oracle.truffle.regex.chardata", ], "checkstyleVersion" : "8.36.1", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Truffle,Regex", "spotbugsIgnoresGenerated" : True, }, @@ -117,7 +117,7 @@ "mx:JMH_1_21", ], "checkstyle" : "com.oracle.truffle.regex", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Truffle,Regex", }, }, diff --git a/sdk/mx.sdk/suite.py b/sdk/mx.sdk/suite.py index 56150463ed21..ab5f1de56858 100644 --- a/sdk/mx.sdk/suite.py +++ b/sdk/mx.sdk/suite.py @@ -238,7 +238,7 @@ "sourceDirs" : ["src"], "dependencies" : [], "checkstyle" : "org.graalvm.word", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "API,SDK", }, "org.graalvm.polyglot" : { @@ -252,7 +252,7 @@ "java.logging", ], "checkstyle" : "org.graalvm.word", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "API,SDK", }, @@ -261,7 +261,7 @@ "sourceDirs" : ["src"], "dependencies" : [], "checkstyle" : "org.graalvm.word", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "checkstyleVersion" : "8.36.1", "workingSets" : "API,SDK", }, @@ -274,7 +274,7 @@ "org.graalvm.options", ], "checkstyle" : "org.graalvm.word", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "API,SDK", }, "com.oracle.svm.core.annotate" : { @@ -284,7 +284,7 @@ "org.graalvm.nativeimage", ], "checkstyle" : "org.graalvm.word", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "API,SDK", }, "org.graalvm.nativeimage.test" : { @@ -294,7 +294,7 @@ "mx:JUNIT", "org.graalvm.nativeimage" ], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "SDK", "checkstyle" : "org.graalvm.word", }, @@ -312,7 +312,7 @@ "requiresConcealed" : { "java.base" : ["jdk.internal.module"], }, - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Truffle,Tools", "checkstyle" : "org.graalvm.word", }, @@ -323,7 +323,7 @@ "mx:JUNIT", "org.graalvm.launcher" ], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Truffle,Tools,Test", "checkstyle" : "org.graalvm.word", }, @@ -334,14 +334,14 @@ "org.graalvm.polyglot", ], "checkstyle" : "org.graalvm.word", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "API,SDK,Test", }, "org.graalvm.collections" : { "subDir" : "src", "sourceDirs" : ["src"], "checkstyle" : "org.graalvm.word", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "API,SDK", }, "org.graalvm.collections.test" : { @@ -352,7 +352,7 @@ "org.graalvm.collections", ], "checkstyle" : "org.graalvm.word", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "API,SDK,Test", }, "org.graalvm.home" : { @@ -362,7 +362,7 @@ "org.graalvm.nativeimage", ], "checkstyle" : "org.graalvm.word", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "API,SDK", }, "org.graalvm.home.test" : { @@ -373,7 +373,7 @@ "org.graalvm.home", ], "checkstyle" : "org.graalvm.word", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "API,SDK", }, }, diff --git a/substratevm/mx.substratevm/suite.py b/substratevm/mx.substratevm/suite.py index 255e96668a68..8fd0effefdc7 100644 --- a/substratevm/mx.substratevm/suite.py +++ b/substratevm/mx.substratevm/suite.py @@ -192,7 +192,7 @@ "requiresConcealed" : { "java.base" : ["jdk.internal.module"], }, - "javaCompliance": "11+", + "javaCompliance" : "17+", "annotationProcessors": [ "compiler:GRAAL_PROCESSOR", ], @@ -212,7 +212,7 @@ "jdk.vm.ci.meta", ] }, - "javaCompliance": "11+", + "javaCompliance" : "17+", "annotationProcessors": [ "compiler:GRAAL_PROCESSOR", ], @@ -230,7 +230,7 @@ "requires" : [ "java.compiler" # javax.annotation.processing.* ], - "javaCompliance": "11+", + "javaCompliance" : "17+", "checkstyle" : "com.oracle.svm.core", "workingSets" : "SVM", "jacoco" : "exclude", @@ -305,7 +305,7 @@ "jdk.jfr.internal.handlers", ], }, - "javaCompliance": "11+", + "javaCompliance" : "17+", "checkstyleVersion" : "8.36.1", "annotationProcessors": [ "compiler:GRAAL_PROCESSOR", @@ -319,7 +319,7 @@ "subDir": "src", "sourceDirs": ["src"], "dependencies": ["com.oracle.svm.core"], - "javaCompliance": "11+", + "javaCompliance" : "17+", "annotationProcessors": [ "compiler:GRAAL_PROCESSOR", "SVM_PROCESSOR", @@ -377,7 +377,7 @@ ], }, "checkstyle": "com.oracle.svm.core", - "javaCompliance": "11+", + "javaCompliance" : "17+", "annotationProcessors": [ "compiler:GRAAL_PROCESSOR", "SVM_PROCESSOR", @@ -398,7 +398,7 @@ ], }, "checkstyle": "com.oracle.svm.core", - "javaCompliance": "11+", + "javaCompliance" : "17+", "annotationProcessors": [ "compiler:GRAAL_PROCESSOR", "SVM_PROCESSOR", @@ -418,7 +418,7 @@ ], }, "checkstyle": "com.oracle.svm.core", - "javaCompliance": "11+", + "javaCompliance" : "17+", "annotationProcessors": [ "compiler:GRAAL_PROCESSOR", "SVM_PROCESSOR", @@ -438,7 +438,7 @@ ], }, "checkstyle": "com.oracle.svm.core", - "javaCompliance": "11+", + "javaCompliance" : "17+", "annotationProcessors": [ "compiler:GRAAL_PROCESSOR", "SVM_PROCESSOR", @@ -455,7 +455,7 @@ "JAVACPP_PLATFORM_SPECIFIC_SHADOWED", ], "checkstyle": "com.oracle.svm.core", - "javaCompliance": "11+", + "javaCompliance" : "17+", "annotationProcessors": [ "compiler:GRAAL_PROCESSOR", "SVM_PROCESSOR", @@ -481,7 +481,7 @@ ], }, "checkstyle": "com.oracle.svm.core", - "javaCompliance": "11+", + "javaCompliance" : "17+", "annotationProcessors": [ "compiler:GRAAL_PROCESSOR", "SVM_PROCESSOR", @@ -503,7 +503,7 @@ ], }, "checkstyle": "com.oracle.svm.core", - "javaCompliance": "11+", + "javaCompliance" : "17+", "annotationProcessors": [ "compiler:GRAAL_PROCESSOR", "SVM_PROCESSOR", @@ -525,7 +525,7 @@ ] }, "checkstyle": "com.oracle.svm.core", - "javaCompliance": "11+", + "javaCompliance" : "17+", "annotationProcessors": [ "compiler:GRAAL_PROCESSOR", ], @@ -551,7 +551,7 @@ ] }, "checkstyle": "com.oracle.svm.core", - "javaCompliance": "11+", + "javaCompliance" : "17+", "annotationProcessors": [ "compiler:GRAAL_PROCESSOR", ], @@ -581,7 +581,7 @@ "annotationProcessors": [ "compiler:GRAAL_PROCESSOR", ], - "javaCompliance": "11+", + "javaCompliance" : "17+", "spotbugs": "false", "jacoco" : "exclude", }, @@ -593,7 +593,7 @@ "com.oracle.graal.pointsto", ], "checkstyle": "com.oracle.svm.core", - "javaCompliance": "11+", + "javaCompliance" : "17+", "annotationProcessors": [ "compiler:GRAAL_PROCESSOR", ], @@ -651,7 +651,7 @@ "jdk.jfr.internal.jfc", ], }, - "javaCompliance": "11+", + "javaCompliance" : "17+", "checkstyleVersion": "8.36.1", "annotationProcessors": [ "compiler:GRAAL_PROCESSOR", @@ -820,7 +820,7 @@ "compiler:GRAAL_PROCESSOR", "SVM_PROCESSOR", ], - "javaCompliance": "11+", + "javaCompliance" : "17+", "spotbugs": "false", "jacoco" : "exclude", }, @@ -841,7 +841,7 @@ "compiler:GRAAL_PROCESSOR", "SVM_PROCESSOR", ], - "javaCompliance": "11+", + "javaCompliance" : "17+", "spotbugs": "false", "jacoco" : "exclude", }, @@ -871,7 +871,7 @@ "compiler:GRAAL_PROCESSOR", "SVM_PROCESSOR", ], - "javaCompliance": "11+", + "javaCompliance" : "17+", "spotbugs": "false", "jacoco" : "exclude", }, @@ -910,7 +910,7 @@ "compiler:GRAAL_PROCESSOR", "SVM_PROCESSOR", ], - "javaCompliance": "11+", + "javaCompliance" : "17+", "spotbugs": "false", "testProject": True, "jacoco" : "exclude", @@ -921,7 +921,7 @@ "sourceDirs" : ["src"], "dependencies" : ["sdk:GRAAL_SDK"], "checkstyle" : "com.oracle.svm.hosted", - "javaCompliance": "11+", + "javaCompliance" : "17+", "workingSets" : "SVM", "spotbugs" : "false", "jacoco" : "exclude", @@ -944,7 +944,7 @@ ], }, "checkstyle" : "com.oracle.svm.hosted", - "javaCompliance": "11+", + "javaCompliance" : "17+", "annotationProcessors": [ "compiler:GRAAL_PROCESSOR", "SVM_PROCESSOR", @@ -971,7 +971,7 @@ ], }, "checkstyle": "com.oracle.svm.hosted", - "javaCompliance": "11+", + "javaCompliance" : "17+", "annotationProcessors": [ "compiler:GRAAL_PROCESSOR", "SVM_PROCESSOR", @@ -993,7 +993,7 @@ "compiler:GRAAL_PROCESSOR", "SVM_PROCESSOR", ], - "javaCompliance": "11+", + "javaCompliance" : "17+", "spotbugs": "false", "testProject": True, "jacoco" : "exclude", @@ -1009,7 +1009,7 @@ "jdk.unsupported", ], "checkstyle": "com.oracle.svm.core", - "javaCompliance": "11+", + "javaCompliance" : "17+", "annotationProcessors": [ "compiler:GRAAL_PROCESSOR", "SVM_PROCESSOR", @@ -1025,7 +1025,7 @@ "sdk:GRAAL_SDK", ], "checkstyle": "com.oracle.svm.core", - "javaCompliance": "11+", + "javaCompliance" : "17+", "annotationProcessors": [ "compiler:GRAAL_PROCESSOR", "SVM_PROCESSOR", @@ -1051,7 +1051,7 @@ ] }, "checkstyle": "com.oracle.svm.hosted", - "javaCompliance": "11+", + "javaCompliance" : "17+", "annotationProcessors": [ "compiler:GRAAL_PROCESSOR", "SVM_PROCESSOR", @@ -1067,7 +1067,7 @@ "com.oracle.svm.truffle", ], "checkstyle": "com.oracle.svm.hosted", - "javaCompliance": "11+", + "javaCompliance" : "17+", "annotationProcessors": [ "compiler:GRAAL_PROCESSOR", "SVM_PROCESSOR", @@ -1085,7 +1085,7 @@ "com.oracle.svm.core.posix", ], "checkstyle": "com.oracle.svm.hosted", - "javaCompliance": "11+", + "javaCompliance" : "17+", "annotationProcessors": [ "compiler:GRAAL_PROCESSOR", "SVM_PROCESSOR", @@ -1103,7 +1103,7 @@ "com.oracle.svm.core.windows", ], "checkstyle": "com.oracle.svm.hosted", - "javaCompliance": "11+", + "javaCompliance" : "17+", "annotationProcessors": [ "compiler:GRAAL_PROCESSOR", "SVM_PROCESSOR", @@ -1120,7 +1120,7 @@ "com.oracle.svm.graal", ], "checkstyle": "com.oracle.svm.core", - "javaCompliance": "11+", + "javaCompliance" : "17+", "annotationProcessors": [ "compiler:GRAAL_PROCESSOR", "SVM_PROCESSOR", @@ -1141,7 +1141,7 @@ "com.oracle.svm.hosted", ], "checkstyle": "com.oracle.svm.core", - "javaCompliance": "11+", + "javaCompliance" : "17+", "annotationProcessors" : [ "compiler:GRAAL_PROCESSOR", "SVM_PROCESSOR", @@ -1167,7 +1167,7 @@ ], }, "checkstyle" : "com.oracle.svm.hosted", - "javaCompliance": "11+", + "javaCompliance" : "17+", "annotationProcessors": [ "compiler:GRAAL_PROCESSOR", "SVM_PROCESSOR", @@ -1189,7 +1189,7 @@ "workingSets": "SVM", "annotationProcessors": [ ], - "javaCompliance": "11+", + "javaCompliance" : "17+", "spotbugs": "false", "jacoco" : "exclude", }, @@ -1208,7 +1208,7 @@ "compiler:GRAAL_PROCESSOR", "SVM_PROCESSOR", ], - "javaCompliance": "11+", + "javaCompliance" : "17+", "spotbugs": "false", "jacoco" : "exclude", }, @@ -1230,7 +1230,7 @@ "compiler:GRAAL_PROCESSOR", "SVM_PROCESSOR", ], - "javaCompliance": "11+", + "javaCompliance" : "17+", "spotbugs": "false", "jacoco" : "exclude", }, @@ -1256,7 +1256,7 @@ "compiler:GRAAL_PROCESSOR", "SVM_PROCESSOR", ], - "javaCompliance": "11+", + "javaCompliance" : "17+", "spotbugs": "false", "jacoco" : "exclude", }, @@ -1276,7 +1276,7 @@ "compiler:GRAAL_PROCESSOR", "SVM_PROCESSOR", ], - "javaCompliance": "11+", + "javaCompliance" : "17+", "jacoco" : "exclude", }, }, @@ -1507,7 +1507,7 @@ "GRAAL_HOTSPOT_LIBRARY": { "subDir": "src", "description" : "SubstrateVM HotSpot Graal library support", - "javaCompliance": "11+", + "javaCompliance" : "17+", "dependencies": [ "com.oracle.svm.graal.hotspot.libgraal", ], diff --git a/sulong/mx.sulong/suite.py b/sulong/mx.sulong/suite.py index 1b70932a2814..710dedc3b3be 100644 --- a/sulong/mx.sulong/suite.py +++ b/sulong/mx.sulong/suite.py @@ -177,7 +177,7 @@ ], "checkstyle" : "com.oracle.truffle.llvm.runtime", "annotationProcessors" : ["truffle:TRUFFLE_DSL_PROCESSOR"], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "javaProperties" : { "test.sulongtest.harness" : "/TestHarness/bin", "test.sulongtest.lib" : "/", @@ -207,7 +207,7 @@ ], "checkstyle" : "com.oracle.truffle.llvm.runtime", "annotationProcessors" : ["truffle:TRUFFLE_DSL_PROCESSOR"], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Truffle, LLVM", "license" : "BSD-new", "testProject" : True, @@ -237,7 +237,7 @@ "mx:JUNIT", ], "checkstyle" : "com.oracle.truffle.llvm.runtime", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Truffle, LLVM", "license" : "BSD-new", "testProject" : True, @@ -256,7 +256,7 @@ "SULONG_TCK_NATIVE", ], "checkstyle" : "com.oracle.truffle.llvm.runtime", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Truffle, LLVM", "license" : "BSD-new", "testProject" : True, @@ -287,7 +287,7 @@ "subDir" : "projects", "sourceDirs" : ["src"], "checkstyle" : "com.oracle.truffle.llvm.runtime", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Truffle, LLVM", "license" : "BSD-new", "jacoco" : "exclude", @@ -297,7 +297,7 @@ "sourceDirs" : ["src"], "dependencies" : ["truffle:TRUFFLE_API"], "checkstyle" : "com.oracle.truffle.llvm.runtime", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Truffle, LLVM", "license" : "BSD-new", "jacoco" : "include", @@ -308,7 +308,7 @@ "dependencies" : ["truffle:TRUFFLE_API"], "checkstyle" : "com.oracle.truffle.llvm.runtime", "annotationProcessors" : ["truffle:TRUFFLE_DSL_PROCESSOR"], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Truffle, LLVM", "license" : "BSD-new", "jacoco" : "include", @@ -323,7 +323,7 @@ ], "checkstyle" : "com.oracle.truffle.llvm.runtime", "annotationProcessors" : ["truffle:TRUFFLE_DSL_PROCESSOR"], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Truffle, LLVM", "license" : "BSD-new", "jacoco" : "include", @@ -387,7 +387,7 @@ ], "checkstyle" : "com.oracle.truffle.llvm.runtime", "annotationProcessors" : ["truffle:TRUFFLE_DSL_PROCESSOR"], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Truffle, LLVM", "license" : "BSD-new", "jacoco" : "include", @@ -411,7 +411,7 @@ "checkstyle" : "com.oracle.truffle.llvm.runtime", "checkstyleVersion" : "8.8", "annotationProcessors" : ["truffle:TRUFFLE_DSL_PROCESSOR"], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "spotbugsIgnoresGenerated" : True, "workingSets" : "Truffle, LLVM", "license" : "BSD-new", @@ -431,7 +431,7 @@ "java.xml", ], "checkstyle" : "com.oracle.truffle.llvm.runtime", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "annotationProcessors" : ["truffle:TRUFFLE_DSL_PROCESSOR"], "workingSets" : "Truffle, LLVM", "license" : "BSD-new", @@ -446,7 +446,7 @@ "SULONG_API", ], "checkstyle" : "com.oracle.truffle.llvm.runtime", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "javaProperties" : { "llvm.toolchainRoot" : "", }, @@ -463,7 +463,7 @@ "sdk:LAUNCHER_COMMON", ], "checkstyle" : "com.oracle.truffle.llvm.runtime", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Truffle, LLVM", "license" : "BSD-new", "jacoco" : "include", @@ -476,7 +476,7 @@ "com.oracle.truffle.llvm.parser", ], "checkstyle" : "com.oracle.truffle.llvm.runtime", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Truffle, LLVM", "license" : "BSD-new", "jacoco" : "exclude", @@ -493,7 +493,7 @@ "org.graalvm.language.llvm.home": "", }, "checkstyle" : "com.oracle.truffle.llvm.runtime", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Truffle, LLVM", "license" : "BSD-new", "jacoco" : "include", @@ -564,7 +564,7 @@ "truffle:ANTLR4", ], "checkstyle" : "com.oracle.truffle.llvm.runtime", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "annotationProcessors" : ["truffle:TRUFFLE_DSL_PROCESSOR"], "workingSets" : "Truffle, LLVM", "license" : "BSD-new", @@ -581,7 +581,7 @@ "com.oracle.truffle.llvm.parser", ], "checkstyle" : "com.oracle.truffle.llvm.runtime", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "annotationProcessors" : ["truffle:TRUFFLE_DSL_PROCESSOR"], "workingSets" : "Truffle, LLVM", "license" : "BSD-new", @@ -623,7 +623,7 @@ "test.pipe.lib" : "/", }, "checkstyle" : "com.oracle.truffle.llvm.runtime", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "license" : "BSD-new", "testProject" : True, "jacoco" : "exclude", @@ -636,7 +636,7 @@ "com.oracle.truffle.llvm.tests", ], "checkstyle" : "com.oracle.truffle.llvm.runtime", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "license" : "BSD-new", "testProject" : True, "jacoco" : "exclude", diff --git a/tools/mx.tools/suite.py b/tools/mx.tools/suite.py index c257407d383c..335176bae8ef 100644 --- a/tools/mx.tools/suite.py +++ b/tools/mx.tools/suite.py @@ -73,7 +73,7 @@ "", # exports all packages containing package-info.java "com.oracle.truffle.tools.chromeinspector.instrument to org.graalvm.truffle" ], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "checkstyleVersion" : "8.8", "checkstyle" : "com.oracle.truffle.tools.chromeinspector", "annotationProcessors" : ["truffle:TRUFFLE_DSL_PROCESSOR"], @@ -88,7 +88,7 @@ "truffle:TRUFFLE_SL", "mx:JUNIT", ], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "checkstyle" : "com.oracle.truffle.tools.chromeinspector", "annotationProcessors" : ["truffle:TRUFFLE_DSL_PROCESSOR"], "workingSets" : "Tools", @@ -102,7 +102,7 @@ "exports" : [ "", # exports all packages containing package-info.java ], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "checkstyle" : "com.oracle.truffle.tools.chromeinspector", "annotationProcessors" : ["truffle:TRUFFLE_DSL_PROCESSOR"], "workingSets" : "Tools", @@ -119,7 +119,7 @@ "exports" : [ "", # exports all packages containing package-info.java ], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "checkstyle" : "com.oracle.truffle.tools.chromeinspector", "annotationProcessors" : ["truffle:TRUFFLE_DSL_PROCESSOR"], "workingSets" : "Tools", @@ -133,7 +133,7 @@ "exports" : [ "", # exports all packages containing package-info.java ], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "checkstyle" : "com.oracle.truffle.tools.chromeinspector", "annotationProcessors" : ["truffle:TRUFFLE_DSL_PROCESSOR"], "workingSets" : "Tools", @@ -149,7 +149,7 @@ ], "annotationProcessors" : ["truffle:TRUFFLE_DSL_PROCESSOR"], "checkstyle" : "com.oracle.truffle.tools.chromeinspector", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Tools", }, "com.oracle.truffle.tools.profiler" : { @@ -166,7 +166,7 @@ ], "annotationProcessors" : ["truffle:TRUFFLE_DSL_PROCESSOR"], "checkstyle" : "com.oracle.truffle.tools.chromeinspector", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Tools", }, "com.oracle.truffle.tools.profiler.test" : { @@ -179,7 +179,7 @@ ], "annotationProcessors" : ["truffle:TRUFFLE_DSL_PROCESSOR"], "checkstyle" : "com.oracle.truffle.tools.chromeinspector", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Tools", }, "com.oracle.truffle.tools.coverage" : { @@ -195,7 +195,7 @@ ], "annotationProcessors" : ["truffle:TRUFFLE_DSL_PROCESSOR"], "checkstyle" : "com.oracle.truffle.tools.chromeinspector", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Tools", }, "com.oracle.truffle.tools.coverage.test" : { @@ -208,7 +208,7 @@ ], "annotationProcessors" : ["truffle:TRUFFLE_DSL_PROCESSOR"], "checkstyle" : "com.oracle.truffle.tools.chromeinspector", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Tools", }, "com.oracle.truffle.tools.dap" : { @@ -225,7 +225,7 @@ ], "annotationProcessors" : ["truffle:TRUFFLE_DSL_PROCESSOR"], "checkstyle" : "com.oracle.truffle.tools.chromeinspector", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Tools", }, "com.oracle.truffle.tools.dap.test" : { @@ -239,7 +239,7 @@ "requires" : ["java.logging"], "annotationProcessors" : ["truffle:TRUFFLE_DSL_PROCESSOR"], "checkstyle" : "com.oracle.truffle.tools.chromeinspector", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Tools", }, "com.oracle.truffle.tools.warmup" : { @@ -255,7 +255,7 @@ ], "annotationProcessors" : ["truffle:TRUFFLE_DSL_PROCESSOR"], "checkstyle" : "com.oracle.truffle.tools.chromeinspector", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Tools", }, "com.oracle.truffle.tools.warmup.test" : { @@ -268,7 +268,7 @@ ], "annotationProcessors" : ["truffle:TRUFFLE_DSL_PROCESSOR"], "checkstyle" : "com.oracle.truffle.tools.chromeinspector", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Tools", }, "org.graalvm.tools.api.lsp": { @@ -281,7 +281,7 @@ "jdk.unsupported", # sun.misc.Unsafe ], "checkstyle": "com.oracle.truffle.tools.chromeinspector", - "javaCompliance": "11+", + "javaCompliance" : "17+", "annotationProcessors": ["truffle:TRUFFLE_DSL_PROCESSOR"], "workingSets": "Tools", }, @@ -296,7 +296,7 @@ "java.logging", ], "checkstyle": "com.oracle.truffle.tools.chromeinspector", - "javaCompliance": "11+", + "javaCompliance" : "17+", "annotationProcessors": ["truffle:TRUFFLE_DSL_PROCESSOR"], "workingSets": "Tools", }, @@ -309,7 +309,7 @@ "mx:JUNIT" ], "checkstyle": "com.oracle.truffle.tools.chromeinspector", - "javaCompliance": "11+", + "javaCompliance" : "17+", "annotationProcessors": ["truffle:TRUFFLE_DSL_PROCESSOR"], "workingSets": "Tools", }, diff --git a/truffle/mx.truffle/suite.py b/truffle/mx.truffle/suite.py index b805683f3f04..a931f4d13453 100644 --- a/truffle/mx.truffle/suite.py +++ b/truffle/mx.truffle/suite.py @@ -199,7 +199,7 @@ # We need to force javac as JDT has a bug that JDT ignores SuppressWarnings # if warnings as errors is enabled. See GR-14683. "forceJavac" : "true", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "checkstyleVersion" : "8.36.1", "workingSets" : "API,Truffle", }, @@ -225,7 +225,7 @@ "com.oracle.truffle.api" ], "checkstyle" : "com.oracle.truffle.api", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "API,Truffle", }, @@ -243,7 +243,7 @@ ], "annotationProcessors" : ["TRUFFLE_DSL_PROCESSOR"], "checkstyle" : "com.oracle.truffle.api", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "API,Truffle", }, @@ -261,7 +261,7 @@ ], "annotationProcessors" : ["TRUFFLE_DSL_PROCESSOR"], "checkstyle" : "com.oracle.truffle.api", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "API,Truffle", }, @@ -289,24 +289,10 @@ ], }, "checkstyle" : "com.oracle.truffle.dsl.processor", - "javaCompliance" : "11+", - "annotationProcessors" : ["TRUFFLE_DSL_PROCESSOR"], - "workingSets" : "API,Truffle,Test", - "jacoco" : "exclude", - }, - - "com.oracle.truffle.api.test.jdk17": { - "subDir" : "src", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.truffle.api.test", - ], - "checkstyle": "com.oracle.truffle.api", "javaCompliance" : "17+", "annotationProcessors" : ["TRUFFLE_DSL_PROCESSOR"], "workingSets" : "API,Truffle,Test", "jacoco" : "exclude", - "testProject" : True, }, "com.oracle.truffle.api.benchmark" : { @@ -324,7 +310,7 @@ "java.base" : ["jdk.internal.loader"], }, "checkstyle" : "com.oracle.truffle.dsl.processor", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "spotbugsIgnoresGenerated" : True, "testProject" : True, "annotationProcessors" : ["mx:JMH_1_21", "TRUFFLE_DSL_PROCESSOR"], @@ -341,7 +327,7 @@ ], "checkstyle" : "com.oracle.truffle.api", "annotationProcessors" : ["TRUFFLE_DSL_PROCESSOR"], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "API,Truffle", }, @@ -354,7 +340,7 @@ "jdk.unsupported", # sun.misc.Unsafe ], "checkstyle" : "com.oracle.truffle.api", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "API,Truffle,Codegen", }, @@ -369,7 +355,7 @@ "mx:JUNIT", ], "checkstyle" : "com.oracle.truffle.dsl.processor", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "annotationProcessors" : ["TRUFFLE_DSL_PROCESSOR"], "workingSets" : "API,Truffle,Codegen,Test", "jacoco" : "exclude", @@ -389,7 +375,7 @@ "java.logging", ], "checkstyle" : "com.oracle.truffle.dsl.processor", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "annotationProcessors" : ["TRUFFLE_DSL_PROCESSOR"], "workingSets" : "API,Truffle,Codegen,Test", "jacoco" : "exclude", @@ -403,7 +389,7 @@ "sdk:POLYGLOT_TCK" ], "checkstyle" : "com.oracle.truffle.api", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "SimpleLanguage,Test", "jacoco" : "exclude", }, @@ -419,7 +405,7 @@ "jdk.management" ], "checkstyle" : "com.oracle.truffle.dsl.processor", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "checkstyleVersion" : "8.36.1", "workingSets" : "Truffle,Codegen", }, @@ -432,7 +418,7 @@ ], "annotationProcessors" : ["TRUFFLE_DSL_PROCESSOR"], "checkstyle" : "com.oracle.truffle.api", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "API,Truffle", }, @@ -444,7 +430,7 @@ ], "annotationProcessors" : ["TRUFFLE_DSL_PROCESSOR"], "checkstyle" : "com.oracle.truffle.api", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "API,Truffle", }, @@ -457,7 +443,7 @@ ], "checkstyle" : "com.oracle.truffle.api", "annotationProcessors" : ["TRUFFLE_DSL_PROCESSOR"], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "API,Truffle", }, @@ -474,7 +460,7 @@ ], "checkstyle" : "com.oracle.truffle.api", "annotationProcessors" : ["TRUFFLE_DSL_PROCESSOR"], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "API,Truffle", "jacoco" : "exclude", }, @@ -486,7 +472,7 @@ "generatedDependencies" : ["com.oracle.truffle.polyglot"], "checkstyle" : "com.oracle.truffle.api", "annotationProcessors" : ["TRUFFLE_DSL_PROCESSOR"], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "API,Truffle", }, @@ -502,7 +488,7 @@ ], "checkstyle" : "com.oracle.truffle.api", "annotationProcessors" : ["TRUFFLE_DSL_PROCESSOR"], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "API,Truffle", "testProject" : True, "jacoco" : "exclude", @@ -519,7 +505,7 @@ ], "annotationProcessors" : ["TRUFFLE_DSL_PROCESSOR"], "checkstyle" : "com.oracle.truffle.api", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "API,Truffle", }, @@ -541,7 +527,7 @@ }, "annotationProcessors" : ["TRUFFLE_DSL_PROCESSOR"], "checkstyle" : "com.oracle.truffle.api", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "API,Truffle", }, @@ -557,7 +543,7 @@ "jdk.unsupported", # sun.misc.Unsafe ], "checkstyle" : "com.oracle.truffle.api", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "annotationProcessors" : [ "TRUFFLE_DSL_PROCESSOR", "mx:JMH_1_21", @@ -582,36 +568,8 @@ "jdk.unsupported", # sun.misc.Unsafe ], "checkstyle" : "com.oracle.truffle.api", - "javaCompliance" : "11+", - "javadocType" : "api", - "workingSets" : "API,Truffle", - }, - - "com.oracle.truffle.api.staticobject.jdk11" : { - "subDir" : "src", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.truffle.api.staticobject" - ], - "overlayTarget" : "com.oracle.truffle.api.staticobject", - "checkPackagePrefix" : "false", - "multiReleaseJarVersion" : "11", - "checkstyle" : "com.oracle.truffle.api", - "javaCompliance" : "11+", - "workingSets" : "API,Truffle", - }, - - "com.oracle.truffle.api.staticobject.jdk17" : { - "subDir" : "src", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.truffle.api.staticobject" - ], - "overlayTarget" : "com.oracle.truffle.api.staticobject", - "checkPackagePrefix" : "false", - "multiReleaseJarVersion" : "17", - "checkstyle" : "com.oracle.truffle.api", "javaCompliance" : "17+", + "javadocType" : "api", "workingSets" : "API,Truffle", }, @@ -624,19 +582,6 @@ "mx:JUNIT" ], "checkstyle": "com.oracle.truffle.api", - "javaCompliance" : "11+", - "annotationProcessors" : ["TRUFFLE_DSL_PROCESSOR"], - "workingSets" : "API,Truffle,Test", - "testProject" : True, - }, - - "com.oracle.truffle.api.staticobject.test.jdk17": { - "subDir" : "src", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.truffle.api.staticobject.test", - ], - "checkstyle": "com.oracle.truffle.api", "javaCompliance" : "17+", "annotationProcessors" : ["TRUFFLE_DSL_PROCESSOR"], "workingSets" : "API,Truffle,Test", @@ -648,7 +593,7 @@ "sourceDirs" : ["src"], "dependencies" : ["com.oracle.truffle.api.dsl"], "checkstyle" : "com.oracle.truffle.api", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "API,Truffle", }, @@ -660,7 +605,7 @@ "jdk.unsupported", # sun.misc.Unsafe ], "checkstyle" : "com.oracle.truffle.api", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "annotationProcessors" : ["TRUFFLE_DSL_PROCESSOR"], "workingSets" : "Truffle", }, @@ -677,7 +622,7 @@ "jdk.unsupported", # GR-36880 ], "checkstyle" : "com.oracle.truffle.dsl.processor", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "annotationProcessors" : ["TRUFFLE_DSL_PROCESSOR"], "workingSets" : "Truffle", "testProject" : True, @@ -694,7 +639,7 @@ ], "annotationProcessors" : ["TRUFFLE_DSL_PROCESSOR"], "checkstyle" : "com.oracle.truffle.api", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Truffle,Tools", }, "com.oracle.truffle.tck.common" : { @@ -704,7 +649,7 @@ "sdk:POLYGLOT_TCK" ], "checkstyle" : "com.oracle.truffle.api", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Truffle,Tools", }, "com.oracle.truffle.tck.tests" : { @@ -716,7 +661,7 @@ "com.oracle.truffle.tck.common", ], "checkstyle" : "com.oracle.truffle.api", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Truffle,Tools", "testProject" : False, "jacoco" : "exclude", @@ -731,7 +676,7 @@ "jdk.unsupported", # sun.misc.Unsafe ], "checkstyle" : "com.oracle.truffle.api", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "annotationProcessors" : ["TRUFFLE_DSL_PROCESSOR"], "workingSets" : "Truffle,Test", "jacoco" : "exclude", @@ -747,7 +692,7 @@ ], "annotationProcessors" : ["TRUFFLE_DSL_PROCESSOR"], "checkstyle" : "com.oracle.truffle.api", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Truffle,Tools", }, @@ -760,7 +705,7 @@ ], "checkstyle" : "com.oracle.truffle.api", "spotbugsIgnoresGenerated" : True, - "javaCompliance" : "11+", + "javaCompliance" : "17+", "annotationProcessors" : ["TRUFFLE_DSL_PROCESSOR"], "workingSets" : "Truffle", }, @@ -772,7 +717,7 @@ "com.oracle.truffle.api.interop", ], "checkstyle" : "com.oracle.truffle.api", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "annotationProcessors" : ["TRUFFLE_DSL_PROCESSOR"], "workingSets" : "Truffle", }, @@ -789,7 +734,7 @@ "jdk.unsupported", # sun.misc.Unsafe ], "checkstyle" : "com.oracle.truffle.api", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "annotationProcessors" : ["TRUFFLE_DSL_PROCESSOR"], "workingSets" : "Truffle", "os_arch" : { @@ -813,7 +758,7 @@ "TRUFFLE_API", ], "checkstyle" : "com.oracle.truffle.api", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "annotationProcessors" : ["TRUFFLE_DSL_PROCESSOR"], "workingSets" : "Truffle", }, @@ -876,7 +821,7 @@ "jdk.unsupported", # sun.misc.Unsafe ], "checkstyle" : "com.oracle.truffle.api", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Truffle", "annotationProcessors" : ["TRUFFLE_DSL_PROCESSOR"], "javaProperties" : { @@ -954,7 +899,7 @@ "java.logging", "jdk.unsupported", # GR-36880 ], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "checkstyle" : "com.oracle.truffle.api", "annotationProcessors" : ["TRUFFLE_DSL_PROCESSOR"], "workingSets" : "Truffle,SimpleLanguage", @@ -967,7 +912,7 @@ "sdk:GRAAL_SDK", ], "checkstyle" : "com.oracle.truffle.api", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Truffle,SimpleLanguage", }, @@ -983,7 +928,7 @@ "java.logging", ], "checkstyle" : "com.oracle.truffle.api", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "Truffle,SimpleLanguage,Test", "annotationProcessors" : ["TRUFFLE_DSL_PROCESSOR", "mx:JMH_1_21"], "testProject" : True, @@ -996,7 +941,7 @@ "dependencies" : [ "TRUFFLE_API", ], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "checkstyleVersion" : "8.36.1", "annotationProcessors" : ["TRUFFLE_DSL_PROCESSOR"], "workingSets" : "Truffle,SimpleLanguage", @@ -1009,7 +954,7 @@ "mx:JUNIT", "com.oracle.truffle.st" ], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "checkstyle" : "com.oracle.truffle.api", "annotationProcessors" : ["TRUFFLE_DSL_PROCESSOR"], "workingSets" : "Truffle", @@ -1024,7 +969,7 @@ "truffle:TRUFFLE_API", ], "checkstyle" : "com.oracle.truffle.api", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "license": "GPLv2-CPE", "jacoco" : "exclude", }, @@ -1106,7 +1051,7 @@ ], }, "subDir" : "src", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "dependencies" : [ "com.oracle.truffle.api", "com.oracle.truffle.api.exception", @@ -1143,7 +1088,7 @@ } }, "subDir" : "src", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "dependencies" : [ "com.oracle.truffle.nfi", ], @@ -1167,7 +1112,7 @@ } }, "subDir" : "src", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "dependencies" : [ "com.oracle.truffle.nfi.backend.libffi", ], @@ -1202,7 +1147,7 @@ "TRUFFLE_TCK" : { "subDir" : "src", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "dependencies" : [ "com.oracle.truffle.tck" ], @@ -1217,7 +1162,7 @@ "TRUFFLE_TCK_COMMON" : { "subDir" : "src", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "dependencies" : [ "com.oracle.truffle.tck.common" ], @@ -1230,7 +1175,7 @@ "TRUFFLE_TCK_TESTS" : { "subDir" : "src", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "dependencies" : [ "com.oracle.truffle.tck.tests" ], @@ -1247,7 +1192,7 @@ "TRUFFLE_TCK_TESTS_LANGUAGE" : { "subDir" : "src", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "dependencies" : [ "com.oracle.truffle.tck.tests.language" ], @@ -1262,7 +1207,7 @@ "TRUFFLE_TCK_INSTRUMENTATION" : { "subDir" : "src", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "dependencies" : [ "com.oracle.truffle.tck.instrumentation" ], @@ -1286,7 +1231,7 @@ "TRUFFLE_SL" : { "subDir" : "src", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "dependencies" : [ "com.oracle.truffle.sl", ], @@ -1304,7 +1249,7 @@ "TRUFFLE_SL_LAUNCHER" : { "subDir" : "src", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "dependencies" : [ "com.oracle.truffle.sl.launcher", ], @@ -1317,7 +1262,7 @@ "TRUFFLE_SL_TEST" : { "subDir" : "src", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "dependencies" : [ "com.oracle.truffle.sl.test" ], @@ -1335,7 +1280,7 @@ "TRUFFLE_SL_TCK" : { "subDir" : "src", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "dependencies" : [ "com.oracle.truffle.sl.tck" ], @@ -1351,7 +1296,7 @@ "TRUFFLE_ST" : { "subDir" : "src", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "dependencies" : [ "com.oracle.truffle.st", ], @@ -1368,7 +1313,7 @@ "TRUFFLE_ST_TEST" : { "subDir" : "src", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "dependencies" : [ "com.oracle.truffle.st.test" ], @@ -1384,7 +1329,7 @@ "TRUFFLE_TEST" : { "subDir" : "src", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "dependencies" : [ "com.oracle.truffle.api.test", "com.oracle.truffle.api.benchmark", @@ -1419,21 +1364,6 @@ "maven" : False, }, - "TRUFFLE_TEST_17" : { - "subDir" : "src", - "javaCompliance" : "17+", - "dependencies" : [ - "com.oracle.truffle.api.staticobject.test.jdk17", - "com.oracle.truffle.api.test.jdk17", - ], - "exclude" : ["mx:HAMCREST", "mx:JUNIT", "mx:JMH_1_21"], - "distDependencies" : [ - "TRUFFLE_TEST", - ], - "testDistribution" : True, - "maven" : False, - }, - "TRUFFLE_TEST_NATIVE" : { "native" : True, "platformDependent" : True, diff --git a/truffle/src/com.oracle.truffle.api.staticobject.jdk11/src/com/oracle/truffle/api/staticobject/StaticPropertyValidator.java b/truffle/src/com.oracle.truffle.api.staticobject.jdk11/src/com/oracle/truffle/api/staticobject/StaticPropertyValidator.java deleted file mode 100644 index a23f2b0ffd4b..000000000000 --- a/truffle/src/com.oracle.truffle.api.staticobject.jdk11/src/com/oracle/truffle/api/staticobject/StaticPropertyValidator.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2021, 2021, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * The Universal Permissive License (UPL), Version 1.0 - * - * Subject to the condition set forth below, permission is hereby granted to any - * person obtaining a copy of this software, associated documentation and/or - * data (collectively the "Software"), free of charge and under any and all - * copyright rights in the Software, and any and all patent rights owned or - * freely licensable by each licensor hereunder covering either (i) the - * unmodified Software as contributed to or provided by such licensor, or (ii) - * the Larger Works (as defined below), to deal in both - * - * (a) the Software, and - * - * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if - * one is included with the Software each a "Larger Work" to which the Software - * is contributed by such licensors), - * - * without restriction, including without limitation the rights to copy, create - * derivative works of, display, perform, and distribute the Software and make, - * use, sell, offer for sale, import, export, have made, and have sold the - * Software and the Larger Work(s), and to sublicense the foregoing rights on - * either these or other terms. - * - * This license is subject to the following condition: - * - * The above copyright notice and either this complete permission notice or at a - * minimum a reference to the UPL must be included in all copies or substantial - * portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -package com.oracle.truffle.api.staticobject; - -class StaticPropertyValidator { - static void validate(Class type) { - if (type.isAnonymousClass()) { - throw new IllegalArgumentException("Cannot use an anonymous class as type of a static property"); - } - } -} diff --git a/truffle/src/com.oracle.truffle.api.staticobject.jdk17/src/com/oracle/truffle/api/staticobject/StaticPropertyValidator.java b/truffle/src/com.oracle.truffle.api.staticobject.jdk17/src/com/oracle/truffle/api/staticobject/StaticPropertyValidator.java deleted file mode 100644 index ef6fea62254a..000000000000 --- a/truffle/src/com.oracle.truffle.api.staticobject.jdk17/src/com/oracle/truffle/api/staticobject/StaticPropertyValidator.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2021, 2021, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * The Universal Permissive License (UPL), Version 1.0 - * - * Subject to the condition set forth below, permission is hereby granted to any - * person obtaining a copy of this software, associated documentation and/or - * data (collectively the "Software"), free of charge and under any and all - * copyright rights in the Software, and any and all patent rights owned or - * freely licensable by each licensor hereunder covering either (i) the - * unmodified Software as contributed to or provided by such licensor, or (ii) - * the Larger Works (as defined below), to deal in both - * - * (a) the Software, and - * - * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if - * one is included with the Software each a "Larger Work" to which the Software - * is contributed by such licensors), - * - * without restriction, including without limitation the rights to copy, create - * derivative works of, display, perform, and distribute the Software and make, - * use, sell, offer for sale, import, export, have made, and have sold the - * Software and the Larger Work(s), and to sublicense the foregoing rights on - * either these or other terms. - * - * This license is subject to the following condition: - * - * The above copyright notice and either this complete permission notice or at a - * minimum a reference to the UPL must be included in all copies or substantial - * portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -package com.oracle.truffle.api.staticobject; - -class StaticPropertyValidator { - static void validate(Class type) { - String msg = null; - if (type.isAnonymousClass()) { - msg = "Cannot use an anonymous class as type of a static property"; - } else if (type.isHidden()) { - msg = "Cannot use a hidden class as type of a static property"; - } - - if (msg != null) { - throw new IllegalArgumentException(msg); - } - } -} diff --git a/truffle/src/com.oracle.truffle.api.staticobject.test.jdk17/src/com/oracle/truffle/api/staticobject/test/HiddenClassGenerator.java b/truffle/src/com.oracle.truffle.api.staticobject.test/src/com/oracle/truffle/api/staticobject/test/HiddenClassGenerator.java similarity index 100% rename from truffle/src/com.oracle.truffle.api.staticobject.test.jdk17/src/com/oracle/truffle/api/staticobject/test/HiddenClassGenerator.java rename to truffle/src/com.oracle.truffle.api.staticobject.test/src/com/oracle/truffle/api/staticobject/test/HiddenClassGenerator.java diff --git a/truffle/src/com.oracle.truffle.api.staticobject.test.jdk17/src/com/oracle/truffle/api/staticobject/test/HiddenClassProperty.java b/truffle/src/com.oracle.truffle.api.staticobject.test/src/com/oracle/truffle/api/staticobject/test/HiddenClassProperty.java similarity index 100% rename from truffle/src/com.oracle.truffle.api.staticobject.test.jdk17/src/com/oracle/truffle/api/staticobject/test/HiddenClassProperty.java rename to truffle/src/com.oracle.truffle.api.staticobject.test/src/com/oracle/truffle/api/staticobject/test/HiddenClassProperty.java diff --git a/truffle/src/com.oracle.truffle.api.staticobject/src/com/oracle/truffle/api/staticobject/StaticPropertyValidator.java b/truffle/src/com.oracle.truffle.api.staticobject/src/com/oracle/truffle/api/staticobject/StaticPropertyValidator.java index da11326ad1f7..a7396248be23 100644 --- a/truffle/src/com.oracle.truffle.api.staticobject/src/com/oracle/truffle/api/staticobject/StaticPropertyValidator.java +++ b/truffle/src/com.oracle.truffle.api.staticobject/src/com/oracle/truffle/api/staticobject/StaticPropertyValidator.java @@ -43,6 +43,15 @@ class StaticPropertyValidator { @SuppressWarnings("unused") static void validate(Class type) { - throw new InternalError("JDK specific overlay for " + StaticPropertyValidator.class.getName() + " missing"); + String msg = null; + if (type.isAnonymousClass()) { + msg = "Cannot use an anonymous class as type of a static property"; + } else if (type.isHidden()) { + msg = "Cannot use a hidden class as type of a static property"; + } + + if (msg != null) { + throw new IllegalArgumentException(msg); + } } } diff --git a/truffle/src/com.oracle.truffle.api.test.jdk17/src/META-INF/native-image/native-image.properties b/truffle/src/com.oracle.truffle.api.test.jdk17/src/META-INF/native-image/native-image.properties deleted file mode 100644 index 395cc6dc008a..000000000000 --- a/truffle/src/com.oracle.truffle.api.test.jdk17/src/META-INF/native-image/native-image.properties +++ /dev/null @@ -1 +0,0 @@ -Args = -H:Features=com.oracle.truffle.api.test.polyglot.RegisterJDK17TestClassesForReflectionFeature diff --git a/truffle/src/com.oracle.truffle.api.test.jdk17/src/com/oracle/truffle/api/test/polyglot/RegisterJDK17TestClassesForReflectionFeature.java b/truffle/src/com.oracle.truffle.api.test.jdk17/src/com/oracle/truffle/api/test/polyglot/RegisterJDK17TestClassesForReflectionFeature.java deleted file mode 100644 index 94e41c231a2d..000000000000 --- a/truffle/src/com.oracle.truffle.api.test.jdk17/src/com/oracle/truffle/api/test/polyglot/RegisterJDK17TestClassesForReflectionFeature.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * The Universal Permissive License (UPL), Version 1.0 - * - * Subject to the condition set forth below, permission is hereby granted to any - * person obtaining a copy of this software, associated documentation and/or - * data (collectively the "Software"), free of charge and under any and all - * copyright rights in the Software, and any and all patent rights owned or - * freely licensable by each licensor hereunder covering either (i) the - * unmodified Software as contributed to or provided by such licensor, or (ii) - * the Larger Works (as defined below), to deal in both - * - * (a) the Software, and - * - * (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if - * one is included with the Software each a "Larger Work" to which the Software - * is contributed by such licensors), - * - * without restriction, including without limitation the rights to copy, create - * derivative works of, display, perform, and distribute the Software and make, - * use, sell, offer for sale, import, export, have made, and have sold the - * Software and the Larger Work(s), and to sublicense the foregoing rights on - * either these or other terms. - * - * This license is subject to the following condition: - * - * The above copyright notice and either this complete permission notice or at a - * minimum a reference to the UPL must be included in all copies or substantial - * portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -package com.oracle.truffle.api.test.polyglot; - -import java.util.List; - -/** - * Register all named inner classes under {@link #TEST_CLASSES} for reflection, so that they - * do not need to be listed in {@code reflection.json}. Anonymous inner classes however must be - * listed in {@code reflection.json}, as Java provides no way to list those. - */ -public class RegisterJDK17TestClassesForReflectionFeature extends RegisterTestClassesForReflectionFeature { - - private static final List> TEST_CLASSES = List.of(HostRecordAccessTest.class); - - @Override - public void beforeAnalysis(BeforeAnalysisAccess access) { - for (Class testClass : TEST_CLASSES) { - for (Class innerClass : testClass.getDeclaredClasses()) { - registerClass(innerClass); - } - } - } - -} diff --git a/truffle/src/com.oracle.truffle.api.test.jdk17/src/com/oracle/truffle/api/test/polyglot/HostRecordAccessTest.java b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/HostRecordAccessTest.java similarity index 100% rename from truffle/src/com.oracle.truffle.api.test.jdk17/src/com/oracle/truffle/api/test/polyglot/HostRecordAccessTest.java rename to truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/HostRecordAccessTest.java diff --git a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/RegisterTestClassesForReflectionFeature.java b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/RegisterTestClassesForReflectionFeature.java index 548038c36fa6..b90ae6f2942f 100644 --- a/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/RegisterTestClassesForReflectionFeature.java +++ b/truffle/src/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/polyglot/RegisterTestClassesForReflectionFeature.java @@ -63,6 +63,7 @@ public class RegisterTestClassesForReflectionFeature implements Feature { PolyglotExceptionTest.class, LanguageSPIHostInteropTest.class, HostAccessTest.class, + HostRecordAccessTest.class, ExposeToGuestTest.class, ContextAPITest.class, GR40903Outer.class, diff --git a/vm/mx.vm/suite.py b/vm/mx.vm/suite.py index 7f66c6ca9b9d..bdcdc1bf3359 100644 --- a/vm/mx.vm/suite.py +++ b/vm/mx.vm/suite.py @@ -97,7 +97,7 @@ "org.graalvm.component.installer" : { "subDir" : "src", "sourceDirs" : ["src"], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "license" : "GPLv2-CPE", "checkstyleVersion" : "8.36.1", "dependencies": [ @@ -113,7 +113,7 @@ "mx:JUNIT", "org.graalvm.component.installer" ], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "checkstyle": "org.graalvm.component.installer", "license" : "GPLv2-CPE", "requires" : ["java.logging"], @@ -121,7 +121,7 @@ "org.graalvm.polybench" : { "subDir" : "src", "sourceDirs" : ["src"], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "license" : "GPLv2-CPE", "checkstyle": "org.graalvm.component.installer", "dependencies": [ @@ -136,7 +136,7 @@ "org.graalvm.polybench.micro" : { "subDir" : "src", "sourceDirs" : ["src"], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "license" : "GPLv2-CPE", "checkstyle": "org.graalvm.component.installer", "dependencies": [ @@ -150,7 +150,7 @@ "org.graalvm.polybench.instruments" : { "subDir" : "src", "sourceDirs" : ["src"], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "license" : "GPLv2-CPE", "checkstyle": "org.graalvm.component.installer", "dependencies": [ diff --git a/wasm/mx.wasm/suite.py b/wasm/mx.wasm/suite.py index eda34b554a60..e83b911b6967 100644 --- a/wasm/mx.wasm/suite.py +++ b/wasm/mx.wasm/suite.py @@ -91,7 +91,7 @@ "jdk.unsupported", # sun.misc.Unsafe ], "checkstyleVersion" : "8.8", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "annotationProcessors" : ["truffle:TRUFFLE_DSL_PROCESSOR"], "workingSets" : "WebAssembly", "license" : "UPL", @@ -104,7 +104,7 @@ "sdk:LAUNCHER_COMMON", ], "checkstyle" : "org.graalvm.wasm", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "license" : "UPL", }, @@ -116,7 +116,7 @@ "truffle:TRUFFLE_API", ], "checkstyle" : "org.graalvm.wasm", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "annotationProcessors" : ["truffle:TRUFFLE_DSL_PROCESSOR"], "workingSets" : "WebAssembly", "license" : "BSD-new", @@ -133,7 +133,7 @@ "mx:JUNIT", ], "checkstyle" : "org.graalvm.wasm", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "annotationProcessors" : ["truffle:TRUFFLE_DSL_PROCESSOR"], "workingSets" : "WebAssembly", "license" : "BSD-new", @@ -159,7 +159,7 @@ "mx:JUNIT", ], "checkstyle" : "org.graalvm.wasm", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "workingSets" : "WebAssembly", "testProject" : True, "defaultBuild" : False, @@ -185,7 +185,7 @@ "mx:JMH_1_21", ], "checkstyle" : "org.graalvm.wasm", - "javaCompliance" : "11+", + "javaCompliance" : "17+", "annotationProcessors" : ["mx:JMH_1_21"], "workingSets" : "WebAssembly", "testProject" : True, @@ -200,7 +200,7 @@ "org.graalvm.wasm.utils", "mx:JMH_1_21", ], - "javaCompliance" : "11+", + "javaCompliance" : "17+", "annotationProcessors" : ["mx:JMH_1_21"], "testProject" : True, }, @@ -213,7 +213,7 @@ "JOL", ], "workingSets": "WebAssembly", - "javaCompliance": "11+", + "javaCompliance" : "17+", "defaultBuild": False, } },