Skip to content

[GR-61366] Espresso: support for guest 25. #11216

New issue

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

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

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions espresso/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
### User-visible changes
* Added experimental support for JVMCI. It can be enabled with the `java.EnableJVMCI` option.
* Added experimentation support for `-javaagent`. It can also be enabled from the polyglot API with `java.JavaAgent.$i` option set to `/path/to/jar=agent-options` where `$i` starts at 0 and increments by 1 for each extra java agent.
* Added support for guest Java version 25.

## Version 24.2.0
### User-visible changes
Expand Down
5 changes: 4 additions & 1 deletion espresso/ci/ci_common/common.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ local benchmark_suites = ['dacapo', 'renaissance', 'scala-dacapo'];

linux_amd64_graalvm21: self.espresso_jdk_21 + graal_common.graalvmee21 + self.espresso_jdk_21_llvm + self.linux_amd64,

linux_amd64_latest:graal_common.labsjdkLatest + self.linux_amd64,

// precise targets and capabilities
jdk21_gate_linux_amd64 : self.gate + self.linux_amd64_21,
jdk21_gate_linux_aarch64 : self.gate + self.linux_aarch64_21,
Expand Down Expand Up @@ -158,7 +160,8 @@ local benchmark_suites = ['dacapo', 'renaissance', 'scala-dacapo'];
jdk21_on_demand_bench_linux : self.onDemandBench + self.linux_amd64_21 + self.x52,
jdk21_on_demand_bench_darwin : self.onDemandBench + self.darwin_amd64_21,
jdk21_on_demand_bench_windows : self.onDemandBench + self.windows_21,

jdkLatest_weekly_linux_amd64 : self.weekly + self.linux_amd64_latest,

// shared snippets
eclipse: graal_common.deps.eclipse,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,15 @@ public static final class VersionRange {
public static final VersionRange VERSION_19_OR_HIGHER = higher(19);
public static final VersionRange VERSION_20_OR_LOWER = lower(20);
public static final VersionRange VERSION_21_OR_HIGHER = higher(21);
public static final VersionRange ALL = new VersionRange(0, LATEST_SUPPORTED);
public static final VersionRange VERSION_21_OR_LOWER = lower(21);
public static final VersionRange VERSION_22_OR_HIGHER = higher(22);
public static final VersionRange VERSION_24_OR_LOWER = lower(24);
public static final VersionRange VERSION_25_OR_HIGHER = higher(25);

public static final VersionRange ALL = between(0, LATEST_SUPPORTED);
public static final VersionRange VERSION_9_TO_21 = between(9, 21);
public static final VersionRange VERSION_9_TO_23 = between(9, 23);
public static final VersionRange VERSION_22_TO_23 = between(22, 23);

private final int low;
private final int high;
Expand All @@ -55,14 +63,18 @@ public static VersionRange higher(int version) {
return new VersionRange(version, LATEST_SUPPORTED);
}

public static VersionRange between(int low, int high) {
return new VersionRange(low, high);
}

public boolean contains(JavaVersion version) {
return version.inRange(low, high);
}
}

public static final JavaVersion HOST_VERSION = forVersion(Runtime.version());

public static final int LATEST_SUPPORTED = 21;
public static final int LATEST_SUPPORTED = 25;

private final int version;

Expand Down Expand Up @@ -172,6 +184,26 @@ public boolean java21OrLater() {
return version >= 21;
}

public boolean java21OrEarlier() {
return version <= 21;
}

public boolean java22OrLater() {
return version >= 22;
}

public boolean java23OrEarlier() {
return version <= 23;
}

public boolean java24OrEarlier() {
return version <= 24;
}

public boolean java25OrLater() {
return version >= 25;
}

public boolean inRange(int low, int high) {
return version >= low && version <= high;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ protected List<String> preprocessArguments(List<String> arguments, Map<String, S
case "--enable-native-access":
parseNumberedOption(args, "java.EnableNativeAccess", "module");
break;
case "--illegal-native-access":
espressoOptions.put("java.IllegalNativeAccess", args.getValue(arg, "illegal native access"));
break;
case "-m":
case "--module":
/* This arguments specifies in which module we find the main class. */
Expand Down Expand Up @@ -273,10 +276,6 @@ protected List<String> preprocessArguments(List<String> arguments, Map<String, S
case "-Xshare:off":
// ignore
break;
case "-XX:+UseJVMCICompiler":
case "-XX:-UseJVMCICompiler":
getError().println("Ignoring " + arg);
break;

case "-XX:+PauseOnExit":
pauseOnExit = true;
Expand Down Expand Up @@ -432,6 +431,10 @@ private void parseArgFile(String pathArg, List<String> expanded) {
"WhiteBoxAPI",
"EnableJVMCI");

private static final Set<String> ignoredXXOptions = Set.of(
"UseJVMCICompiler",
"EnableDynamicAgentLoading");

private void handleXXArg(String fullArg, ArrayList<String> unrecognized) {
String arg = fullArg.substring("-XX:".length());
String name;
Expand All @@ -448,6 +451,10 @@ private void handleXXArg(String fullArg, ArrayList<String> unrecognized) {
name = arg.substring(0, idx);
value = arg.substring(idx + 1);
}
if (ignoredXXOptions.contains(name)) {
getError().println("Ignoring " + arg);
return;
}
if (knownPassThroughOptions.contains(name)) {
espressoOptions.put("java." + name, value);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ private Arguments() {
"TieredStopAtLevel",
"MaxMetaspaceSize",
"HeapDumpOnOutOfMemoryError",
"UseJVMCICompiler");
"UseJVMCICompiler",
"EnableDynamicAgentLoading");

private static final Map<String, String> MAPPED_XX_OPTIONS = Map.of(
"TieredCompilation", "engine.MultiTier");
Expand Down Expand Up @@ -181,6 +182,8 @@ public static int setupContext(Context.Builder builder, JNIJavaVMInitArgs args,
handler.addModules(optionString.substring("--add-modules=".length()));
} else if (optionString.startsWith("--enable-native-access=")) {
handler.enableNativeAccess(optionString.substring("--enable-native-access=".length()));
} else if (optionString.startsWith("--illegal-native-access=")) {
builder.option("java.IllegalNativeAccess", optionString.substring("--illegal-native-access=".length()));
} else if (optionString.startsWith("--module-path=")) {
builder.option("java.ModulePath", optionString.substring("--module-path=".length()));
} else if (optionString.startsWith("--upgrade-module-path=")) {
Expand Down
Loading
Loading