From 30455b8b3f03d6a333915ba63fc29d3397148a45 Mon Sep 17 00:00:00 2001 From: Stefan Marr Date: Fri, 4 Oct 2024 00:51:42 +0100 Subject: [PATCH 1/4] Have only one frameType profile object Signed-off-by: Stefan Marr --- .../src/trufflesom/interpreter/nodes/ContextualNode.java | 2 +- .../src/trufflesom/interpreter/nodes/bc/BytecodeLoopNode.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/trufflesom/src/trufflesom/interpreter/nodes/ContextualNode.java b/src/trufflesom/src/trufflesom/interpreter/nodes/ContextualNode.java index 6a2eb8b67..75bb287da 100644 --- a/src/trufflesom/src/trufflesom/interpreter/nodes/ContextualNode.java +++ b/src/trufflesom/src/trufflesom/interpreter/nodes/ContextualNode.java @@ -31,7 +31,7 @@ public abstract class ContextualNode extends NoPreEvalExprNode { - private static final ValueProfile frameType = ValueProfile.createClassProfile(); + public static final ValueProfile frameType = ValueProfile.createClassProfile(); protected final int contextLevel; diff --git a/src/trufflesom/src/trufflesom/interpreter/nodes/bc/BytecodeLoopNode.java b/src/trufflesom/src/trufflesom/interpreter/nodes/bc/BytecodeLoopNode.java index a1aedab84..5cb7e0ffa 100644 --- a/src/trufflesom/src/trufflesom/interpreter/nodes/bc/BytecodeLoopNode.java +++ b/src/trufflesom/src/trufflesom/interpreter/nodes/bc/BytecodeLoopNode.java @@ -1,5 +1,6 @@ package trufflesom.interpreter.nodes.bc; +import static trufflesom.interpreter.nodes.ContextualNode.frameType; import static trufflesom.compiler.bc.BytecodeGenerator.emit1; import static trufflesom.compiler.bc.BytecodeGenerator.emit3; import static trufflesom.compiler.bc.BytecodeGenerator.emit3WithDummy; @@ -147,8 +148,7 @@ public class BytecodeLoopNode extends NoPreEvalExprNode implements ScopeReference { - private static final ValueProfile frameType = ValueProfile.createClassProfile(); - private static final LiteralNode dummyNode = new IntegerLiteralNode(0); + private static final LiteralNode dummyNode = new IntegerLiteralNode(0); @CompilationFinal(dimensions = 1) private final byte[] bytecodesField; @CompilationFinal(dimensions = 1) private final Object[] literalsAndConstantsField; From 41020f663d275ebc805b7bf655a814309121644f Mon Sep 17 00:00:00 2001 From: Stefan Marr Date: Fri, 4 Oct 2024 10:46:58 +0100 Subject: [PATCH 2/4] Change eclipse link to the archive mirror This version disappeared from the mirror. Signed-off-by: Stefan Marr --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 699920937..2c7c98169 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: - name: Download Eclipse run: | export ECLIPSE_TAR=eclipse.tar.gz - export ECLIPSE_URL=https://ftp.fau.de/eclipse/eclipse/downloads/drops4/R-4.30-202312010110/eclipse-SDK-4.30-linux-gtk-x86_64.tar.gz + export ECLIPSE_URL=https://archive.eclipse.org/eclipse/downloads/drops4/R-4.30-202312010110/eclipse-SDK-4.30-linux-gtk-x86_64.tar.gz curl -L ${ECLIPSE_URL} -o ${ECLIPSE_TAR} tar --warning=no-unknown-keyword -C ${GITHUB_WORKSPACE}/.. -xzf ${ECLIPSE_TAR} From 10c2b3fa155637c984acfcfb7c77784524d9c7b0 Mon Sep 17 00:00:00 2001 From: Stefan Marr Date: Fri, 4 Oct 2024 11:27:58 +0100 Subject: [PATCH 3/4] Apply black formatting from the style gate Signed-off-by: Stefan Marr --- mx.trufflesom/mx_trufflesom.py | 30 +++++++++++++++++------------- mx.trufflesom/suite.py | 4 +++- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/mx.trufflesom/mx_trufflesom.py b/mx.trufflesom/mx_trufflesom.py index 0a8cff488..868da5e5a 100644 --- a/mx.trufflesom/mx_trufflesom.py +++ b/mx.trufflesom/mx_trufflesom.py @@ -124,19 +124,21 @@ def build_native_image_tool(args, **kwargs): svm_path = get_svm_path() mx.run_mx(["build"], svm_path) + BASE_DIR = suite.dir -TRUFFLE_DIR = BASE_DIR + '/../graal' +TRUFFLE_DIR = BASE_DIR + "/../graal" MODULE_PATH_ENTRIES = [ - BASE_DIR + '/mxbuild/dists/trufflesom.jar', - TRUFFLE_DIR + '/sdk/mxbuild/dists/graal-sdk.jar', - TRUFFLE_DIR + '/sdk/mxbuild/dists/collections.jar', - TRUFFLE_DIR + '/sdk/mxbuild/dists/polyglot.jar', - TRUFFLE_DIR + '/sdk/mxbuild/dists/word.jar', - TRUFFLE_DIR + '/sdk/mxbuild/dists/jniutils.jar', - TRUFFLE_DIR + '/truffle/mxbuild/dists/truffle-runtime.jar', - TRUFFLE_DIR + '/substratevm/mxbuild/dists/truffle-runtime-svm.jar', - TRUFFLE_DIR + '/truffle/mxbuild/dists/truffle-api.jar'] + BASE_DIR + "/mxbuild/dists/trufflesom.jar", + TRUFFLE_DIR + "/sdk/mxbuild/dists/graal-sdk.jar", + TRUFFLE_DIR + "/sdk/mxbuild/dists/collections.jar", + TRUFFLE_DIR + "/sdk/mxbuild/dists/polyglot.jar", + TRUFFLE_DIR + "/sdk/mxbuild/dists/word.jar", + TRUFFLE_DIR + "/sdk/mxbuild/dists/jniutils.jar", + TRUFFLE_DIR + "/truffle/mxbuild/dists/truffle-runtime.jar", + TRUFFLE_DIR + "/substratevm/mxbuild/dists/truffle-runtime-svm.jar", + TRUFFLE_DIR + "/truffle/mxbuild/dists/truffle-api.jar", +] @mx.command( @@ -173,7 +175,8 @@ def build_native(args, **kwargs): "--no-fallback", "--link-at-build-time", "-H:+ReportExceptionStackTraces", - "-H:+UnlockExperimentalVMOptions", "-H:-DeleteLocalSymbols", + "-H:+UnlockExperimentalVMOptions", + "-H:-DeleteLocalSymbols", "-Dsom.interp=" + opt.type, ] @@ -197,12 +200,13 @@ def build_native(args, **kwargs): # -H:+EnforceMaxRuntimeCompileMethods cmd += [ - '--module-path', ':'.join(MODULE_PATH_ENTRIES), + "--module-path", + ":".join(MODULE_PATH_ENTRIES), "-o", suite.dir + output_name, ] - if opt.use_g1 and opt.graalvm and os.uname().sysname != 'Darwin': + if opt.use_g1 and opt.graalvm and os.uname().sysname != "Darwin": cmd += ["--gc=G1"] cmd += ["trufflesom.Launcher"] diff --git a/mx.trufflesom/suite.py b/mx.trufflesom/suite.py index 2602615bf..7b52dad40 100644 --- a/mx.trufflesom/suite.py +++ b/mx.trufflesom/suite.py @@ -88,7 +88,9 @@ }, }, "dependencies": ["trufflesom"], - "distDependencies": ["truffle:TRUFFLE_API"], # , "tools:TRUFFLE_COVERAGE", "tools:TRUFFLE_PROFILER" + "distDependencies": [ + "truffle:TRUFFLE_API" + ], # , "tools:TRUFFLE_COVERAGE", "tools:TRUFFLE_PROFILER" }, "TRUFFLESOM_TEST": { "description": "TruffleSOM JUnit Tests", From ae3ece1e59d0ee6a9cafaa41ec53b40fd2fe419f Mon Sep 17 00:00:00 2001 From: Stefan Marr Date: Fri, 4 Oct 2024 11:29:04 +0100 Subject: [PATCH 4/4] Install black and pylint for the style gate Signed-off-by: Stefan Marr --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2c7c98169..8a325e4b4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,6 +27,10 @@ jobs: curl -L ${ECLIPSE_URL} -o ${ECLIPSE_TAR} tar --warning=no-unknown-keyword -C ${GITHUB_WORKSPACE}/.. -xzf ${ECLIPSE_TAR} + - name: Install Black and PyLint + run: | + pip install black pylint==2.4 + - name: Run Style Gate run: | export ECLIPSE_EXE=${GITHUB_WORKSPACE}/../eclipse/eclipse