Skip to content

Commit 27a38d9

Browse files
chadrakoTobiHartmann
authored andcommitted
8371121: compiler/whitebox/DeoptimizeRelocatedNMethod.java fails with C1
Reviewed-by: thartmann, chagedorn
1 parent 4a97563 commit 27a38d9

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

test/hotspot/jtreg/compiler/whitebox/DeoptimizeRelocatedNMethod.java

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
* @library /test/lib /
2929
* @modules java.base/jdk.internal.misc java.management
3030
* @requires vm.opt.DeoptimizeALot != true
31+
* @requires vm.flavor == "server" & (vm.opt.TieredStopAtLevel == null | vm.opt.TieredStopAtLevel == 4)
32+
* @requires !vm.emulatedClient
3133
* @build jdk.test.whitebox.WhiteBox
3234
* @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
3335
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbatch -XX:+SegmentedCodeCache
@@ -55,8 +57,8 @@ public static void main(String [] args) throws Exception {
5557
// Verify not initially compiled
5658
CompilerWhiteBoxTest.checkNotCompiled(method, false);
5759

58-
// Call function enough to compile
59-
callFunction();
60+
// Enqueue method for compilation. This will block since background compilation is disabled
61+
WHITE_BOX.enqueueMethodForCompilation(method, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION);
6062

6163
// Verify now compiled
6264
CompilerWhiteBoxTest.checkCompiled(method, false);
@@ -91,13 +93,6 @@ public static void main(String [] args) throws Exception {
9193
function();
9294
}
9395

94-
// Call function multiple times to trigger compilation
95-
private static void callFunction() {
96-
for (int i = 0; i < CompilerWhiteBoxTest.THRESHOLD; i++) {
97-
function();
98-
}
99-
}
100-
10196
public static void function() {
10297
FUNCTION_RESULT = Math.random();
10398
}

0 commit comments

Comments
 (0)