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 Nov 3, 2023
2 parents 43bb6b3 + b34adc0 commit 318b477
Show file tree
Hide file tree
Showing 67 changed files with 549 additions and 696 deletions.
16 changes: 8 additions & 8 deletions common.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Jsonnet files should not include this file directly but use ci/common.jsonnet instead."
],

"mx_version": "6.52.0",
"mx_version": "6.53.2",

"COMMENT.jdks": "When adding or removing JDKs keep in sync with JDKs in ci/common.jsonnet",
"jdks": {
Expand Down Expand Up @@ -42,13 +42,13 @@
"labsjdk-ee-21Debug": {"name": "labsjdk", "version": "ee-21.0.1+11-jvmci-23.1-b22-debug", "platformspecific": true },
"labsjdk-ee-21-llvm": {"name": "labsjdk", "version": "ee-21.0.1+11-jvmci-23.1-b22-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-b03", "platformspecific": true },
"labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-22+18-jvmci-b03-debug", "platformspecific": true },
"labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-22+18-jvmci-b03-sulong", "platformspecific": true },
"labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-22+18-jvmci-b03", "platformspecific": true },
"labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-22+18-jvmci-b03-debug", "platformspecific": true },
"labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-22+18-jvmci-b03-sulong", "platformspecific": true }
"oraclejdk-latest": {"name": "jpg-jdk", "version": "22", "build_id": "20", "release": true, "platformspecific": true, "extrabundles": ["static-libs"]},
"labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-22+20-jvmci-b02", "platformspecific": true },
"labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-22+20-jvmci-b02-debug", "platformspecific": true },
"labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-22+20-jvmci-b02-sulong", "platformspecific": true },
"labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-22+20-jvmci-b02", "platformspecific": true },
"labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-22+20-jvmci-b02-debug", "platformspecific": true },
"labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-22+20-jvmci-b02-sulong", "platformspecific": true }
},

"eclipse": {
Expand Down
9 changes: 6 additions & 3 deletions compiler/ci/ci_common/gate.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,14 @@
local gates = {
"gate-compiler-test-labsjdk-latest-linux-amd64": t("1:00:00") + c.mach5_target,
"gate-compiler-test-labsjdk-latest-linux-aarch64": t("1:50:00") + s.avoid_xgene3,
"gate-compiler-test-labsjdk-latest-darwin-amd64": t("1:00:00") + c.mach5_target + s.ram16gb,
# JDK latest only works on MacOS Ventura (GR-49652)
# "gate-compiler-test-labsjdk-latest-darwin-amd64": t("1:00:00") + c.mach5_target + s.ram16gb,
"gate-compiler-test-labsjdk-latest-darwin-aarch64": t("1:00:00"),
"gate-compiler-test-labsjdk-latest-windows-amd64": t("1:30:00"),
"gate-compiler-test_zgc-labsjdk-latest-linux-amd64": t("1:00:00") + c.mach5_target,
"gate-compiler-test_zgc-labsjdk-latest-linux-aarch64": t("1:50:00") + s.avoid_xgene3,
"gate-compiler-test_zgc-labsjdk-latest-darwin-amd64": t("1:00:00") + c.mach5_target + s.ram16gb,
# JDK latest only works on MacOS Ventura (GR-49652)
# "gate-compiler-test_zgc-labsjdk-latest-darwin-amd64": t("1:00:00") + c.mach5_target + s.ram16gb,
"gate-compiler-test_zgc-labsjdk-latest-darwin-aarch64": t("1:00:00"),

# Style jobs need to stay on a JDK compatible with all the style
Expand All @@ -230,7 +232,8 @@
"gate-compiler-truffle_xcomp-labsjdk-latest-linux-amd64": t("1:30:00"),
"gate-compiler-truffle_xcomp_zgc-labsjdk-latest-linux-amd64": t("1:30:00"),

"gate-compiler-bootstrap_lite-labsjdk-latest-darwin-amd64": t("1:00:00") + c.mach5_target,
# JDK latest only works on MacOS Ventura (GR-49652)
# "gate-compiler-bootstrap_lite-labsjdk-latest-darwin-amd64": t("1:00:00") + c.mach5_target,

"gate-compiler-bootstrap_full-labsjdk-latest-linux-amd64": s.many_cores + c.mach5_target,
"gate-compiler-bootstrap_full_zgc-labsjdk-latest-linux-amd64": s.many_cores + c.mach5_target
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import static jdk.graal.compiler.hotspot.HotSpotGraalServices.isIntrinsicSupportedByC2;

import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collections;
Expand Down Expand Up @@ -62,7 +63,7 @@
* Checks the intrinsics implemented by Graal against the set of intrinsics declared by HotSpot. The
* purpose of this test is to detect when new intrinsics are added to HotSpot and process them
* appropriately in Graal. This will be achieved by working through
* {@link UnimplementedGraalIntrinsics#toBeInvestigated} and * either implementing the intrinsic or
* {@link UnimplementedGraalIntrinsics#toBeInvestigated} and either implementing the intrinsic or
* moving it to {@link UnimplementedGraalIntrinsics#ignore}.
*/
public class CheckGraalIntrinsics extends GraalTest {
Expand Down Expand Up @@ -145,7 +146,7 @@ public interface Refiner {

@Test
@SuppressWarnings("try")
public void test() throws ClassNotFoundException {
public void test() throws ClassNotFoundException, NoSuchFieldException {
HotSpotProviders providers = rt.getHostBackend().getProviders();
Plugins graphBuilderPlugins = providers.getGraphBuilderPlugins();
InvocationPlugins invocationPlugins = graphBuilderPlugins.getInvocationPlugins();
Expand All @@ -162,6 +163,7 @@ public void test() throws ClassNotFoundException {
List<String> mischaracterizedAsIgnored = new ArrayList<>();
List<String> notAvailableYetIntrinsified = new ArrayList<>();

Field toBeInvestigated = UnimplementedGraalIntrinsics.class.getDeclaredField("toBeInvestigated");
for (VMIntrinsicMethod intrinsic : intrinsics) {
ResolvedJavaMethod method = resolveIntrinsic(providers.getMetaAccess(), intrinsic);
if (method == null) {
Expand Down Expand Up @@ -196,6 +198,8 @@ public void test() throws ClassNotFoundException {
Collections.sort(missing);
String missingString = missing.stream().map(s -> '"' + s + '"').collect(Collectors.joining(String.format(",%n ")));
errorMsgBuf.format("missing Graal intrinsics for:%n %s%n", missingString);
errorMsgBuf.format("To fix, modify the %s constructor to add them to %s.%n",
UnimplementedGraalIntrinsics.class.getSimpleName(), toBeInvestigated);
}
if (!mischaracterizedAsToBeInvestigated.isEmpty()) {
Collections.sort(mischaracterizedAsToBeInvestigated);
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, 22),
"22", new Version("22+18", 3));
"22", new Version("22+20", 2));

private static final int NA = 0;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,11 @@ public UnimplementedGraalIntrinsics() {
"jdk/jfr/internal/JVM.counterTime()J",
"jdk/jfr/internal/JVM.getEventWriter()Ljdk/jfr/internal/event/EventWriter;");

// JDK-8223347: Integration of Vector API (Incubator)
add(toBeInvestigated, // @formatter:off
// JDK-8309130: x86_64 AVX512 intrinsics for Arrays.sort methods (GR-48679)
"java/util/DualPivotQuicksort.partition(Ljava/lang/Class;Ljava/lang/Object;JIIIILjava/util/DualPivotQuicksort$PartitionOperation;)[I",
"java/util/DualPivotQuicksort.sort(Ljava/lang/Class;Ljava/lang/Object;JIILjava/util/DualPivotQuicksort$SortOperation;)V",
// JDK-8223347: Integration of Vector API
"jdk/internal/vm/vector/VectorSupport.compressExpandOp(ILjava/lang/Class;Ljava/lang/Class;Ljava/lang/Class;ILjdk/internal/vm/vector/VectorSupport$Vector;Ljdk/internal/vm/vector/VectorSupport$VectorMask;Ljdk/internal/vm/vector/VectorSupport$CompressExpandOperation;)Ljdk/internal/vm/vector/VectorSupport$VectorPayload;",
jdk == 21 ? "jdk/internal/vm/vector/VectorSupport.extract(Ljava/lang/Class;Ljava/lang/Class;ILjdk/internal/vm/vector/VectorSupport$Vector;ILjdk/internal/vm/vector/VectorSupport$VecExtractOp;)J":
"jdk/internal/vm/vector/VectorSupport.extract(Ljava/lang/Class;Ljava/lang/Class;ILjdk/internal/vm/vector/VectorSupport$VectorPayload;ILjdk/internal/vm/vector/VectorSupport$VecExtractOp;)J",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public static boolean cacheEquals(AbstractConstantKeysObject receiver, String sy
@SuppressWarnings("unused")
@Specialization(replaces = "cacheEquals")
public static boolean isReadable(AbstractConstantKeysObject receiver, String symbol,
@Cached("createClassProfile()") @Cached.Shared("classProfile") ValueProfile classProfile) {
@Cached(value = "createClassProfile()", inline = false) @Cached.Shared("classProfile") ValueProfile classProfile) {
return classProfile.profile(receiver).isMemberReadableImpl(symbol);
}
}
Expand All @@ -106,20 +106,20 @@ public abstract static class ReadMember {
@Specialization(guards = "symbol == cachedSymbol", limit = "8")
public static Object readIdentity(AbstractConstantKeysObject receiver, @SuppressWarnings("unused") String symbol,
@Cached("symbol") String cachedSymbol,
@Cached("createClassProfile()") @Cached.Exclusive ValueProfile classProfile) throws UnknownIdentifierException {
@Cached(value = "createClassProfile()", inline = false) @Cached.Exclusive ValueProfile classProfile) throws UnknownIdentifierException {
return read(receiver, cachedSymbol, classProfile);
}

@Specialization(guards = "symbol.equals(cachedSymbol)", limit = "8", replaces = "readIdentity")
public static Object readEquals(AbstractConstantKeysObject receiver, @SuppressWarnings("unused") String symbol,
@Cached("symbol") String cachedSymbol,
@Cached("createClassProfile()") @Cached.Exclusive ValueProfile classProfile) throws UnknownIdentifierException {
@Cached(value = "createClassProfile()", inline = false) @Cached.Exclusive ValueProfile classProfile) throws UnknownIdentifierException {
return read(receiver, cachedSymbol, classProfile);
}

@Specialization(replaces = "readEquals")
public static Object read(AbstractConstantKeysObject receiver, String symbol,
@Cached("createClassProfile()") @Cached.Shared("classProfile") ValueProfile classProfile) throws UnknownIdentifierException {
@Cached(value = "createClassProfile()", inline = false) @Cached.Shared("classProfile") ValueProfile classProfile) throws UnknownIdentifierException {
return classProfile.profile(receiver).readMemberImpl(symbol);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ public final int inputLength(TruffleString input) {
CompilerDirectives.transferToInterpreterAndInvalidate();
lengthNode = insert(InputLengthNode.create());
}
return lengthNode.execute(input, getEncoding());
return lengthNode.execute(this, input, getEncoding());
}

public final int inputRead(TruffleString input, int i) {
if (charAtNode == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
charAtNode = insert(InputReadNode.create());
}
return charAtNode.execute(input, i, getEncoding());
return charAtNode.execute(this, input, i, getEncoding());
}

private RegexResult adjustIndexAndRun(VirtualFrame frame, TruffleString input, int fromIndex) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
import com.oracle.truffle.api.TruffleLanguage;
import com.oracle.truffle.api.dsl.Cached;
import com.oracle.truffle.api.dsl.Cached.Shared;
import com.oracle.truffle.api.dsl.GenerateInline;
import com.oracle.truffle.api.dsl.GenerateUncached;
import com.oracle.truffle.api.dsl.ImportStatic;
import com.oracle.truffle.api.dsl.ReportPolymorphism;
Expand Down Expand Up @@ -302,6 +304,7 @@ Object invokeMember(String member, Object[] args,
}

@ImportStatic(RegexObject.class)
@GenerateInline(false)
@GenerateUncached
abstract static class InvokeCacheNode extends Node {

Expand All @@ -312,38 +315,38 @@ abstract Object execute(String symbol, RegexObject receiver, Object input, int f
@Specialization(guards = {"symbol == cachedSymbol", "cachedSymbol.equals(PROP_EXEC)"}, limit = N_METHODS)
Object execIdentity(String symbol, RegexObject receiver, Object input, int fromIndex,
@Cached("symbol") String cachedSymbol,
@Cached ExecCompiledRegexNode execNode) throws UnsupportedMessageException, ArityException, UnsupportedTypeException {
@Cached @Shared ExecCompiledRegexNode execNode) throws UnsupportedMessageException, ArityException, UnsupportedTypeException {
return execNode.execute(receiver.getExecCallTarget(), input, fromIndex);
}

@SuppressWarnings("unused")
@Specialization(guards = {"symbol.equals(cachedSymbol)", "cachedSymbol.equals(PROP_EXEC)"}, limit = N_METHODS, replaces = "execIdentity")
Object execEquals(String symbol, RegexObject receiver, Object input, int fromIndex,
@Cached("symbol") String cachedSymbol,
@Cached ExecCompiledRegexNode execNode) throws UnsupportedMessageException, ArityException, UnsupportedTypeException {
@Cached @Shared ExecCompiledRegexNode execNode) throws UnsupportedMessageException, ArityException, UnsupportedTypeException {
return execNode.execute(receiver.getExecCallTarget(), input, fromIndex);
}

@SuppressWarnings("unused")
@Specialization(guards = {"symbol == cachedSymbol", "cachedSymbol.equals(PROP_EXEC_BOOLEAN)"}, limit = N_METHODS)
boolean execBooleanIdentity(String symbol, RegexObject receiver, Object input, int fromIndex,
@Cached("symbol") String cachedSymbol,
@Cached ExecCompiledRegexNode execNode) throws UnsupportedMessageException, ArityException, UnsupportedTypeException {
return execNode.execute(receiver.getExecBooleanCallTarget(), input, fromIndex) != RegexResult.getNoMatchInstance();
@Cached @Shared ExecCompiledRegexNode execBoolNode) throws UnsupportedMessageException, ArityException, UnsupportedTypeException {
return execBoolNode.execute(receiver.getExecBooleanCallTarget(), input, fromIndex) != RegexResult.getNoMatchInstance();
}

@SuppressWarnings("unused")
@Specialization(guards = {"symbol.equals(cachedSymbol)", "cachedSymbol.equals(PROP_EXEC_BOOLEAN)"}, limit = N_METHODS, replaces = "execBooleanIdentity")
boolean execBooleanEquals(String symbol, RegexObject receiver, Object input, int fromIndex,
@Cached("symbol") String cachedSymbol,
@Cached ExecCompiledRegexNode execNode) throws UnsupportedMessageException, ArityException, UnsupportedTypeException {
return execNode.execute(receiver.getExecBooleanCallTarget(), input, fromIndex) != RegexResult.getNoMatchInstance();
@Cached @Shared ExecCompiledRegexNode execBoolNode) throws UnsupportedMessageException, ArityException, UnsupportedTypeException {
return execBoolNode.execute(receiver.getExecBooleanCallTarget(), input, fromIndex) != RegexResult.getNoMatchInstance();
}

@ReportPolymorphism.Megamorphic
@Specialization(replaces = {"execEquals", "execBooleanEquals"})
static Object invokeGeneric(String symbol, RegexObject receiver, Object input, int fromIndex,
@Cached ExecCompiledRegexNode execNode) throws UnsupportedMessageException, ArityException, UnsupportedTypeException, UnknownIdentifierException {
@Cached @Shared ExecCompiledRegexNode execNode) throws UnsupportedMessageException, ArityException, UnsupportedTypeException, UnknownIdentifierException {
switch (symbol) {
case PROP_EXEC:
return execNode.execute(receiver.getExecCallTarget(), input, fromIndex);
Expand Down Expand Up @@ -441,6 +444,7 @@ public String toString() {
}

@ImportStatic(RegexObject.class)
@GenerateInline(false)
@GenerateUncached
abstract static class ExecCompiledRegexNode extends Node {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,18 @@ private static LiteralRegexExecNode createLiteralNode(RegexLanguage language, Re
}
if (caret) {
if (dollar) {
return LiteralRegexExecNode.create(language, ast, new Equals(preCalcResultVisitor));
return LiteralRegexExecNode.create(language, ast, LiteralRegexExecNodeGen.EqualsNodeGen.create(preCalcResultVisitor));
}
return LiteralRegexExecNode.create(language, ast, new StartsWith(preCalcResultVisitor));
return LiteralRegexExecNode.create(language, ast, LiteralRegexExecNodeGen.StartsWithNodeGen.create(preCalcResultVisitor));
}
if (dollar) {
return LiteralRegexExecNode.create(language, ast, new EndsWith(preCalcResultVisitor, ast.getFlags().isSticky()));
return LiteralRegexExecNode.create(language, ast, LiteralRegexExecNodeGen.EndsWithNodeGen.create(preCalcResultVisitor, ast.getFlags().isSticky()));
}
if (ast.getFlags().isSticky()) {
return LiteralRegexExecNode.create(language, ast, new RegionMatches(preCalcResultVisitor));
return LiteralRegexExecNode.create(language, ast, LiteralRegexExecNodeGen.RegionMatchesNodeGen.create(preCalcResultVisitor));
}
if (preCalcResultVisitor.getLiteral().encodedLength() <= 64) {
return LiteralRegexExecNode.create(language, ast, new IndexOfString(preCalcResultVisitor));
return LiteralRegexExecNode.create(language, ast, LiteralRegexExecNodeGen.IndexOfStringNodeGen.create(preCalcResultVisitor));
}
return null;
}
Expand Down
Loading

0 comments on commit 318b477

Please sign in to comment.