From 64a07dce05f29b857cf9a9a6dad64ec53085bbfa Mon Sep 17 00:00:00 2001 From: Stefan Marr Date: Mon, 11 Apr 2022 23:35:24 +0100 Subject: [PATCH 1/2] Add basic support for long-based encoding of source coordinates Signed-off-by: Stefan Marr --- src/bd/source/SourceCoordinate.java | 35 +++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/bd/source/SourceCoordinate.java b/src/bd/source/SourceCoordinate.java index 94e0c43..2ea72ec 100644 --- a/src/bd/source/SourceCoordinate.java +++ b/src/bd/source/SourceCoordinate.java @@ -16,6 +16,10 @@ *

* The {@code charIndex} may not be set. It can be derived from startLine and startColumn, * if the source file is present. + * + *

+ * In addition to an object representation, a {@code long}-based representation, + * is supported, too. */ public class SourceCoordinate { public final int startLine; @@ -110,4 +114,35 @@ public static String getLocationQualifier(final SourceSection section) { public static String getURI(final Source source) { return source.getURI().toString(); } + + public static long createEmptyCoordinate() { + // start at column 1, index 1 + return 0x1L; + } + + public static long createCoordinate(final SourceSection section) { + return create(section.getCharIndex(), section.getCharLength()); + } + + public static long create(final int startIndex, final int length) { + return (((long) length) << 32) | (startIndex & 0xFFFFFFFFL); + } + + public static long withZeroLength(final long coord) { + return coord & 0xFFFFFFFFL; + } + + public static int getStartIndex(final long coord) { + return (int) (coord & 0xFFFFFFFFL); + } + + public static int getLength(final long coord) { + return (int) ((coord >>> 32) & 0xFFFFFFFFL); + } + + public static SourceSection createSourceSection(final Source source, final long coord) { + int startIndex = getStartIndex(coord); + int length = getLength(coord); + return source.createSection(startIndex, length); + } } From 00a1f9f15b467c071dadfb07bb2cf10abcdbc29b Mon Sep 17 00:00:00 2001 From: Stefan Marr Date: Mon, 11 Apr 2022 23:50:37 +0100 Subject: [PATCH 2/2] Update Graal, Eclipse, use JDK 17 in CI Signed-off-by: Stefan Marr --- .github/workflows/ci.yml | 4 ++-- .graal-git-repo | 6 +++--- build.xml | 10 ++-------- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a71c722..83dc883 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: - name: Tests run: | - export JAVA_HOME=$JAVA_HOME_8_X64 + export JAVA_HOME=$JAVA_HOME_17_X64 ant -e test - name: CheckStyle @@ -23,7 +23,7 @@ jobs: - name: Download Eclipse run: | export ECLIPSE_TAR=eclipse.tar.gz - export ECLIPSE_URL=https://ftp.snt.utwente.nl/pub/software/eclipse/eclipse/downloads/drops4/R-4.19-202103031800/eclipse-SDK-4.19-linux-gtk-x86_64.tar.gz + export ECLIPSE_URL=https://ftp.snt.utwente.nl/pub/software/eclipse/eclipse/downloads/drops4/R-4.23-202203080310/eclipse-SDK-4.23-linux-gtk-x86_64.tar.gz curl ${ECLIPSE_URL} -o ${ECLIPSE_TAR} tar -C ${GITHUB_WORKSPACE}/.. -xzf ${ECLIPSE_TAR} diff --git a/.graal-git-repo b/.graal-git-repo index bc26251..2cc5b86 100755 --- a/.graal-git-repo +++ b/.graal-git-repo @@ -11,12 +11,12 @@ import sys import os # We use the following repositories -GRAAL_REPO_URL = "https://github.com/smarr/truffle.git" +GRAAL_REPO_URL = "https://github.com/oracle/graal.git" MX_REPO_URL = "https://github.com/graalvm/mx.git" # And these are the repo revisions we test against -GRAAL_REPO_REV = "60bdbbd657e21d98fa0e6141fe3f4a786010b9e8" -MX_REPO_REV = "7ffcabe734973b89f0211da3a174ac2d298c78bc" +GRAAL_REPO_REV = "91b68c2bcb9a0f41c0f437b6d7adf736786f36b6" +MX_REPO_REV = "65c6727a0080515696c25934f3da02ef7a1aa43a" def update(lines, var, val): diff --git a/build.xml b/build.xml index 79a2aed..87fda0e 100644 --- a/build.xml +++ b/build.xml @@ -1,18 +1,15 @@ - - - + - + @@ -159,17 +156,14 @@ - - -