Skip to content

Commit 73d51f5

Browse files
committed
Merge branch 'master' into build-with-19-loom
2 parents fcf5e54 + 7c8b40c commit 73d51f5

File tree

85 files changed

+1709
-462
lines changed

Some content is hidden

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

85 files changed

+1709
-462
lines changed

compiler/mx.compiler/suite.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2043,7 +2043,7 @@
20432043
"org.graalvm.compiler.core.common to jdk.internal.vm.compiler.management,org.graalvm.nativeimage.agent.tracing,org.graalvm.nativeimage.objectfile",
20442044
"org.graalvm.compiler.debug to jdk.internal.vm.compiler.management,org.graalvm.nativeimage.objectfile",
20452045
"org.graalvm.compiler.hotspot to jdk.internal.vm.compiler.management",
2046-
"org.graalvm.compiler.nodes.graphbuilderconf to org.graalvm.nativeimage.driver",
2046+
"org.graalvm.compiler.nodes.graphbuilderconf to org.graalvm.nativeimage.driver,org.graalvm.nativeimage.librarysupport",
20472047
"org.graalvm.compiler.options to jdk.internal.vm.compiler.management,org.graalvm.nativeimage.driver,org.graalvm.nativeimage.junitsupport",
20482048
"org.graalvm.compiler.phases.common to org.graalvm.nativeimage.agent.tracing,org.graalvm.nativeimage.configure",
20492049
"org.graalvm.compiler.serviceprovider to jdk.internal.vm.compiler.management,org.graalvm.nativeimage.driver,org.graalvm.nativeimage.agent.jvmtibase,org.graalvm.nativeimage.agent.diagnostics",

compiler/src/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GraphDecoder.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,11 @@ protected final void decode(LoopScope initialLoopScope) {
558558
} else {
559559
propagateCreatedNodes(loopScope);
560560
loopScope = loopScope.outer;
561+
562+
if (loopScope == null) {
563+
// finished all loops of a method
564+
afterMethodScope(methodScope);
565+
}
561566
}
562567
}
563568

@@ -577,6 +582,9 @@ protected final void decode(LoopScope initialLoopScope) {
577582
}
578583
}
579584

585+
protected void afterMethodScope(@SuppressWarnings("unused") MethodScope methodScope) {
586+
}
587+
580588
protected void finishInlining(@SuppressWarnings("unused") MethodScope inlineScope) {
581589
}
582590

compiler/src/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraphPrinterDumpHandler.java

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -264,14 +264,25 @@ private List<String> getInlineContext(Graph graph) {
264264
lastMethodOrGraph = o;
265265
}
266266
}
267-
// Truffle compilations don't have a standard inline context.
268-
// Since TruffleDebugJavaMethod specifies the declaring class for truffle compilations
269-
// as "LTruffleGraal" we identify truffle compilations as starting with "TruffleGraal"
270-
if (result.size() == 2 && result.get(1).startsWith("TruffleGraal")) {
271-
String name = result.get(1).replace("TruffleGraal.", "TruffleIR::");
272-
result.clear();
273-
result.add(name);
267+
268+
for (int i = 0; i < result.size(); i++) {
269+
/*
270+
* Truffle compilations don't have a standard inline context. Since
271+
* TruffleDebugJavaMethod specifies the declaring class for truffle compilations as
272+
* "LTruffleGraal" we identify truffle compilations as starting with "TruffleGraal"
273+
*/
274+
String name = result.get(i);
275+
String search = "TruffleGraal.";
276+
if (name.startsWith(search)) {
277+
result.set(i, "TruffleIR::" + name.substring(search.length(), name.length()));
278+
if (i > 0) {
279+
// we can drop previous entry which is just profiledPERoot
280+
result.remove(i - 1);
281+
}
282+
break;
283+
}
274284
}
285+
275286
if (result.isEmpty()) {
276287
result.add(graph.toString());
277288
graphSeen = true;

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

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,10 +1044,6 @@ protected boolean tryInvocationPlugin(PEMethodScope methodScope, LoopScope loopS
10441044
return false;
10451045
}
10461046

1047-
if (loopScope.methodScope.encodedGraph.isCallToOriginal(targetMethod)) {
1048-
return false;
1049-
}
1050-
10511047
ValueNode[] arguments = callTarget.arguments().toArray(ValueNode.EMPTY_ARRAY);
10521048
FixedWithNextNode invokePredecessor = (FixedWithNextNode) invoke.asNode().predecessor();
10531049

@@ -1206,6 +1202,17 @@ protected LoopScope doInline(PEMethodScope methodScope, LoopScope loopScope, Inv
12061202
return inlineLoopScope;
12071203
}
12081204

1205+
@Override
1206+
protected void afterMethodScope(MethodScope methodScope) {
1207+
/*
1208+
* The graph should be in a valid state after a method scope was completed. Revisit this
1209+
* assumption if there are any crashes during dumping.
1210+
*/
1211+
if (debug.isDumpEnabled(DebugContext.VERY_DETAILED_LEVEL)) {
1212+
debug.dump(DebugContext.VERY_DETAILED_LEVEL, graph, "After PE %s", ((PEMethodScope) methodScope).method.format("%H.%n"));
1213+
}
1214+
}
1215+
12091216
@Override
12101217
protected void finishInlining(MethodScope is) {
12111218
PEMethodScope inlineScope = (PEMethodScope) is;

docs/reference-manual/native-image/BuildOutput.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ Top 10 packages in code area: Top 10 object types in image heap:
4646
97.42KB java.util.logging 139.54KB byte[] for embedded resources
4747
95.18KB c.oracle.svm.core.genscavenge 139.04KB char[]
4848
1.83MB for 118 more packages 1.29MB for 753 more object types
49-
(use GraalVM Dashboard to see all)
5049
--------------------------------------------------------------------------------
5150
0.9s (5.6% of total time) in 17 GCs | Peak RSS: 3.22GB | CPU load: 10.87
5251
--------------------------------------------------------------------------------

java-benchmarks/mx.java-benchmarks/mx_java_benchmarks.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,11 @@ def extra_image_build_argument(self, benchmark, args):
371371
'-H:EnableURLProtocols=http',
372372
'-H:NativeLinkerOption=-no-pie',
373373
'-H:-UseServiceLoaderFeature',
374+
'--add-exports=org.graalvm.nativeimage.base/com.oracle.svm.util=ALL-UNNAMED',
375+
'--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.configure=ALL-UNNAMED',
376+
'--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk.localization=ALL-UNNAMED',
377+
'--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk=ALL-UNNAMED',
378+
'--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.threadlocal=ALL-UNNAMED',
374379
'-H:+StackTrace'] + super(BaseQuarkusBenchmarkSuite, self).extra_image_build_argument(benchmark, args)
375380

376381

@@ -460,6 +465,11 @@ def build_assertions(self, benchmark, is_gate):
460465
# This method overrides NativeImageMixin.build_assertions
461466
return [] # We are skipping build assertions due to some failed asserts while building Micronaut apps.
462467

468+
def extra_image_build_argument(self, benchmark, args):
469+
return [
470+
'--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk=ALL-UNNAMED',
471+
] + super(BaseMicronautBenchmarkSuite, self).extra_image_build_argument(benchmark, args)
472+
463473
def default_stages(self):
464474
return ['instrument-image', 'instrument-run', 'image', 'run']
465475

sdk/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
This changelog summarizes major changes between GraalVM SDK versions. The main focus is on APIs exported by GraalVM SDK.
44

55
## Version 22.2.0
6+
* (GR-38925) Added `Value.hasMetaParents() and Value.getMetaParents()` that allow lookup of the hierarchy of parents for meta objects (e.g. super class or implemented interface of Java classes).
67
* (GR-38351) Added [FileSystem#allowLanguageHomeAccess](https://www.graalvm.org/sdk/javadoc/org/graalvm/polyglot/io/FileSystem.html#allowLanguageHomeAccess-org.graalvm.polyglot.io.FileSystem-) returning a `FileSystem` that forwards access to files in the language home to the default file system.
78
* (GR-38351) Added [FileSystem#newReadOnlyFileSystem](https://www.graalvm.org/sdk/javadoc/org/graalvm/polyglot/io/FileSystem.html#newReadOnlyFileSystem-org.graalvm.polyglot.io.FileSystem-) returning a read-only decorator for the given file system.
89
* Changed the behavior of [`Context.close()`](https://www.graalvm.org/sdk/javadoc/org/graalvm/polyglot/Context.html#close--) (as well as `Context.close(false)` which is equivalent). In case the context was cancelled during the close operation or the context was exited during the close operation at request of the guest application, or it was already cancelled or exited before the close operation begins,

sdk/mx.sdk/mx_sdk_benchmark.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,12 @@ class EmptyEnv():
672672
def __enter__(self):
673673
self._prev_environ = os.environ
674674
os.environ = {}
675+
# urllib.request caches http_proxy, https_proxy etc. globally but doesn't cache no_proxy
676+
# preserve no_proxy to avoid issues with proxies
677+
if 'no_proxy' in self._prev_environ:
678+
os.environ['no_proxy'] = self._prev_environ['no_proxy']
679+
if 'NO_PROXY' in self._prev_environ:
680+
os.environ['NO_PROXY'] = self._prev_environ['NO_PROXY']
675681
def __exit__(self, exc_type, exc_val, exc_tb):
676682
os.environ = self._prev_environ
677683

sdk/src/org.graalvm.launcher/src/META-INF/native-image/org.graalvm.launcher/native-image.properties

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
Args = --features=com.oracle.svm.thirdparty.jline.JLine3Feature \
1+
Args = --add-exports=org.graalvm.nativeimage.base/com.oracle.svm.util=ALL-UNNAMED \
2+
--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk=ALL-UNNAMED \
3+
--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.jni=ALL-UNNAMED \
4+
--features=com.oracle.svm.thirdparty.jline.JLine3Feature \
25
--initialize-at-build-time=org.graalvm.launcher \
36
-H:JNIConfigurationResources=${.}/launcher.jniconfig \
47
--add-modules=java.scripting \

sdk/src/org.graalvm.nativeimage/snapshot.sigtest

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -823,6 +823,7 @@ meth public static org.graalvm.nativeimage.c.type.CTypeConversion$CCharPointerHo
823823
meth public static org.graalvm.nativeimage.c.type.CTypeConversion$CCharPointerPointerHolder toCStrings(java.lang.CharSequence[])
824824
meth public static org.graalvm.word.UnsignedWord toCString(java.lang.CharSequence,java.nio.charset.Charset,org.graalvm.nativeimage.c.type.CCharPointer,org.graalvm.word.UnsignedWord)
825825
meth public static org.graalvm.word.UnsignedWord toCString(java.lang.CharSequence,org.graalvm.nativeimage.c.type.CCharPointer,org.graalvm.word.UnsignedWord)
826+
meth public static org.graalvm.nativeimage.c.type.CTypeConversion$CCharPointerHolder toCBytes(byte[])
826827
supr java.lang.Object
827828

828829
CLSS public abstract interface static org.graalvm.nativeimage.c.type.CTypeConversion$CCharPointerHolder

0 commit comments

Comments
 (0)