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
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import com.oracle.svm.core.feature.AutomaticallyRegisteredImageSingleton;
import com.oracle.svm.core.posix.PosixUtils;
import com.oracle.svm.core.posix.headers.darwin.DarwinTime;
import com.oracle.svm.core.util.BasedOnJDKFile;

import jdk.internal.misc.Unsafe;

Expand Down Expand Up @@ -77,11 +78,8 @@ final class DarwinTimeUtil {
DarwinTimeUtil() {
}

/**
* Based on HotSpot JDK 19 (git commit hash: 967a28c3d85fdde6d5eb48aa0edd8f7597772469, JDK tag:
* jdk-19+36).
*/
@Uninterruptible(reason = "Called from uninterruptible code.", mayBeInlined = true)
@BasedOnJDKFile("src/hotspot/os/bsd/os_bsd.cpp#L799-L821")
long nanoTime() {
if (!U.getBooleanAcquire(this, INITIALIZED_OFFSET)) {
/* Can be called by multiple threads but they should all query the same data. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
import com.oracle.svm.core.thread.Parker.ParkerFactory;
import com.oracle.svm.core.thread.PlatformThreads;
import com.oracle.svm.core.thread.VMThreads.OSThreadHandle;
import com.oracle.svm.core.util.BasedOnJDKFile;
import com.oracle.svm.core.util.UnsignedUtils;
import com.oracle.svm.core.util.VMError;

Expand Down Expand Up @@ -302,10 +303,6 @@ final class Target_java_lang_Thread {
Pthread.pthread_t pthreadIdentifier;
}

/**
* {@link PosixParker} is based on HotSpot class {@code Parker} in {@code os_posix.cpp}, as of JDK
* 19 (git commit hash: 967a28c3d85fdde6d5eb48aa0edd8f7597772469, JDK tag: jdk-19+36).
*/
final class PosixParker extends Parker {
private static final Unsafe U = Unsafe.getUnsafe();
private static final long EVENT_OFFSET = U.objectFieldOffset(PosixParker.class, "event");
Expand Down Expand Up @@ -357,6 +354,7 @@ protected void park(boolean isAbsolute, long time) {
}
}

@BasedOnJDKFile("src/hotspot/os/posix/os_posix.cpp#L1662-L1738")
private void park0(boolean isAbsolute, long time) {
int status = Pthread.pthread_mutex_trylock_no_transition(mutex);
if (status == Errno.EBUSY()) {
Expand Down Expand Up @@ -395,6 +393,7 @@ private void park0(boolean isAbsolute, long time) {
}

@Override
@BasedOnJDKFile("src/hotspot/os/posix/os_posix.cpp#L1740-L1763")
protected void unpark() {
StackOverflowCheck.singleton().makeYellowZoneAvailable();
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import com.oracle.svm.core.thread.Parker.ParkerFactory;
import com.oracle.svm.core.thread.PlatformThreads;
import com.oracle.svm.core.thread.VMThreads.OSThreadHandle;
import com.oracle.svm.core.util.BasedOnJDKFile;
import com.oracle.svm.core.util.TimeUtils;
import com.oracle.svm.core.util.VMError;
import com.oracle.svm.core.windows.headers.Process;
Expand Down Expand Up @@ -179,10 +180,6 @@ protected void yieldCurrent() {
}
}

/**
* {@link WindowsParker} is based on HotSpot class {@code Parker} in {@code os_windows.cpp}, as of
* JDK 19 (git commit hash: 967a28c3d85fdde6d5eb48aa0edd8f7597772469, JDK tag: jdk-19+36).
*/
@Platforms(Platform.WINDOWS.class)
class WindowsParker extends Parker {
private static final long MAX_DWORD = (1L << 32) - 1;
Expand Down Expand Up @@ -211,6 +208,7 @@ protected void reset() {
}

@Override
@BasedOnJDKFile("src/hotspot/os/windows/os_windows.cpp#L5457-L5499")
protected void park(boolean isAbsolute, long time) {
assert time >= 0 && !(isAbsolute && time == 0) : "must not be called otherwise";

Expand Down Expand Up @@ -258,6 +256,7 @@ private static int toDword(long value) {
}

@Override
@BasedOnJDKFile("src/hotspot/os/windows/os_windows.cpp#L5501-L5504")
protected void unpark() {
StackOverflowCheck.singleton().makeYellowZoneAvailable();
try {
Expand Down