hotspot/test/compiler/whitebox/IsMethodCompilableTest.java
changeset 16367 9cd60b8380a1
parent 15793 4867678e3517
child 16689 efce070b8d42
equal deleted inserted replaced
16366:b54bc5cfaa6d 16367:9cd60b8380a1
    42             PER_METHOD_RECOMPILATION_CUTOFF = 1 + (0xFFFFFFFFL & tmp);
    42             PER_METHOD_RECOMPILATION_CUTOFF = 1 + (0xFFFFFFFFL & tmp);
    43         }
    43         }
    44     }
    44     }
    45 
    45 
    46     public static void main(String[] args) throws Exception {
    46     public static void main(String[] args) throws Exception {
       
    47         // to prevent inlining #method into #compile()
       
    48         WHITE_BOX.setDontInlineMethod(METHOD, true);
    47         new IsMethodCompilableTest().runTest();
    49         new IsMethodCompilableTest().runTest();
    48     }
    50     }
    49 
    51 
    50     protected void test() throws Exception {
    52     protected void test() throws Exception {
    51         if (!WHITE_BOX.isMethodCompilable(METHOD)) {
    53         if (!WHITE_BOX.isMethodCompilable(METHOD)) {
    56         if (PER_METHOD_RECOMPILATION_CUTOFF == -1) {
    58         if (PER_METHOD_RECOMPILATION_CUTOFF == -1) {
    57             System.err.println(
    59             System.err.println(
    58                     "Warning: test is not applicable if PerMethodRecompilationCutoff == Inf");
    60                     "Warning: test is not applicable if PerMethodRecompilationCutoff == Inf");
    59             return;
    61             return;
    60         }
    62         }
    61         // to prevent inlining #method into #compile()
       
    62         WHITE_BOX.setDontInlineMethod(METHOD, true);
       
    63         boolean madeNotCompilable = false;
    63         boolean madeNotCompilable = false;
    64 
    64 
    65         for (long i = 0; i < PER_METHOD_RECOMPILATION_CUTOFF; ++i) {
    65         for (long i = 0; i < PER_METHOD_RECOMPILATION_CUTOFF; ++i) {
    66             compile();
    66             compile();
    67             waitBackgroundCompilation(METHOD);
    67             waitBackgroundCompilation(METHOD);