8209622: applications/kitchensink/Kitchensink.java failed with Kitchensink failed with exit code = 138
Summary: SymbolTableLock no longer checks for safepoints
Reviewed-by: coleenp, rehn
--- a/src/hotspot/share/classfile/symbolTable.cpp Mon Aug 20 12:08:07 2018 +0200
+++ b/src/hotspot/share/classfile/symbolTable.cpp Fri Aug 24 09:12:51 2018 -0500
@@ -134,7 +134,7 @@
void SymbolTable::delete_symbol(Symbol* sym) {
if (sym->refcount() == PERM_REFCOUNT) {
- MutexLocker ml(SymbolTable_lock); // Protect arena
+ MutexLockerEx ml(SymbolArena_lock, Mutex::_no_safepoint_check_flag); // Protect arena
// Deleting permanent symbol should not occur very often (insert race condition),
// so log it.
log_trace_symboltable_helper(sym, "Freeing permanent symbol");
@@ -197,7 +197,7 @@
assert(sym != NULL, "new should call vm_exit_out_of_memory if C_HEAP is exhausted");
} else {
// Allocate to global arena
- MutexLocker ml(SymbolTable_lock); // Protect arena
+ MutexLockerEx ml(SymbolArena_lock, Mutex::_no_safepoint_check_flag); // Protect arena
sym = new (len, arena(), THREAD) Symbol((const u1*)name, len, PERM_REFCOUNT);
}
return sym;
--- a/src/hotspot/share/runtime/mutexLocker.cpp Mon Aug 20 12:08:07 2018 +0200
+++ b/src/hotspot/share/runtime/mutexLocker.cpp Fri Aug 24 09:12:51 2018 -0500
@@ -63,7 +63,7 @@
Mutex* AdapterHandlerLibrary_lock = NULL;
Mutex* SignatureHandlerLibrary_lock = NULL;
Mutex* VtableStubs_lock = NULL;
-Mutex* SymbolTable_lock = NULL;
+Mutex* SymbolArena_lock = NULL;
Mutex* StringTable_lock = NULL;
Monitor* StringDedupQueue_lock = NULL;
Mutex* StringDedupTable_lock = NULL;
@@ -237,7 +237,7 @@
def(ExpandHeap_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_always); // Used during compilation by VM thread
def(JNIHandleBlockFreeList_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_never); // handles are used by VM thread
def(SignatureHandlerLibrary_lock , PaddedMutex , leaf, false, Monitor::_safepoint_check_always);
- def(SymbolTable_lock , PaddedMutex , leaf+2, true, Monitor::_safepoint_check_always);
+ def(SymbolArena_lock , PaddedMutex , leaf+2, true, Monitor::_safepoint_check_never);
def(StringTable_lock , PaddedMutex , leaf, true, Monitor::_safepoint_check_always);
def(ProfilePrint_lock , PaddedMutex , leaf, false, Monitor::_safepoint_check_always); // serial profile printing
def(ExceptionCache_lock , PaddedMutex , leaf, false, Monitor::_safepoint_check_always); // serial profile printing
@@ -280,7 +280,7 @@
def(CompileTaskAlloc_lock , PaddedMutex , nonleaf+2, true, Monitor::_safepoint_check_always);
def(CompileStatistics_lock , PaddedMutex , nonleaf+2, false, Monitor::_safepoint_check_always);
def(DirectivesStack_lock , PaddedMutex , special, true, Monitor::_safepoint_check_never);
- def(MultiArray_lock , PaddedMutex , nonleaf+2, false, Monitor::_safepoint_check_always); // locks SymbolTable_lock
+ def(MultiArray_lock , PaddedMutex , nonleaf+2, false, Monitor::_safepoint_check_always);
def(JvmtiThreadState_lock , PaddedMutex , nonleaf+2, false, Monitor::_safepoint_check_always); // Used by JvmtiThreadState/JvmtiEventController
def(Management_lock , PaddedMutex , nonleaf+2, false, Monitor::_safepoint_check_always); // used for JVM management
--- a/src/hotspot/share/runtime/mutexLocker.hpp Mon Aug 20 12:08:07 2018 +0200
+++ b/src/hotspot/share/runtime/mutexLocker.hpp Fri Aug 24 09:12:51 2018 -0500
@@ -57,7 +57,7 @@
extern Mutex* AdapterHandlerLibrary_lock; // a lock on the AdapterHandlerLibrary
extern Mutex* SignatureHandlerLibrary_lock; // a lock on the SignatureHandlerLibrary
extern Mutex* VtableStubs_lock; // a lock on the VtableStubs
-extern Mutex* SymbolTable_lock; // a lock on the symbol table
+extern Mutex* SymbolArena_lock; // a lock on the symbol table arena
extern Mutex* StringTable_lock; // a lock on the interned string table
extern Monitor* StringDedupQueue_lock; // a lock on the string deduplication queue
extern Mutex* StringDedupTable_lock; // a lock on the string deduplication table