1636 * If C1 and/or C2 initialization failed, we shut down all compilation. |
1636 * If C1 and/or C2 initialization failed, we shut down all compilation. |
1637 * We do this to keep things simple. This can be changed if it ever turns |
1637 * We do this to keep things simple. This can be changed if it ever turns |
1638 * out to be a problem. |
1638 * out to be a problem. |
1639 */ |
1639 */ |
1640 void CompileBroker::shutdown_compiler_runtime(AbstractCompiler* comp, CompilerThread* thread) { |
1640 void CompileBroker::shutdown_compiler_runtime(AbstractCompiler* comp, CompilerThread* thread) { |
1641 // Free buffer blob, if allocated |
|
1642 if (thread->get_buffer_blob() != NULL) { |
|
1643 MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); |
|
1644 CodeCache::free(thread->get_buffer_blob()); |
|
1645 } |
|
1646 |
|
1647 if (comp->should_perform_shutdown()) { |
1641 if (comp->should_perform_shutdown()) { |
1648 // There are two reasons for shutting down the compiler |
1642 // There are two reasons for shutting down the compiler |
1649 // 1) compiler runtime initialization failed |
1643 // 1) compiler runtime initialization failed |
1650 // 2) The code cache is full and the following flag is set: -XX:-UseCodeCacheFlushing |
1644 // 2) The code cache is full and the following flag is set: -XX:-UseCodeCacheFlushing |
1651 warning("%s initialization failed. Shutting down all compilers", comp->name()); |
1645 warning("%s initialization failed. Shutting down all compilers", comp->name()); |