test/hotspot/jtreg/compiler/whitebox/LockCompilationTest.java
changeset 48321 e9e3edac1768
parent 47216 71c04702a3d5
equal deleted inserted replaced
48320:8e561c68f72a 48321:e9e3edac1768
    31  * @build sun.hotspot.WhiteBox
    31  * @build sun.hotspot.WhiteBox
    32  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
    32  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
    33  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
    33  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
    34  * @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions
    34  * @run main/othervm -Xbootclasspath/a:. -Xmixed -XX:+UnlockDiagnosticVMOptions
    35  *                   -XX:+WhiteBoxAPI -XX:-UseCounterDecay
    35  *                   -XX:+WhiteBoxAPI -XX:-UseCounterDecay
       
    36  *                   -XX:CompileCommand=compileonly,*SimpleTestCaseHelper::method
    36  *                   compiler.whitebox.LockCompilationTest
    37  *                   compiler.whitebox.LockCompilationTest
    37  */
    38  */
    38 
    39 
    39 package compiler.whitebox;
    40 package compiler.whitebox;
    40 
    41 
    44 
    45 
    45     public static void main(String[] args) throws Exception {
    46     public static void main(String[] args) throws Exception {
    46         // This case waits for 5 seconds and verifies that the method hasn't been
    47         // This case waits for 5 seconds and verifies that the method hasn't been
    47         // compiled during that time. Only do that for one of the test cases.
    48         // compiled during that time. Only do that for one of the test cases.
    48 
    49 
    49         // Only compile SimpleTestCaseHelper.method and exclude all other to ensure no
    50         CompilerWhiteBoxTest.main(LockCompilationTest::new, new String[] {"METHOD_TEST"});
    50         // contention on the compile queue causes problems.
       
    51         String directive =
       
    52                 "[{ match:\"*SimpleTestCaseHelper.method\", Exclude:false}, " +
       
    53                 " { match:\"*.*\", Exclude:true}]";
       
    54         if (WHITE_BOX.addCompilerDirective(directive) != 2) {
       
    55             throw new RuntimeException("Could not add directive");
       
    56         }
       
    57         try {
       
    58             CompilerWhiteBoxTest.main(LockCompilationTest::new, new String[] {"METHOD_TEST"});
       
    59         } finally {
       
    60             WHITE_BOX.removeCompilerDirective(2);
       
    61         }
       
    62 
       
    63     }
    51     }
    64 
    52 
    65     private LockCompilationTest(TestCase testCase) {
    53     private LockCompilationTest(TestCase testCase) {
    66         super(testCase);
    54         super(testCase);
    67         // to prevent inlining of #method
    55         // to prevent inlining of #method