src/share/vm/classfile/classLoader.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/classfile

src/share/vm/classfile/classLoader.cpp

Print this page
rev 10831 : 8153013: BlockingCompilation test times out
Summary: Task has no invocation count and get stale at once
Reviewed-by: kvn


1617       if (_compile_the_world_class_counter >= CompileTheWorldStartAt) {
1618         if (k.is_null() || exception_occurred) {
1619           // If something went wrong (e.g. ExceptionInInitializerError) we skip this class
1620           tty->print_cr("CompileTheWorld (%d) : Skipping %s", _compile_the_world_class_counter, buffer);
1621         } else {
1622           tty->print_cr("CompileTheWorld (%d) : %s", _compile_the_world_class_counter, buffer);
1623           // Preload all classes to get around uncommon traps
1624           // Iterate over all methods in class
1625           int comp_level = CompilationPolicy::policy()->initial_compile_level();
1626           for (int n = 0; n < k->methods()->length(); n++) {
1627             methodHandle m (THREAD, k->methods()->at(n));
1628             if (can_be_compiled(m, comp_level)) {
1629               if (++_codecache_sweep_counter == CompileTheWorldSafepointInterval) {
1630                 // Give sweeper a chance to keep up with CTW
1631                 VM_ForceSafepoint op;
1632                 VMThread::execute(&op);
1633                 _codecache_sweep_counter = 0;
1634               }
1635               // Force compilation
1636               CompileBroker::compile_method(m, InvocationEntryBci, comp_level,
1637                                             methodHandle(), 0, "CTW", THREAD);
1638               if (HAS_PENDING_EXCEPTION) {
1639                 clear_pending_exception_if_not_oom(CHECK);
1640                 tty->print_cr("CompileTheWorld (%d) : Skipping method: %s", _compile_the_world_class_counter, m->name_and_sig_as_C_string());
1641               } else {
1642                 _compile_the_world_method_counter++;
1643               }
1644               if (TieredCompilation && TieredStopAtLevel >= CompLevel_full_optimization) {
1645                 // Clobber the first compile and force second tier compilation
1646                 nmethod* nm = m->code();
1647                 if (nm != NULL && !m->is_method_handle_intrinsic()) {
1648                   // Throw out the code so that the code cache doesn't fill up
1649                   nm->make_not_entrant();
1650                   m->clear_code();
1651                 }
1652                 CompileBroker::compile_method(m, InvocationEntryBci, CompLevel_full_optimization,
1653                                               methodHandle(), 0, "CTW", THREAD);
1654                 if (HAS_PENDING_EXCEPTION) {
1655                   clear_pending_exception_if_not_oom(CHECK);
1656                   tty->print_cr("CompileTheWorld (%d) : Skipping method: %s", _compile_the_world_class_counter, m->name_and_sig_as_C_string());
1657                 } else {
1658                   _compile_the_world_method_counter++;
1659                 }
1660               }
1661             } else {
1662               tty->print_cr("CompileTheWorld (%d) : Skipping method: %s", _compile_the_world_class_counter, m->name_and_sig_as_C_string());
1663             }
1664 
1665             nmethod* nm = m->code();
1666             if (nm != NULL && !m->is_method_handle_intrinsic()) {
1667               // Throw out the code so that the code cache doesn't fill up
1668               nm->make_not_entrant();
1669               m->clear_code();
1670             }
1671           }
1672         }
1673       }




1617       if (_compile_the_world_class_counter >= CompileTheWorldStartAt) {
1618         if (k.is_null() || exception_occurred) {
1619           // If something went wrong (e.g. ExceptionInInitializerError) we skip this class
1620           tty->print_cr("CompileTheWorld (%d) : Skipping %s", _compile_the_world_class_counter, buffer);
1621         } else {
1622           tty->print_cr("CompileTheWorld (%d) : %s", _compile_the_world_class_counter, buffer);
1623           // Preload all classes to get around uncommon traps
1624           // Iterate over all methods in class
1625           int comp_level = CompilationPolicy::policy()->initial_compile_level();
1626           for (int n = 0; n < k->methods()->length(); n++) {
1627             methodHandle m (THREAD, k->methods()->at(n));
1628             if (can_be_compiled(m, comp_level)) {
1629               if (++_codecache_sweep_counter == CompileTheWorldSafepointInterval) {
1630                 // Give sweeper a chance to keep up with CTW
1631                 VM_ForceSafepoint op;
1632                 VMThread::execute(&op);
1633                 _codecache_sweep_counter = 0;
1634               }
1635               // Force compilation
1636               CompileBroker::compile_method(m, InvocationEntryBci, comp_level,
1637                                             methodHandle(), 0, CompileBroker::Reason_CTW, THREAD);
1638               if (HAS_PENDING_EXCEPTION) {
1639                 clear_pending_exception_if_not_oom(CHECK);
1640                 tty->print_cr("CompileTheWorld (%d) : Skipping method: %s", _compile_the_world_class_counter, m->name_and_sig_as_C_string());
1641               } else {
1642                 _compile_the_world_method_counter++;
1643               }
1644               if (TieredCompilation && TieredStopAtLevel >= CompLevel_full_optimization) {
1645                 // Clobber the first compile and force second tier compilation
1646                 nmethod* nm = m->code();
1647                 if (nm != NULL && !m->is_method_handle_intrinsic()) {
1648                   // Throw out the code so that the code cache doesn't fill up
1649                   nm->make_not_entrant();
1650                   m->clear_code();
1651                 }
1652                 CompileBroker::compile_method(m, InvocationEntryBci, CompLevel_full_optimization,
1653                                               methodHandle(), 0, CompileBroker::Reason_CTW, THREAD);
1654                 if (HAS_PENDING_EXCEPTION) {
1655                   clear_pending_exception_if_not_oom(CHECK);
1656                   tty->print_cr("CompileTheWorld (%d) : Skipping method: %s", _compile_the_world_class_counter, m->name_and_sig_as_C_string());
1657                 } else {
1658                   _compile_the_world_method_counter++;
1659                 }
1660               }
1661             } else {
1662               tty->print_cr("CompileTheWorld (%d) : Skipping method: %s", _compile_the_world_class_counter, m->name_and_sig_as_C_string());
1663             }
1664 
1665             nmethod* nm = m->code();
1666             if (nm != NULL && !m->is_method_handle_intrinsic()) {
1667               // Throw out the code so that the code cache doesn't fill up
1668               nm->make_not_entrant();
1669               m->clear_code();
1670             }
1671           }
1672         }
1673       }


src/share/vm/classfile/classLoader.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File