Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions common.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@
"labsjdk-ee-21-llvm": {"name": "labsjdk", "version": "ee-21.0.2+13-jvmci-23.1-b33-sulong", "platformspecific": true },
"graalvm-ee-21": {"name": "graalvm-java21", "version": "23.1.3", "platformspecific": true },

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

"eclipse": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ public final class JVMCIVersionCheck {
private static final Map<String, Map<String, Version>> JVMCI_MIN_VERSIONS = Map.of(
"21", Map.of(DEFAULT_VENDOR_ENTRY, createLegacyVersion(23, 1, 33)),
"24", Map.of(
"Oracle Corporation", createLabsJDKVersion("24+2", 1),
DEFAULT_VENDOR_ENTRY, createLabsJDKVersion("24+2", 1)));
"Oracle Corporation", createLabsJDKVersion("24+3", 1),
DEFAULT_VENDOR_ENTRY, createLabsJDKVersion("24+3", 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 @@ -44,7 +44,7 @@
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Predicate;
import java.util.function.IntPredicate;

import org.graalvm.collections.EconomicSet;

Expand Down Expand Up @@ -557,7 +557,7 @@ protected boolean lookahead(String match) {
return pattern.regionMatches(position, match, 0, match.length());
}

protected boolean lookahead(Predicate<Character> predicate, int length) {
protected boolean lookahead(IntPredicate predicate, int length) {
if (pattern.length() - position < length) {
return false;
}
Expand Down Expand Up @@ -588,7 +588,7 @@ protected boolean consumingLookahead(String match) {
return matches;
}

protected boolean consumingLookahead(Predicate<Character> predicate, int length) {
protected boolean consumingLookahead(IntPredicate predicate, int length) {
final boolean matches = lookahead(predicate, length);
if (matches) {
position += length;
Expand All @@ -603,19 +603,19 @@ protected boolean lookbehind(char c) {
return pattern.charAt(position - 1) == c;
}

protected int count(Predicate<Character> predicate) {
protected int count(IntPredicate predicate) {
return count(predicate, position, pattern.length());
}

protected int countUpTo(Predicate<Character> predicate, int max) {
protected int countUpTo(IntPredicate predicate, int max) {
return count(predicate, position, (int) Math.min(((long) position) + max, pattern.length()));
}

protected int countFrom(Predicate<Character> predicate, int fromIndex) {
protected int countFrom(IntPredicate predicate, int fromIndex) {
return count(predicate, fromIndex, pattern.length());
}

protected int count(Predicate<Character> predicate, int fromIndex, int toIndex) {
protected int count(IntPredicate predicate, int fromIndex, int toIndex) {
for (int i = fromIndex; i < toIndex; i++) {
if (!predicate.test(pattern.charAt(i))) {
return i - fromIndex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Predicate;
import java.util.function.IntPredicate;

import org.graalvm.collections.Pair;

Expand Down Expand Up @@ -457,15 +457,15 @@ private int consumeChar() {
return c;
}

private String getMany(Predicate<Integer> pred) {
private String getMany(IntPredicate pred) {
StringBuilder out = new StringBuilder();
while (!atEnd() && pred.test(curChar())) {
out.appendCodePoint(consumeChar());
}
return out.toString();
}

private String getUpTo(int count, Predicate<Integer> pred) {
private String getUpTo(int count, IntPredicate pred) {
StringBuilder out = new StringBuilder();
int found = 0;
while (found < count && !atEnd() && pred.test(curChar())) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Copyright (c) 2024, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.oracle.svm.core.posix;

import org.graalvm.nativeimage.StackValue;

import com.oracle.svm.core.feature.AutomaticallyRegisteredImageSingleton;
import com.oracle.svm.core.posix.headers.Time;
import com.oracle.svm.core.util.BasedOnJDKFile;
import com.oracle.svm.core.util.PlatformTimeUtils;

@AutomaticallyRegisteredImageSingleton(PlatformTimeUtils.class)
public final class PosixPlatformTimeUtils extends PlatformTimeUtils {

@Override
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+3/src/hotspot/os/posix/os_posix.cpp#L1409-L1415")
protected SecondsNanos javaTimeSystemUTC() {
Time.timespec ts = StackValue.get(Time.timespec.class);
int status = PosixUtils.clock_gettime(Time.CLOCK_REALTIME(), ts);
PosixUtils.checkStatusIs0(status, "javaTimeSystemUTC: clock_gettime(CLOCK_REALTIME) failed.");
return new SecondsNanos(ts.tv_sec(), ts.tv_nsec());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* Copyright (c) 2024, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.oracle.svm.core.windows;

import static com.oracle.svm.core.windows.headers.SysinfoAPI.GetSystemTimeAsFileTime;

import org.graalvm.nativeimage.StackValue;
import org.graalvm.word.WordFactory;

import com.oracle.svm.core.feature.AutomaticallyRegisteredImageSingleton;
import com.oracle.svm.core.util.BasedOnJDKFile;
import com.oracle.svm.core.util.PlatformTimeUtils;
import com.oracle.svm.core.windows.headers.WinBase.FILETIME;

@AutomaticallyRegisteredImageSingleton(PlatformTimeUtils.class)
public final class WindowsPlatformTimeUtils extends PlatformTimeUtils {

@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+3/src/hotspot/os/windows/os_windows.cpp#L1123") //
private static final long OFFSET = 116444736000000000L;

@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+3/src/hotspot/os/windows/os_windows.cpp#L1153-L1155")
private static long offset() {
return OFFSET;
}

/* Returns time ticks in (10th of micro seconds) */
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+3/src/hotspot/os/windows/os_windows.cpp#L1158-L1161")
private static long windowsToTimeTicks(FILETIME wt) {
long a = WordFactory.unsigned(wt.dwHighDateTime()).shiftLeft(32).or(WordFactory.unsigned(wt.dwLowDateTime())).rawValue();
return (a - offset());
}

@Override
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+3/src/hotspot/os/windows/os_windows.cpp#L1198-L1205")
protected SecondsNanos javaTimeSystemUTC() {
FILETIME wt = StackValue.get(FILETIME.class);
GetSystemTimeAsFileTime(wt);
long ticks = windowsToTimeTicks(wt); // 10th of micros
long secs = ticks / 10000000L; // 10000 * 1000
long seconds = secs;
long nanos = (ticks - (secs * 10000000L)) * 100L;
return new SecondsNanos(seconds, nanos);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.graalvm.nativeimage.c.type.CCharPointer;
import org.graalvm.word.PointerBase;

import com.oracle.svm.core.windows.headers.WinBase.FILETIME;
import com.oracle.svm.core.windows.headers.WindowsLibC.WCharPointer;

// Checkstyle: stop
Expand Down Expand Up @@ -89,6 +90,13 @@ public interface SYSTEM_INFO extends PointerBase {
short wProcessorRevision();
}

/**
* Retrieves the current system date and time. The information is in Coordinated Universal Time
* (UTC) format.
*/
@CFunction(transition = NO_TRANSITION)
public static native void GetSystemTimeAsFileTime(FILETIME lpSystemTimeAsFileTime);

/** Retrieves the path of the Windows directory. */
@CFunction(transition = NO_TRANSITION)
public static native int GetWindowsDirectoryW(WCharPointer lpBuffer, int uSize);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright (c) 2023, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023, 2023, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/

package com.oracle.svm.core.jfr;

import com.oracle.svm.core.annotate.TargetClass;
import com.oracle.svm.core.jdk.JDK23OrLater;

@TargetClass(className = "jdk.jfr.internal.HiddenWait", onlyWith = {HasJfrSupport.class, JDK23OrLater.class})
public final class Target_jdk_jfr_internal_HiddenWait {
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import com.oracle.svm.core.jdk.JDK22OrLater;
import com.oracle.svm.core.jdk.JDK23OrLater;
import com.oracle.svm.core.jfr.traceid.JfrTraceId;
import com.oracle.svm.core.util.PlatformTimeUtils;
import com.oracle.svm.core.util.VMError;
import com.oracle.svm.util.ReflectionUtil;

Expand Down Expand Up @@ -198,6 +199,13 @@ public static long getTicksFrequency() {
return JfrTicks.getTicksFrequency();
}

/** See {@code JVM#nanosNow}. */
@Substitute
@TargetElement(onlyWith = JDK23OrLater.class)
public static long nanosNow() {
return PlatformTimeUtils.singleton().nanosNow();
}

/** See {@link JVM#log}. */
@Substitute
public static void log(int tagSetId, int level, String message) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
package com.oracle.svm.core.jfr;

import com.oracle.svm.core.annotate.TargetClass;
import com.oracle.svm.core.jdk.JDK21OrEarlier;

@TargetClass(className = "jdk.jfr.internal.JVM$ChunkRotationMonitor", onlyWith = HasJfrSupport.class)
@TargetClass(className = "jdk.jfr.internal.JVM$ChunkRotationMonitor", onlyWith = {HasJfrSupport.class, JDK21OrEarlier.class})
public final class Target_jdk_jfr_internal_JVM_ChunkRotationMonitor {
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@

package com.oracle.svm.core.jfr.events;

import jdk.graal.compiler.word.Word;

import com.oracle.svm.core.Uninterruptible;
import com.oracle.svm.core.jfr.HasJfrSupport;
import com.oracle.svm.core.jfr.JfrEvent;
Expand All @@ -36,11 +34,14 @@
import com.oracle.svm.core.jfr.JfrNativeEventWriterDataAccess;
import com.oracle.svm.core.jfr.JfrTicks;
import com.oracle.svm.core.jfr.SubstrateJVM;
import com.oracle.svm.core.jfr.Target_jdk_jfr_internal_HiddenWait;
import com.oracle.svm.core.jfr.Target_jdk_jfr_internal_JVM_ChunkRotationMonitor;

import jdk.graal.compiler.word.Word;

public class JavaMonitorWaitEvent {
public static void emit(long startTicks, Object obj, long notifier, long timeout, boolean timedOut) {
if (HasJfrSupport.get() && obj != null && !Target_jdk_jfr_internal_JVM_ChunkRotationMonitor.class.equals(obj.getClass())) {
if (HasJfrSupport.get() && obj != null && !Target_jdk_jfr_internal_JVM_ChunkRotationMonitor.class.equals(obj.getClass()) && !Target_jdk_jfr_internal_HiddenWait.class.equals(obj.getClass())) {
emit0(startTicks, obj, notifier, timeout, timedOut);
}
}
Expand Down
Loading