Skip to content

Commit cfd323b

Browse files
[GR-40518] [GR-42735] [GR-42122] [GR-42231] Espresso: Java 19 & 20 support.
PullRequest: graal/13566
2 parents f1da8dd + 985d6e0 commit cfd323b

File tree

82 files changed

+1102
-736
lines changed

Some content is hidden

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

82 files changed

+1102
-736
lines changed

compiler/src/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/CachingPEGraphDecoder.java

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -197,16 +197,13 @@ protected EncodedGraph lookupEncodedGraph(ResolvedJavaMethod method, BytecodePro
197197
return result;
198198
}
199199

200-
result = persistentGraphCache.get(method);
201-
if (result == null) {
202-
result = lookupOrCreatePersistentEncodedGraph(method, intrinsicBytecodeProvider);
203-
// Cached graph from previous compilation may not have source positions, re-parse and
204-
// store in compilation-local cache.
205-
if (result != null && !result.trackNodeSourcePosition() && graph.trackNodeSourcePosition()) {
206-
assert method.hasBytecodes();
207-
result = createGraph(method, intrinsicBytecodeProvider);
208-
assert result.trackNodeSourcePosition();
209-
}
200+
result = lookupOrCreatePersistentEncodedGraph(method, intrinsicBytecodeProvider);
201+
// Cached graph from previous compilation may not have source positions, re-parse and
202+
// store in compilation-local cache.
203+
if (result != null && !result.trackNodeSourcePosition() && graph.trackNodeSourcePosition()) {
204+
assert method.hasBytecodes();
205+
result = createGraph(method, intrinsicBytecodeProvider);
206+
assert result.trackNodeSourcePosition();
210207
}
211208

212209
if (result != null) {

compiler/src/org.graalvm.compiler.truffle.compiler/src/org/graalvm/compiler/truffle/compiler/phases/inlining/TrivialOnlyInliningPolicy.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ public void run(CallTree tree) {
4343
}
4444
if (child.isTrivial()) {
4545
child.expand();
46-
child.inline();
46+
if (child.getState() == CallNode.State.Expanded) {
47+
child.inline();
48+
}
4749
}
4850
}
4951
}

espresso/ci/ci_common/common.jsonnet

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ local benchmark_suites = ['dacapo', 'renaissance', 'scala-dacapo'];
8888
jdk17_on_demand_bench_windows : graal_common.labsjdk17 + self.onDemandBench + base.windows_17,
8989

9090
jdk19_gate_linux : graal_common.labsjdk19 + graal_common.labsjdk19LLVM + self.gate + self.linux,
91+
jdk19_weekly_linux : graal_common.labsjdk19 + graal_common.labsjdk19LLVM + self.weekly + self.linux,
92+
93+
jdk20_gate_linux : graal_common.labsjdk20 + graal_common.labsjdk20LLVM + self.gate + self.linux,
94+
jdk20_daily_linux : graal_common.labsjdk20 + graal_common.labsjdk20LLVM + self.daily + self.linux,
9195

9296
// shared snippets
9397
eclipse: {

espresso/src/com.oracle.truffle.espresso.mokapot/include/jni.h

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1996, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -768,6 +768,11 @@ struct JNINativeInterface_ {
768768

769769
jobject (JNICALL *GetModule)
770770
(JNIEnv* env, jclass clazz);
771+
772+
/* Virtual threads */
773+
774+
jboolean (JNICALL *IsVirtualThread)
775+
(JNIEnv* env, jobject obj);
771776
};
772777

773778
/*
@@ -1866,9 +1871,29 @@ struct JNIEnv_ {
18661871
return functions->GetModule(this, clazz);
18671872
}
18681873

1874+
/* Virtual threads */
1875+
1876+
jboolean IsVirtualThread(jobject obj) {
1877+
return functions->IsVirtualThread(this, obj);
1878+
}
1879+
18691880
#endif /* __cplusplus */
18701881
};
18711882

1883+
/*
1884+
* optionString may be any option accepted by the JVM, or one of the
1885+
* following:
1886+
*
1887+
* -D<name>=<value> Set a system property.
1888+
* -verbose[:class|gc|jni] Enable verbose output, comma-separated. E.g.
1889+
* "-verbose:class" or "-verbose:gc,class"
1890+
* Standard names include: gc, class, and jni.
1891+
* All nonstandard (VM-specific) names must begin
1892+
* with "X".
1893+
* vfprintf extraInfo is a pointer to the vfprintf hook.
1894+
* exit extraInfo is a pointer to the exit hook.
1895+
* abort extraInfo is a pointer to the abort hook.
1896+
*/
18721897
typedef struct JavaVMOption {
18731898
char *optionString;
18741899
void *extraInfo;
@@ -1963,6 +1988,8 @@ JNI_OnUnload(JavaVM *vm, void *reserved);
19631988
#define JNI_VERSION_1_8 0x00010008
19641989
#define JNI_VERSION_9 0x00090000
19651990
#define JNI_VERSION_10 0x000a0000
1991+
#define JNI_VERSION_19 0x00130000
1992+
#define JNI_VERSION_20 0x00140000
19661993

19671994
#ifdef __cplusplus
19681995
} /* extern "C" */

0 commit comments

Comments
 (0)