Skip to content

Commit 43e65c1

Browse files
[GR-51436] Annotate more code with @BasedOnJDKFile.
PullRequest: graal/17047
2 parents 3a75302 + 9296c2f commit 43e65c1

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

substratevm/src/com.oracle.svm.core.posix/src/com/oracle/svm/core/posix/darwin/DarwinSubstitutions.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import com.oracle.svm.core.feature.AutomaticallyRegisteredImageSingleton;
4141
import com.oracle.svm.core.posix.PosixUtils;
4242
import com.oracle.svm.core.posix.headers.darwin.DarwinTime;
43+
import com.oracle.svm.core.util.BasedOnJDKFile;
4344

4445
import jdk.internal.misc.Unsafe;
4546

@@ -77,11 +78,8 @@ final class DarwinTimeUtil {
7778
DarwinTimeUtil() {
7879
}
7980

80-
/**
81-
* Based on HotSpot JDK 19 (git commit hash: 967a28c3d85fdde6d5eb48aa0edd8f7597772469, JDK tag:
82-
* jdk-19+36).
83-
*/
8481
@Uninterruptible(reason = "Called from uninterruptible code.", mayBeInlined = true)
82+
@BasedOnJDKFile("src/hotspot/os/bsd/os_bsd.cpp#L799-L821")
8583
long nanoTime() {
8684
if (!U.getBooleanAcquire(this, INITIALIZED_OFFSET)) {
8785
/* Can be called by multiple threads but they should all query the same data. */

substratevm/src/com.oracle.svm.core.posix/src/com/oracle/svm/core/posix/thread/PosixPlatformThreads.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
import com.oracle.svm.core.thread.Parker.ParkerFactory;
6868
import com.oracle.svm.core.thread.PlatformThreads;
6969
import com.oracle.svm.core.thread.VMThreads.OSThreadHandle;
70+
import com.oracle.svm.core.util.BasedOnJDKFile;
7071
import com.oracle.svm.core.util.UnsignedUtils;
7172
import com.oracle.svm.core.util.VMError;
7273

@@ -302,10 +303,6 @@ final class Target_java_lang_Thread {
302303
Pthread.pthread_t pthreadIdentifier;
303304
}
304305

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

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

397395
@Override
396+
@BasedOnJDKFile("src/hotspot/os/posix/os_posix.cpp#L1740-L1763")
398397
protected void unpark() {
399398
StackOverflowCheck.singleton().makeYellowZoneAvailable();
400399
try {

substratevm/src/com.oracle.svm.core.windows/src/com/oracle/svm/core/windows/WindowsPlatformThreads.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import com.oracle.svm.core.thread.Parker.ParkerFactory;
4444
import com.oracle.svm.core.thread.PlatformThreads;
4545
import com.oracle.svm.core.thread.VMThreads.OSThreadHandle;
46+
import com.oracle.svm.core.util.BasedOnJDKFile;
4647
import com.oracle.svm.core.util.TimeUtils;
4748
import com.oracle.svm.core.util.VMError;
4849
import com.oracle.svm.core.windows.headers.Process;
@@ -179,10 +180,6 @@ protected void yieldCurrent() {
179180
}
180181
}
181182

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

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

@@ -258,6 +256,7 @@ private static int toDword(long value) {
258256
}
259257

260258
@Override
259+
@BasedOnJDKFile("src/hotspot/os/windows/os_windows.cpp#L5501-L5504")
261260
protected void unpark() {
262261
StackOverflowCheck.singleton().makeYellowZoneAvailable();
263262
try {

0 commit comments

Comments
 (0)