Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
gluon-bot committed Oct 16, 2023
2 parents 22597b6 + 81aafab commit 2b6ae6e
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 87 deletions.
14 changes: 7 additions & 7 deletions common.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@
"labsjdk-ee-21Debug": {"name": "labsjdk", "version": "ee-21+35-jvmci-23.1-b15-debug", "platformspecific": true },
"labsjdk-ee-21-llvm": {"name": "labsjdk", "version": "ee-21+35-jvmci-23.1-b15-sulong", "platformspecific": true },

"oraclejdk-latest": {"name": "jpg-jdk", "version": "22", "build_id": "17", "release": true, "platformspecific": true, "extrabundles": ["static-libs"]},
"labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-22+17-jvmci-b01", "platformspecific": true },
"labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-22+17-jvmci-b01-debug", "platformspecific": true },
"labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-22+17-jvmci-b01-sulong", "platformspecific": true },
"labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-22+17-jvmci-b01", "platformspecific": true },
"labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-22+17-jvmci-b01-debug", "platformspecific": true },
"labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-22+17-jvmci-b01-sulong", "platformspecific": true }
"oraclejdk-latest": {"name": "jpg-jdk", "version": "22", "build_id": "18", "release": true, "platformspecific": true, "extrabundles": ["static-libs"]},
"labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-22+18-jvmci-b01", "platformspecific": true },
"labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-22+18-jvmci-b01-debug", "platformspecific": true },
"labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-22+18-jvmci-b01-sulong", "platformspecific": true },
"labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-22+18-jvmci-b01", "platformspecific": true },
"labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-22+18-jvmci-b01-debug", "platformspecific": true },
"labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-22+18-jvmci-b01-sulong", "platformspecific": true }
},

"eclipse": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ private HotSpotGraalRuntime.HotSpotGC getSelectedGC() throws GraalError {
public final int hugeMethodLimit = getFlag("HugeMethodLimit", Integer.class);
public final boolean printInlining = getFlag("PrintInlining", Boolean.class);
public final boolean inline = getFlag("Inline", Boolean.class);
public final boolean useFastLocking = getFlag("JVMCIUseFastLocking", Boolean.class);
public final boolean useFastLocking = getFlag("JVMCIUseFastLocking", Boolean.class, true, !(JDK >= 22 && JDK_BUILD >= 18));
private final boolean useHeavyMonitors = JDK < 22 && getFlag("UseHeavyMonitors", Boolean.class);

// Use only heavy monitors for locking
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public static boolean jvmciGE(Version v) {
}

public static final int JDK = Runtime.version().feature();
public static final int JDK_UPDATE = Runtime.version().update();
public static final int JDK_BUILD = Runtime.version().build().orElse(0);
public static final Version JVMCI_VERSION;
public static final boolean JVMCI;
public static final boolean JDK_PRERELEASE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public final class JVMCIVersionCheck {
*/
private static final Map<String, Version> JVMCI_MIN_VERSIONS = Map.of(
"21", new Version(23, 1, 15),
"22", new Version("22+17", 1));
"22", new Version("22+18", 1));

private static final int NA = 0;
/**
Expand Down
2 changes: 1 addition & 1 deletion sdk/ci/ci.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
downloads+: {
EXTRA_JAVA_HOMES: common.jdks_data['oraclejdk21'],
},
name: 'gate-sdk-oraclejdk' + self.jdk_version + '-' + self.os + '-' + self.arch,
name: 'gate-sdk-oracle' + self.jdk_name + '-' + self.os + '-' + self.arch,
setup: [
["cd", "./sdk"],
],
Expand Down
2 changes: 1 addition & 1 deletion substratevm/mx.substratevm/mx_substratevm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1681,7 +1681,7 @@ def collector(line):
else:
# Linux objdump objdump --wide --syms
# 0000000000000000 *UND* 0000000000000000 JVM_InitStackTraceElement
found_undef = line_tokens[1] = '*UND*'
found_undef = line_tokens[1] == '*UND*'
if found_undef:
symbol_candiate = line_tokens[-1]
mx.logvv('Found undefined symbol: ' + symbol_candiate)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import java.io.InputStream;
import java.io.PrintStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Enumeration;
import java.util.List;
Expand All @@ -41,7 +40,6 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.function.BooleanSupplier;
import java.util.regex.Pattern;
import java.util.stream.Stream;

import org.graalvm.compiler.replacements.nodes.BinaryMathIntrinsicNode;
Expand Down Expand Up @@ -186,73 +184,6 @@ public String intern() {
@Alias //
int hash;

/**
* This is a copy of String.split from the JDK, but with the fastpath loop factored out into a
* separate method. This allows inlining and constant folding of the condition for call sites
* where the regex is a constant (which is a common usage pattern).
*
* JDK-8262994 should make that refactoring in OpenJDK, after which this substitution can be
* removed.
*/
@Substitute
public String[] split(String regex, int limit) {
/*
* fastpath if the regex is a (1) one-char String and this character is not one of the
* RegEx's meta characters ".$|()[{^?*+\\", or (2) two-char String and the first char is the
* backslash and the second is not the ascii digit or ascii letter.
*/
char ch = 0;
if (((regex.length() == 1 &&
".$|()[{^?*+\\".indexOf(ch = regex.charAt(0)) == -1) ||
(regex.length() == 2 &&
regex.charAt(0) == '\\' &&
(((ch = regex.charAt(1)) - '0') | ('9' - ch)) < 0 &&
((ch - 'a') | ('z' - ch)) < 0 &&
((ch - 'A') | ('Z' - ch)) < 0)) &&
(ch < Character.MIN_HIGH_SURROGATE ||
ch > Character.MAX_LOW_SURROGATE)) {
return StringHelper.simpleSplit(SubstrateUtil.cast(this, String.class), limit, ch);
}
return Pattern.compile(regex).split(SubstrateUtil.cast(this, String.class), limit);
}
}

final class StringHelper {
static String[] simpleSplit(String that, int limit, char ch) {
int off = 0;
int next = 0;
boolean limited = limit > 0;
ArrayList<String> list = new ArrayList<>();
while ((next = that.indexOf(ch, off)) != -1) {
if (!limited || list.size() < limit - 1) {
list.add(that.substring(off, next));
off = next + 1;
} else { // last one
// assert (list.size() == limit - 1);
int last = that.length();
list.add(that.substring(off, last));
off = last;
break;
}
}
// If no match was found, return this
if (off == 0) {
return new String[]{that};
}
// Add remaining segment
if (!limited || list.size() < limit) {
list.add(that.substring(off, that.length()));
}
// Construct result
int resultSize = list.size();
if (limit == 0) {
while (resultSize > 0 && list.get(resultSize - 1).isEmpty()) {
resultSize--;
}
}
String[] result = new String[resultSize];
return list.subList(0, resultSize).toArray(result);
}
}

@TargetClass(className = "java.lang.StringLatin1")
Expand Down
2 changes: 2 additions & 0 deletions truffle/mx.truffle/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,8 @@
"javaCompliance" : "21+",
"annotationProcessors" : ["TRUFFLE_DSL_PROCESSOR"],
"workingSets" : "Truffle",
# disable SpotBugs as long is panama is preview [GR-49448]
"spotbugs" : "false",
},

"com.oracle.truffle.nfi.backend.spi" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void setNativeErrno(int nativeErrno) {
this.nativeErrno = nativeErrno;
}

@SuppressWarnings("preview")
@SuppressWarnings({"preview", "restricted"})
MemorySegment getErrnoLocation() {
Linker linker = Linker.nativeLinker();
FunctionDescriptor desc = FunctionDescriptor.of(ValueLayout.JAVA_LONG);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ protected LoadLibraryNode(PanamaNFILanguage language, String name) {
}

@TruffleBoundary
@SuppressWarnings("preview")
@SuppressWarnings({"preview", "restricted"})
private SymbolLookup doLoad() {
PanamaNFIContext ctx = PanamaNFIContext.get(this);
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ MethodType getUpcallMethodType() {
}

@TruffleBoundary
@SuppressWarnings("preview")
@SuppressWarnings({"preview", "restricted"})
MemorySegment bind(MethodHandle cachedHandle, Object receiver) {
MethodHandle bound = cachedHandle.bindTo(receiver);
@SuppressWarnings("preview")
Expand Down Expand Up @@ -310,7 +310,7 @@ public static CachedSignatureInfo prepareSignatureInfo(PanamaType retType, ArgsS

static MethodHandle createDowncallHandle(@SuppressWarnings("preview") FunctionDescriptor descriptor) {
int parameterCount = descriptor.argumentLayouts().size();
@SuppressWarnings("preview")
@SuppressWarnings({"preview", "restricted"})
MethodHandle handle = Linker.nativeLinker().downcallHandle(descriptor).asSpreader(Object[].class, parameterCount).asType(
MethodType.methodType(Object.class, new Class<?>[]{MemorySegment.class, Object[].class}));
return handle;
Expand Down
4 changes: 2 additions & 2 deletions vm/mx.vm/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"name": "graal-nodejs",
"subdir": True,
"dynamic": True,
"version": "6dd82d9f89f1be47d34b82f16d99afffd2a309af",
"version": "e0f922185f627f2bf8e3d9117996a698c7f8980b",
"urls" : [
{"url" : "https://github.com/graalvm/graaljs.git", "kind" : "git"},
]
Expand All @@ -42,7 +42,7 @@
"name": "graal-js",
"subdir": True,
"dynamic": True,
"version": "6dd82d9f89f1be47d34b82f16d99afffd2a309af",
"version": "e0f922185f627f2bf8e3d9117996a698c7f8980b",
"urls": [
{"url": "https://github.com/graalvm/graaljs.git", "kind" : "git"},
]
Expand Down

0 comments on commit 2b6ae6e

Please sign in to comment.