From b12c1e08fb8b169203d7ffa87892784779987dbe Mon Sep 17 00:00:00 2001 From: Lesia Chaban Date: Wed, 27 Sep 2023 14:17:42 +0200 Subject: [PATCH 1/3] Remove double dush for '-truffle' in version check --- docs/reference-manual/java-on-truffle/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference-manual/java-on-truffle/README.md b/docs/reference-manual/java-on-truffle/README.md index 28d07286ec76..d90e736eb007 100644 --- a/docs/reference-manual/java-on-truffle/README.md +++ b/docs/reference-manual/java-on-truffle/README.md @@ -50,7 +50,7 @@ You can download a standalone based on Oracle GraalVM or GraalVM Community Editi 3. A standalone comes with a JVM in addition to its native launcher. Check the version to see the Java on Truffle runtime is active: ```shell - ./path/to/bin/java -truffle --version + ./path/to/bin/java -truffle -version ``` ## Run Java on Truffle From 6794f86e59f7a235b0c93c81be3314e7bc8b2c66 Mon Sep 17 00:00:00 2001 From: Tom Shull Date: Thu, 28 Sep 2023 16:51:47 +0200 Subject: [PATCH 2/3] track node source positions during parseoncejit analysis --- .../graal/pointsto/flow/MethodTypeFlowBuilder.java | 2 +- .../oracle/graal/pointsto/meta/AnalysisMethod.java | 12 ++++++++++-- .../phases/InlineBeforeAnalysisGraphDecoder.java | 3 ++- .../pointsto/phases/InlineBeforeAnalysisPolicy.java | 5 +++-- .../core/graal/replacements/SubstrateGraphKit.java | 3 +-- .../hosted/ParseOnceRuntimeCompilationFeature.java | 6 ++++-- .../svm/graal/hosted/RuntimeCompilationFeature.java | 2 +- .../analysis/flow/SVMMethodTypeFlowBuilder.java | 4 +--- .../SimulateClassInitializerPolicy.java | 3 ++- .../phases/InlineBeforeAnalysisPolicyImpl.java | 3 ++- 10 files changed, 27 insertions(+), 16 deletions(-) diff --git a/substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/flow/MethodTypeFlowBuilder.java b/substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/flow/MethodTypeFlowBuilder.java index 9a1f417ee7d6..83b6e3f201ce 100644 --- a/substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/flow/MethodTypeFlowBuilder.java +++ b/substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/flow/MethodTypeFlowBuilder.java @@ -1474,7 +1474,7 @@ protected void processMethodInvocation(TypeFlowsOfNodes state, Invoke invoke, In } /* Get a reasonable position for inlined invokes, avoiding cycles in the parsing backtrace. */ - private BytecodePosition getInvokePosition(FixedNode invokeNode) { + protected BytecodePosition getInvokePosition(FixedNode invokeNode) { BytecodePosition invokePosition = invokeNode.getNodeSourcePosition(); /* Get the outermost caller position for inlined invokes. */ while (invokePosition != null && invokePosition.getCaller() != null) { diff --git a/substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/meta/AnalysisMethod.java b/substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/meta/AnalysisMethod.java index 64c5ea8d67cb..a6c8c1a6b857 100644 --- a/substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/meta/AnalysisMethod.java +++ b/substratevm/src/com.oracle.graal.pointsto/src/com/oracle/graal/pointsto/meta/AnalysisMethod.java @@ -927,11 +927,19 @@ private void waitOnLock(ReentrantLock lock) { } } + public StructuredGraph decodeAnalyzedGraph(DebugContext debug, Iterable nodeReferences) { + if (analyzedGraph == null) { + return null; + } + + return decodeAnalyzedGraph(debug, nodeReferences, analyzedGraph.trackNodeSourcePosition()); + } + /** * Returns the {@link StructuredGraph Graal IR} for the method that has been processed by the * static analysis. */ - public StructuredGraph decodeAnalyzedGraph(DebugContext debug, Iterable nodeReferences) { + public StructuredGraph decodeAnalyzedGraph(DebugContext debug, Iterable nodeReferences, boolean trackNodeSourcePosition) { if (analyzedGraph == null) { return null; } @@ -939,7 +947,7 @@ public StructuredGraph decodeAnalyzedGraph(DebugContext debug, Iterable Date: Wed, 4 Oct 2023 09:47:14 +0300 Subject: [PATCH 3/3] Follow Olya G. comments --- docs/reference-manual/java-on-truffle/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/reference-manual/java-on-truffle/README.md b/docs/reference-manual/java-on-truffle/README.md index d90e736eb007..33901ae89441 100644 --- a/docs/reference-manual/java-on-truffle/README.md +++ b/docs/reference-manual/java-on-truffle/README.md @@ -50,6 +50,7 @@ You can download a standalone based on Oracle GraalVM or GraalVM Community Editi 3. A standalone comes with a JVM in addition to its native launcher. Check the version to see the Java on Truffle runtime is active: ```shell + # Path to Java on Truffle (Espresso) installation ./path/to/bin/java -truffle -version ``` @@ -97,7 +98,8 @@ This might be important for options such as `MaxDirectMemorySize` which can be s To ensure you have successfully installed Java on Truffle, verify its version: ```shell -java -truffle -version +# Path to Java on Truffle (Espresso) installation +./path/to/bin/java -truffle -version ``` Taking this `HelloWorld.java` example, compile it and run from the command line: