test/compiler/whitebox/LockCompilationTest.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
*** old/test/compiler/whitebox/LockCompilationTest.java Fri Mar 18 15:53:48 2016
--- new/test/compiler/whitebox/LockCompilationTest.java Fri Mar 18 15:53:47 2016
*** 21,35 ****
--- 21,35 ----
* questions.
*/
/*
* @test LockCompilationTest
! * @bug 8059624 8152169
* @library /testlibrary /test/lib /
* @modules java.management
* @build LockCompilationTest
! * @run main ClassFileInstaller sun.hotspot.WhiteBox
! * @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI LockCompilationTest
* @summary testing of WB::lock/unlockCompilation()
*/
*** 40,53 ****
--- 40,68 ----
import compiler.whitebox.CompilerWhiteBoxTest;
import jdk.test.lib.Asserts;
public class LockCompilationTest extends CompilerWhiteBoxTest {
+
public static void main(String[] args) throws Exception {
! // This case waits for 10 seconds and verifies that the method hasn't been
! // This case waits for 5 seconds and verifies that the method hasn't been
// compiled during that time. Only do that for one of the test cases.
+
+ // Only compile SimpleTestCase$Helper.method and exclude all other to ensure no
+ // contention on the compile queue causes problems.
+ String directive =
+ "[{ match:\"*SimpleTestCase$Helper.method\", Exclude:false}, " +
+ " { match:\"*.*\", Exclude:true}]";
+ if (WHITE_BOX.addCompilerDirective(directive) != 2) {
+ throw new RuntimeException("Could not add directive");
+ }
+ try {
CompilerWhiteBoxTest.main(LockCompilationTest::new, new String[] {"METHOD_TEST"});
+ } finally {
+ WHITE_BOX.removeCompilerDirective(2);
+ }
+
}
private LockCompilationTest(TestCase testCase) {
super(testCase);
// to prevent inlining of #method
*** 64,74 ****
--- 79,94 ----
System.out.println("trying to compile");
compile();
// to check if it works correctly w/ safepoints
System.out.println("going to safepoint");
WHITE_BOX.fullGC();
waitBackgroundCompilation();
+ // Sleep a while and then make sure the compile is still waiting
+ try {
+ Thread.sleep(5000);
+ } catch (Exception e) {
+ System.out.println("Thread sleep interrupted");
+ }
Asserts.assertTrue(
WHITE_BOX.isMethodQueuedForCompilation(method),
method + " must be in queue");
Asserts.assertFalse(
WHITE_BOX.isMethodCompiled(method, false),
test/compiler/whitebox/LockCompilationTest.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File