Skip to content

Commit

Permalink
[GR-50934] Update JVMCI to 23+6-jvmci-b01.
Browse files Browse the repository at this point in the history
PullRequest: graal/16651
  • Loading branch information
OracleLabsAutomation authored and marwan-hallaoui committed Jan 23, 2024
2 parents 8cde43a + 8f7ae0d commit 88f3a86
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 20 deletions.
14 changes: 7 additions & 7 deletions common.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@
"labsjdk-ee-21Debug": {"name": "labsjdk", "version": "ee-21.0.1+11-jvmci-23.1-b26-debug", "platformspecific": true },
"labsjdk-ee-21-llvm": {"name": "labsjdk", "version": "ee-21.0.1+11-jvmci-23.1-b26-sulong", "platformspecific": true },

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

"eclipse": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ public final class JVMCIVersionCheck {
private static final Map<String, Map<String, Version>> JVMCI_MIN_VERSIONS = Map.of(
"21", Map.of(DEFAULT_VENDOR_ENTRY, new Version(23, 1, 26)),
"23", Map.of(
"Oracle Corporation", new Version("23+5", 1),
DEFAULT_VENDOR_ENTRY, new Version("23+5", 1)));
"Oracle Corporation", new Version("23+6", 1),
DEFAULT_VENDOR_ENTRY, new Version("23+6", 1)));
private static final int NA = 0;
/**
* Minimum Java release supported by Graal.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,26 @@
import java.lang.reflect.Method;
import java.time.Duration;

import jdk.graal.compiler.serviceprovider.JavaVersionUtil;
import org.graalvm.nativeimage.Platform;
import org.graalvm.nativeimage.Platforms;

import com.oracle.svm.core.SubstrateUtil;
import com.oracle.svm.core.annotate.Alias;
import com.oracle.svm.core.annotate.TargetClass;
import com.oracle.svm.core.annotate.TargetElement;
import com.oracle.svm.core.jdk.JDK21OrEarlier;
import com.oracle.svm.core.jdk.JDK22OrEarlier;
import com.oracle.svm.core.jdk.JDK22OrLater;
import com.oracle.svm.core.jdk.JDK23OrLater;
import com.oracle.svm.core.util.VMError;
import com.oracle.svm.util.ReflectionUtil;

import jdk.graal.compiler.serviceprovider.JavaVersionUtil;
import jdk.jfr.Recording;
import jdk.jfr.internal.JVM;
import jdk.jfr.internal.JVMSupport;
import jdk.jfr.internal.PlatformRecording;
import jdk.jfr.internal.SecuritySupport;

/**
* Compatibility class to handle incompatible changes between JDK 21 and JDK 22. Once support for
Expand Down Expand Up @@ -109,6 +115,15 @@ public static JVM getJVMOrNull() throws IllegalAccessException, InvocationTarget
return (JVM) getJVM.invoke(null);
}
}

public static void setDumpDirectory(PlatformRecording platformRecording, SecuritySupport.SafePath directory) {
Target_jdk_jfr_internal_PlatformRecording pr = SubstrateUtil.cast(platformRecording, Target_jdk_jfr_internal_PlatformRecording.class);
if (JavaVersionUtil.JAVA_SPEC >= 23) {
pr.setDumpDirectory(directory);
} else {
pr.setDumpOnExitDirectory(directory);
}
}
}

@TargetClass(className = "jdk.jfr.internal.Utils", onlyWith = {JDK21OrEarlier.class, HasJfrSupport.class})
Expand All @@ -131,3 +146,14 @@ final class Target_jdk_jfr_internal_util_ValueFormatter {
@Alias
public static native String formatTimespan(Duration dValue, String separation);
}

@TargetClass(className = "jdk.jfr.internal.PlatformRecording")
final class Target_jdk_jfr_internal_PlatformRecording {
@Alias
@TargetElement(onlyWith = JDK23OrLater.class)
public native void setDumpDirectory(SecuritySupport.SafePath directory);

@Alias
@TargetElement(onlyWith = JDK22OrEarlier.class)
public native void setDumpOnExitDirectory(SecuritySupport.SafePath directory);
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
import java.util.HashMap;
import java.util.Map;

import jdk.graal.compiler.api.replacements.Fold;
import jdk.graal.compiler.core.common.SuppressFBWarnings;
import org.graalvm.nativeimage.ImageSingletons;
import org.graalvm.nativeimage.Platform;
import org.graalvm.nativeimage.Platforms;
Expand All @@ -49,6 +47,9 @@
import com.oracle.svm.core.util.UserError.UserException;
import com.oracle.svm.core.util.VMError;

import jdk.graal.compiler.api.replacements.Fold;
import jdk.graal.compiler.core.common.SuppressFBWarnings;
import jdk.graal.compiler.serviceprovider.JavaVersionUtil;
import jdk.jfr.FlightRecorder;
import jdk.jfr.Recording;
import jdk.jfr.internal.LogLevel;
Expand Down Expand Up @@ -200,11 +201,11 @@ private static void initRecording() {
dumpOnExit = Boolean.TRUE;
}
Path p = Paths.get(path);
if (Files.isDirectory(p) && Boolean.TRUE.equals(dumpOnExit)) {
if (Files.isDirectory(p) && (JavaVersionUtil.JAVA_SPEC >= 23 || Boolean.TRUE.equals(dumpOnExit))) {
// Decide destination filename at dump time
// Purposely avoid generating filename in Recording#setDestination due to
// security concerns
PrivateAccess.getInstance().getPlatformRecording(recording).setDumpOnExitDirectory(new SecuritySupport.SafePath(p));
JfrJdkCompatibility.setDumpDirectory(PrivateAccess.getInstance().getPlatformRecording(recording), new SecuritySupport.SafePath(p));
} else {
safePath = resolvePath(recording, path);
recording.setDestination(safePath.toPath());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@
import java.util.List;
import java.util.Map;

import org.junit.Assume;
import org.junit.Test;

import com.oracle.svm.core.thread.Target_jdk_internal_vm_Continuation;
import com.oracle.svm.test.jfr.events.StringEvent;

import jdk.graal.compiler.serviceprovider.JavaVersionUtil;
import jdk.jfr.Recording;
import jdk.jfr.consumer.RecordedEvent;
import jdk.jfr.consumer.RecordedThread;
Expand All @@ -54,6 +56,7 @@ public class TestJavaLevelVirtualThreadEvents extends JfrRecordingTest {

@Test
public void test() throws Throwable {
Assume.assumeFalse("Currently broken on JDK 23+ (GR-51526)", JavaVersionUtil.JAVA_SPEC >= 23);
String[] events = new String[]{"jdk.ThreadSleep", "jdk.VirtualThreadStart", "jdk.VirtualThreadEnd", "jdk.VirtualThreadPinned", "com.jfr.String"};
Recording recording = startRecording(events);
Runnable r = () -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@

import java.util.List;

import org.junit.Assume;
import org.junit.Test;

import jdk.graal.compiler.serviceprovider.JavaVersionUtil;
import jdk.jfr.EventType;
import jdk.jfr.Recording;
import jdk.jfr.consumer.RecordedEvent;
Expand All @@ -45,6 +47,7 @@ public class TestMirrorEvents extends JfrRecordingTest {

@Test
public void test() throws Throwable {
Assume.assumeFalse("Currently broken on JDK 23+ (GR-51526)", JavaVersionUtil.JAVA_SPEC >= 23);
String[] events = new String[]{"jdk.ThreadSleep", "jdk.VirtualThreadStart", "jdk.VirtualThreadEnd"};
Recording recording = startRecording(events);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
package com.oracle.svm.test.jfr;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeTrue;

import java.util.Collections;
Expand All @@ -37,14 +37,14 @@
import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;

import jdk.jfr.Recording;
import org.junit.Test;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Test;

import com.oracle.svm.core.jfr.JfrEvent;

import jdk.graal.compiler.serviceprovider.JavaVersionUtil;

import jdk.jfr.Recording;
import jdk.jfr.consumer.RecordedClass;
import jdk.jfr.consumer.RecordedEvent;
import jdk.jfr.consumer.RecordedThread;
Expand All @@ -68,6 +68,7 @@ public void checkJavaVersion() {

@Test
public void test() throws Throwable {
Assume.assumeFalse("Currently broken on JDK 23+ (GR-51526)", JavaVersionUtil.JAVA_SPEC >= 23);
String[] events = new String[]{JfrEvent.JavaMonitorWait.getName()};
Recording recording = startRecording(events);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,13 @@
import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;

import jdk.graal.compiler.serviceprovider.JavaVersionUtil;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Test;

import com.oracle.svm.core.jfr.JfrEvent;

import jdk.graal.compiler.serviceprovider.JavaVersionUtil;
import jdk.jfr.Recording;
import jdk.jfr.consumer.RecordedClass;
import jdk.jfr.consumer.RecordedEvent;
Expand Down Expand Up @@ -70,6 +71,7 @@ public void checkJavaVersion() {

@Test
public void test() throws Throwable {
Assume.assumeFalse("Currently broken on JDK 23+ (GR-51526)", JavaVersionUtil.JAVA_SPEC >= 23);
String[] events = new String[]{JfrEvent.JavaMonitorWait.getName()};
Recording recording = startRecording(events);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@
import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;

import jdk.graal.compiler.serviceprovider.JavaVersionUtil;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Test;

import com.oracle.svm.core.jfr.JfrEvent;

import jdk.graal.compiler.serviceprovider.JavaVersionUtil;
import jdk.jfr.consumer.RecordedClass;
import jdk.jfr.consumer.RecordedThread;
import jdk.jfr.consumer.RecordingStream;
Expand All @@ -64,6 +65,7 @@ public void checkJavaVersion() {

@Test
public void test() throws Throwable {
Assume.assumeFalse("Currently broken on JDK 23+ (GR-51526)", JavaVersionUtil.JAVA_SPEC >= 23);
String[] events = new String[]{JfrEvent.JavaMonitorWait.getName()};
RecordingStream stream = startStream(events);

Expand Down

0 comments on commit 88f3a86

Please sign in to comment.