src/hotspot/share/compiler/compileBroker.cpp
changeset 51572 d2137bd1e57d
parent 51026 510ac4c08610
child 51577 64331e014bc7
equal deleted inserted replaced
51571:126951ca1462 51572:d2137bd1e57d
  1635  * If C1 and/or C2 initialization failed, we shut down all compilation.
  1635  * If C1 and/or C2 initialization failed, we shut down all compilation.
  1636  * We do this to keep things simple. This can be changed if it ever turns
  1636  * We do this to keep things simple. This can be changed if it ever turns
  1637  * out to be a problem.
  1637  * out to be a problem.
  1638  */
  1638  */
  1639 void CompileBroker::shutdown_compiler_runtime(AbstractCompiler* comp, CompilerThread* thread) {
  1639 void CompileBroker::shutdown_compiler_runtime(AbstractCompiler* comp, CompilerThread* thread) {
       
  1640   // Free buffer blob, if allocated
       
  1641   if (thread->get_buffer_blob() != NULL) {
       
  1642     MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
       
  1643     CodeCache::free(thread->get_buffer_blob());
       
  1644   }
       
  1645 
  1640   if (comp->should_perform_shutdown()) {
  1646   if (comp->should_perform_shutdown()) {
  1641     // There are two reasons for shutting down the compiler
  1647     // There are two reasons for shutting down the compiler
  1642     // 1) compiler runtime initialization failed
  1648     // 1) compiler runtime initialization failed
  1643     // 2) The code cache is full and the following flag is set: -XX:-UseCodeCacheFlushing
  1649     // 2) The code cache is full and the following flag is set: -XX:-UseCodeCacheFlushing
  1644     warning("%s initialization failed. Shutting down all compilers", comp->name());
  1650     warning("%s initialization failed. Shutting down all compilers", comp->name());
  1764         MutexLocker only_one(CompileThread_lock);
  1770         MutexLocker only_one(CompileThread_lock);
  1765         if (can_remove(thread, true)) {
  1771         if (can_remove(thread, true)) {
  1766           if (TraceCompilerThreads) {
  1772           if (TraceCompilerThreads) {
  1767             tty->print_cr("Removing compiler thread %s after " JLONG_FORMAT " ms idle time",
  1773             tty->print_cr("Removing compiler thread %s after " JLONG_FORMAT " ms idle time",
  1768                           thread->name(), thread->idle_time_millis());
  1774                           thread->name(), thread->idle_time_millis());
       
  1775           }
       
  1776           // Free buffer blob, if allocated
       
  1777           if (thread->get_buffer_blob() != NULL) {
       
  1778             MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
       
  1779             CodeCache::free(thread->get_buffer_blob());
  1769           }
  1780           }
  1770           return; // Stop this thread.
  1781           return; // Stop this thread.
  1771         }
  1782         }
  1772       }
  1783       }
  1773       continue;
  1784       continue;