Skip to content

Commit fbb3778

Browse files
committed
svm: annotate *ThreadCpuTimeSupport with @BasedOnJDKFile
1 parent e65fc20 commit fbb3778

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
*/
2525
package com.oracle.svm.core.posix.darwin;
2626

27+
import com.oracle.svm.core.util.BasedOnJDKFile;
2728
import org.graalvm.nativeimage.CurrentIsolate;
2829
import org.graalvm.nativeimage.IsolateThread;
2930
import org.graalvm.nativeimage.StackValue;
@@ -54,10 +55,7 @@ public long getThreadCpuTime(IsolateThread isolateThread, boolean includeSystemT
5455
return getThreadCpuTime(machThread, includeSystemTime);
5556
}
5657

57-
/**
58-
* Based on jdk-20-ga, see <a href=
59-
* "https://github.com/openjdk/jdk20/blob/82749901b1497f524e53e47c45708c8e4a63c8b9/src/hotspot/os/bsd/os_bsd.cpp#L2314">os::thread_cpu_time</a>.
60-
*/
58+
@BasedOnJDKFile("src/hotspot/os/bsd/os_bsd.cpp#L2382-L2407")
6159
@Uninterruptible(reason = "Called from uninterruptible code.", mayBeInlined = true)
6260
private static long getThreadCpuTime(int machThread, boolean includeSystemTime) {
6361
CIntPointer sizePointer = UnsafeStackValue.get(Integer.BYTES);

substratevm/src/com.oracle.svm.core.posix/src/com/oracle/svm/core/posix/linux/LinuxThreadCpuTimeSupport.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
*/
2525
package com.oracle.svm.core.posix.linux;
2626

27+
import com.oracle.svm.core.util.BasedOnJDKFile;
2728
import org.graalvm.nativeimage.CurrentIsolate;
2829
import org.graalvm.nativeimage.IsolateThread;
2930
import org.graalvm.nativeimage.StackValue;
@@ -65,10 +66,7 @@ public long getThreadCpuTime(IsolateThread isolateThread, boolean includeSystemT
6566
return fastCpuTime(pthread);
6667
}
6768

68-
/**
69-
* Based on jdk-20-ga, see <a href=
70-
* "https://github.com/openjdk/jdk/blob/df6cf1e41d0fc2dd5f5c094f66c7c8969cf5548d/src/hotspot/os/linux/os_linux.cpp#L4976">fast_cpu_time(...)</a>.
71-
*/
69+
@BasedOnJDKFile("src/hotspot/os/linux/os_linux.cpp#L5072-L5084")
7270
@Uninterruptible(reason = "Called from uninterruptible code.", mayBeInlined = true)
7371
private static long fastCpuTime(pthread_t pthread) {
7472
CIntPointer threadsClockId = StackValue.get(Integer.BYTES);

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
*/
2525
package com.oracle.svm.core.windows;
2626

27+
import com.oracle.svm.core.util.BasedOnJDKFile;
2728
import org.graalvm.nativeimage.CurrentIsolate;
2829
import org.graalvm.nativeimage.IsolateThread;
2930
import org.graalvm.nativeimage.StackValue;
@@ -54,10 +55,7 @@ public long getThreadCpuTime(IsolateThread isolateThread, boolean includeSystemT
5455
return getThreadCpuTime(hThread, includeSystemTime);
5556
}
5657

57-
/**
58-
* Based on jdk-20-ga, see <a href=
59-
* "https://github.com/openjdk/jdk20/blob/82749901b1497f524e53e47c45708c8e4a63c8b9/src/hotspot/os/windows/os_windows.cpp#L4609">os::thread_cpu_time</a>.
60-
*/
58+
@BasedOnJDKFile("src/hotspot/os/windows/os_windows.cpp#L4709-L4725")
6159
@Uninterruptible(reason = "Called from uninterruptible code.", mayBeInlined = true)
6260
private static long getThreadCpuTime(HANDLE hThread, boolean includeSystemTime) {
6361
FILETIME create = StackValue.get(FILETIME.class);

0 commit comments

Comments
 (0)