Skip to content

Commit 88b4a90

Browse files
author
SendaoYan
committed
8349689: Several virtual thread tests missing /native keyword
Reviewed-by: alanb, lmesnik
1 parent d558d9d commit 88b4a90

File tree

12 files changed

+55
-54
lines changed

12 files changed

+55
-54
lines changed

test/jdk/java/lang/Thread/virtual/JfrEvents.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,7 @@
2727
* @requires vm.continuations
2828
* @modules jdk.jfr java.base/java.lang:+open jdk.management
2929
* @library /test/lib
30-
* @run junit/othervm --enable-native-access=ALL-UNNAMED JfrEvents
30+
* @run junit/othervm/native --enable-native-access=ALL-UNNAMED JfrEvents
3131
*/
3232

3333
import java.io.IOException;

test/jdk/java/lang/Thread/virtual/MonitorEnterExit.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -27,87 +27,87 @@
2727
* @modules java.base/java.lang:+open jdk.management
2828
* @library /test/lib
2929
* @build LockingMode
30-
* @run junit/othervm --enable-native-access=ALL-UNNAMED MonitorEnterExit
30+
* @run junit/othervm/native --enable-native-access=ALL-UNNAMED MonitorEnterExit
3131
*/
3232

3333
/*
3434
* @test id=LM_LEGACY
3535
* @modules java.base/java.lang:+open jdk.management
3636
* @library /test/lib
3737
* @build LockingMode
38-
* @run junit/othervm -XX:LockingMode=1 --enable-native-access=ALL-UNNAMED MonitorEnterExit
38+
* @run junit/othervm/native -XX:LockingMode=1 --enable-native-access=ALL-UNNAMED MonitorEnterExit
3939
*/
4040

4141
/*
4242
* @test id=LM_LIGHTWEIGHT
4343
* @modules java.base/java.lang:+open jdk.management
4444
* @library /test/lib
4545
* @build LockingMode
46-
* @run junit/othervm -XX:LockingMode=2 --enable-native-access=ALL-UNNAMED MonitorEnterExit
46+
* @run junit/othervm/native -XX:LockingMode=2 --enable-native-access=ALL-UNNAMED MonitorEnterExit
4747
*/
4848

4949
/*
5050
* @test id=Xint-LM_LEGACY
5151
* @modules java.base/java.lang:+open jdk.management
5252
* @library /test/lib
5353
* @build LockingMode
54-
* @run junit/othervm -Xint -XX:LockingMode=1 --enable-native-access=ALL-UNNAMED MonitorEnterExit
54+
* @run junit/othervm/native -Xint -XX:LockingMode=1 --enable-native-access=ALL-UNNAMED MonitorEnterExit
5555
*/
5656

5757
/*
5858
* @test id=Xint-LM_LIGHTWEIGHT
5959
* @modules java.base/java.lang:+open jdk.management
6060
* @library /test/lib
6161
* @build LockingMode
62-
* @run junit/othervm -Xint -XX:LockingMode=2 --enable-native-access=ALL-UNNAMED MonitorEnterExit
62+
* @run junit/othervm/native -Xint -XX:LockingMode=2 --enable-native-access=ALL-UNNAMED MonitorEnterExit
6363
*/
6464

6565
/*
6666
* @test id=Xcomp-LM_LEGACY
6767
* @modules java.base/java.lang:+open jdk.management
6868
* @library /test/lib
6969
* @build LockingMode
70-
* @run junit/othervm -Xcomp -XX:LockingMode=1 --enable-native-access=ALL-UNNAMED MonitorEnterExit
70+
* @run junit/othervm/native -Xcomp -XX:LockingMode=1 --enable-native-access=ALL-UNNAMED MonitorEnterExit
7171
*/
7272

7373
/*
7474
* @test id=Xcomp-LM_LIGHTWEIGHT
7575
* @modules java.base/java.lang:+open jdk.management
7676
* @library /test/lib
7777
* @build LockingMode
78-
* @run junit/othervm -Xcomp -XX:LockingMode=2 --enable-native-access=ALL-UNNAMED MonitorEnterExit
78+
* @run junit/othervm/native -Xcomp -XX:LockingMode=2 --enable-native-access=ALL-UNNAMED MonitorEnterExit
7979
*/
8080

8181
/*
8282
* @test id=Xcomp-TieredStopAtLevel1-LM_LEGACY
8383
* @modules java.base/java.lang:+open jdk.management
8484
* @library /test/lib
8585
* @build LockingMode
86-
* @run junit/othervm -Xcomp -XX:TieredStopAtLevel=1 -XX:LockingMode=1 --enable-native-access=ALL-UNNAMED MonitorEnterExit
86+
* @run junit/othervm/native -Xcomp -XX:TieredStopAtLevel=1 -XX:LockingMode=1 --enable-native-access=ALL-UNNAMED MonitorEnterExit
8787
*/
8888

8989
/*
9090
* @test id=Xcomp-TieredStopAtLevel1-LM_LIGHTWEIGHT
9191
* @modules java.base/java.lang:+open jdk.management
9292
* @library /test/lib
9393
* @build LockingMode
94-
* @run junit/othervm -Xcomp -XX:TieredStopAtLevel=1 -XX:LockingMode=2 --enable-native-access=ALL-UNNAMED MonitorEnterExit
94+
* @run junit/othervm/native -Xcomp -XX:TieredStopAtLevel=1 -XX:LockingMode=2 --enable-native-access=ALL-UNNAMED MonitorEnterExit
9595
*/
9696

9797
/*
9898
* @test id=Xcomp-noTieredCompilation-LM_LEGACY
9999
* @modules java.base/java.lang:+open jdk.management
100100
* @library /test/lib
101101
* @build LockingMode
102-
* @run junit/othervm -Xcomp -XX:-TieredCompilation -XX:LockingMode=1 --enable-native-access=ALL-UNNAMED MonitorEnterExit
102+
* @run junit/othervm/native -Xcomp -XX:-TieredCompilation -XX:LockingMode=1 --enable-native-access=ALL-UNNAMED MonitorEnterExit
103103
*/
104104

105105
/*
106106
* @test id=Xcomp-noTieredCompilation-LM_LIGHTWEIGHT
107107
* @modules java.base/java.lang:+open jdk.management
108108
* @library /test/lib
109109
* @build LockingMode
110-
* @run junit/othervm -Xcomp -XX:-TieredCompilation -XX:LockingMode=2 --enable-native-access=ALL-UNNAMED MonitorEnterExit
110+
* @run junit/othervm/native -Xcomp -XX:-TieredCompilation -XX:LockingMode=2 --enable-native-access=ALL-UNNAMED MonitorEnterExit
111111
*/
112112

113113
import java.time.Duration;

test/jdk/java/lang/Thread/virtual/MonitorWaitNotify.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -27,87 +27,87 @@
2727
* @modules java.base/java.lang:+open jdk.management
2828
* @library /test/lib
2929
* @build LockingMode
30-
* @run junit/othervm --enable-native-access=ALL-UNNAMED MonitorWaitNotify
30+
* @run junit/othervm/native --enable-native-access=ALL-UNNAMED MonitorWaitNotify
3131
*/
3232

3333
/*
3434
* @test id=LM_LEGACY
3535
* @modules java.base/java.lang:+open jdk.management
3636
* @library /test/lib
3737
* @build LockingMode
38-
* @run junit/othervm -XX:LockingMode=1 --enable-native-access=ALL-UNNAMED MonitorWaitNotify
38+
* @run junit/othervm/native -XX:LockingMode=1 --enable-native-access=ALL-UNNAMED MonitorWaitNotify
3939
*/
4040

4141
/*
4242
* @test id=LM_LIGHTWEIGHT
4343
* @modules java.base/java.lang:+open jdk.management
4444
* @library /test/lib
4545
* @build LockingMode
46-
* @run junit/othervm -XX:LockingMode=2 --enable-native-access=ALL-UNNAMED MonitorWaitNotify
46+
* @run junit/othervm/native -XX:LockingMode=2 --enable-native-access=ALL-UNNAMED MonitorWaitNotify
4747
*/
4848

4949
/*
5050
* @test id=Xint-LM_LEGACY
5151
* @modules java.base/java.lang:+open jdk.management
5252
* @library /test/lib
5353
* @build LockingMode
54-
* @run junit/othervm -Xint -XX:LockingMode=1 --enable-native-access=ALL-UNNAMED MonitorWaitNotify
54+
* @run junit/othervm/native -Xint -XX:LockingMode=1 --enable-native-access=ALL-UNNAMED MonitorWaitNotify
5555
*/
5656

5757
/*
5858
* @test id=Xint-LM_LIGHTWEIGHT
5959
* @modules java.base/java.lang:+open jdk.management
6060
* @library /test/lib
6161
* @build LockingMode
62-
* @run junit/othervm -Xint -XX:LockingMode=2 --enable-native-access=ALL-UNNAMED MonitorWaitNotify
62+
* @run junit/othervm/native -Xint -XX:LockingMode=2 --enable-native-access=ALL-UNNAMED MonitorWaitNotify
6363
*/
6464

6565
/*
6666
* @test id=Xcomp-LM_LEGACY
6767
* @modules java.base/java.lang:+open jdk.management
6868
* @library /test/lib
6969
* @build LockingMode
70-
* @run junit/othervm -Xcomp -XX:LockingMode=1 --enable-native-access=ALL-UNNAMED MonitorWaitNotify
70+
* @run junit/othervm/native -Xcomp -XX:LockingMode=1 --enable-native-access=ALL-UNNAMED MonitorWaitNotify
7171
*/
7272

7373
/*
7474
* @test id=Xcomp-LM_LIGHTWEIGHT
7575
* @modules java.base/java.lang:+open jdk.management
7676
* @library /test/lib
7777
* @build LockingMode
78-
* @run junit/othervm -Xcomp -XX:LockingMode=2 --enable-native-access=ALL-UNNAMED MonitorWaitNotify
78+
* @run junit/othervm/native -Xcomp -XX:LockingMode=2 --enable-native-access=ALL-UNNAMED MonitorWaitNotify
7979
*/
8080

8181
/*
8282
* @test id=Xcomp-TieredStopAtLevel1-LM_LEGACY
8383
* @modules java.base/java.lang:+open jdk.management
8484
* @library /test/lib
8585
* @build LockingMode
86-
* @run junit/othervm -Xcomp -XX:TieredStopAtLevel=1 -XX:LockingMode=1 --enable-native-access=ALL-UNNAMED MonitorWaitNotify
86+
* @run junit/othervm/native -Xcomp -XX:TieredStopAtLevel=1 -XX:LockingMode=1 --enable-native-access=ALL-UNNAMED MonitorWaitNotify
8787
*/
8888

8989
/*
9090
* @test id=Xcomp-TieredStopAtLevel1-LM_LIGHTWEIGHT
9191
* @modules java.base/java.lang:+open jdk.management
9292
* @library /test/lib
9393
* @build LockingMode
94-
* @run junit/othervm -Xcomp -XX:TieredStopAtLevel=1 -XX:LockingMode=2 --enable-native-access=ALL-UNNAMED MonitorWaitNotify
94+
* @run junit/othervm/native -Xcomp -XX:TieredStopAtLevel=1 -XX:LockingMode=2 --enable-native-access=ALL-UNNAMED MonitorWaitNotify
9595
*/
9696

9797
/*
9898
* @test id=Xcomp-noTieredCompilation-LM_LEGACY
9999
* @modules java.base/java.lang:+open jdk.management
100100
* @library /test/lib
101101
* @build LockingMode
102-
* @run junit/othervm -Xcomp -XX:-TieredCompilation -XX:LockingMode=1 --enable-native-access=ALL-UNNAMED MonitorWaitNotify
102+
* @run junit/othervm/native -Xcomp -XX:-TieredCompilation -XX:LockingMode=1 --enable-native-access=ALL-UNNAMED MonitorWaitNotify
103103
*/
104104

105105
/*
106106
* @test id=Xcomp-noTieredCompilation-LM_LIGHTWEIGHT
107107
* @modules java.base/java.lang:+open jdk.management
108108
* @library /test/lib
109109
* @build LockingMode
110-
* @run junit/othervm -Xcomp -XX:-TieredCompilation -XX:LockingMode=2 --enable-native-access=ALL-UNNAMED MonitorWaitNotify
110+
* @run junit/othervm/native -Xcomp -XX:-TieredCompilation -XX:LockingMode=2 --enable-native-access=ALL-UNNAMED MonitorWaitNotify
111111
*/
112112

113113
import java.util.ArrayList;

test/jdk/java/lang/Thread/virtual/RetryMonitorEnterWhenPinned.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,7 @@
3030
* @modules java.base/java.lang:+open
3131
* @library /test/lib
3232
* @requires vm.opt.LockingMode != 1
33-
* @run main/othervm --enable-native-access=ALL-UNNAMED RetryMonitorEnterWhenPinned
33+
* @run main/othervm/native --enable-native-access=ALL-UNNAMED RetryMonitorEnterWhenPinned
3434
*/
3535

3636
import java.time.Duration;

test/jdk/java/lang/Thread/virtual/Starvation.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2024, 2025 Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -25,7 +25,7 @@
2525
* @requires vm.continuations
2626
* @library /test/lib
2727
* @bug 8345294
28-
* @run main/othervm --enable-native-access=ALL-UNNAMED Starvation 100000
28+
* @run main/othervm/timeout=200/native --enable-native-access=ALL-UNNAMED Starvation 100000
2929
*/
3030

3131
import java.time.Duration;

test/jdk/java/lang/Thread/virtual/SynchronizedNative.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -28,31 +28,31 @@
2828
* @requires vm.continuations
2929
* @modules java.base/java.lang:+open jdk.management
3030
* @library /test/lib
31-
* @run junit/othervm --enable-native-access=ALL-UNNAMED SynchronizedNative
31+
* @run junit/othervm/native --enable-native-access=ALL-UNNAMED SynchronizedNative
3232
*/
3333

3434
/*
3535
* @test id=Xint
3636
* @requires vm.continuations
3737
* @modules java.base/java.lang:+open jdk.management
3838
* @library /test/lib
39-
* @run junit/othervm -Xint --enable-native-access=ALL-UNNAMED SynchronizedNative
39+
* @run junit/othervm/native -Xint --enable-native-access=ALL-UNNAMED SynchronizedNative
4040
*/
4141

4242
/*
4343
* @test id=Xcomp-TieredStopAtLevel1
4444
* @requires vm.continuations
4545
* @modules java.base/java.lang:+open jdk.management
4646
* @library /test/lib
47-
* @run junit/othervm -Xcomp -XX:TieredStopAtLevel=1 --enable-native-access=ALL-UNNAMED SynchronizedNative
47+
* @run junit/othervm/native -Xcomp -XX:TieredStopAtLevel=1 --enable-native-access=ALL-UNNAMED SynchronizedNative
4848
*/
4949

5050
/*
5151
* @test id=Xcomp-noTieredCompilation
5252
* @requires vm.continuations
5353
* @modules java.base/java.lang:+open jdk.management
5454
* @library /test/lib
55-
* @run junit/othervm -Xcomp -XX:-TieredCompilation --enable-native-access=ALL-UNNAMED SynchronizedNative
55+
* @run junit/othervm/native -Xcomp -XX:-TieredCompilation --enable-native-access=ALL-UNNAMED SynchronizedNative
5656
*/
5757

5858
import java.util.concurrent.CountDownLatch;

test/jdk/java/lang/Thread/virtual/ThreadAPI.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2019, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,7 @@
2828
* @modules java.base/java.lang:+open jdk.management
2929
* @library /test/lib
3030
* @build LockingMode
31-
* @run junit/othervm --enable-native-access=ALL-UNNAMED ThreadAPI
31+
* @run junit/othervm/native --enable-native-access=ALL-UNNAMED ThreadAPI
3232
*/
3333

3434
/*
@@ -37,7 +37,7 @@
3737
* @modules java.base/java.lang:+open jdk.management
3838
* @library /test/lib
3939
* @build LockingMode
40-
* @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:-VMContinuations
40+
* @run junit/othervm/native -XX:+UnlockExperimentalVMOptions -XX:-VMContinuations
4141
* --enable-native-access=ALL-UNNAMED ThreadAPI
4242
*/
4343

test/jdk/java/lang/Thread/virtual/ThreadPollOnYield.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -27,7 +27,7 @@
2727
* @summary Test that Thread.yield loop polls for safepoints
2828
* @requires vm.continuations
2929
* @library /test/lib
30-
* @run junit/othervm ThreadPollOnYield
30+
* @run junit/othervm/native --enable-native-access=ALL-UNNAMED ThreadPollOnYield
3131
*/
3232

3333
/*
@@ -36,7 +36,8 @@
3636
* @summary Test that Thread.yield loop polls for safepoints
3737
* @requires vm.continuations & vm.compMode != "Xcomp"
3838
* @library /test/lib
39-
* @run junit/othervm -Xcomp -XX:-TieredCompilation -XX:CompileCommand=inline,*::yield* -XX:CompileCommand=inline,*::*Yield ThreadPollOnYield
39+
* @run junit/othervm/native --enable-native-access=ALL-UNNAMED -Xcomp -XX:-TieredCompilation
40+
* -XX:CompileCommand=inline,*::yield* -XX:CompileCommand=inline,*::*Yield ThreadPollOnYield
4041
*/
4142

4243
import java.util.concurrent.atomic.AtomicBoolean;

test/jdk/java/lang/Thread/virtual/stress/GetStackTraceALotWhenPinned.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -28,15 +28,15 @@
2828
* @requires vm.debug != true
2929
* @modules jdk.management
3030
* @library /test/lib
31-
* @run main/othervm/timeout=300 --enable-native-access=ALL-UNNAMED GetStackTraceALotWhenPinned 100000
31+
* @run main/othervm/native/timeout=300 --enable-native-access=ALL-UNNAMED GetStackTraceALotWhenPinned 100000
3232
*/
3333

3434
/*
3535
* @test
3636
* @requires vm.debug == true
3737
* @modules jdk.management
3838
* @library /test/lib
39-
* @run main/othervm/timeout=300 --enable-native-access=ALL-UNNAMED GetStackTraceALotWhenPinned 50000
39+
* @run main/othervm/native/timeout=300 --enable-native-access=ALL-UNNAMED GetStackTraceALotWhenPinned 50000
4040
*/
4141

4242
import java.time.Instant;

0 commit comments

Comments
 (0)