equal
deleted
inserted
replaced
132 _local_table = new SymbolTableHash(start_size_log_2, END_SIZE, REHASH_LEN); |
132 _local_table = new SymbolTableHash(start_size_log_2, END_SIZE, REHASH_LEN); |
133 } |
133 } |
134 |
134 |
135 void SymbolTable::delete_symbol(Symbol* sym) { |
135 void SymbolTable::delete_symbol(Symbol* sym) { |
136 if (sym->refcount() == PERM_REFCOUNT) { |
136 if (sym->refcount() == PERM_REFCOUNT) { |
137 MutexLocker ml(SymbolTable_lock); // Protect arena |
137 MutexLockerEx ml(SymbolArena_lock, Mutex::_no_safepoint_check_flag); // Protect arena |
138 // Deleting permanent symbol should not occur very often (insert race condition), |
138 // Deleting permanent symbol should not occur very often (insert race condition), |
139 // so log it. |
139 // so log it. |
140 log_trace_symboltable_helper(sym, "Freeing permanent symbol"); |
140 log_trace_symboltable_helper(sym, "Freeing permanent symbol"); |
141 if (!arena()->Afree(sym, sym->size())) { |
141 if (!arena()->Afree(sym, sym->size())) { |
142 log_trace_symboltable_helper(sym, "Leaked permanent symbol"); |
142 log_trace_symboltable_helper(sym, "Leaked permanent symbol"); |
195 // refcount starts as 1 |
195 // refcount starts as 1 |
196 sym = new (len, THREAD) Symbol((const u1*)name, len, 1); |
196 sym = new (len, THREAD) Symbol((const u1*)name, len, 1); |
197 assert(sym != NULL, "new should call vm_exit_out_of_memory if C_HEAP is exhausted"); |
197 assert(sym != NULL, "new should call vm_exit_out_of_memory if C_HEAP is exhausted"); |
198 } else { |
198 } else { |
199 // Allocate to global arena |
199 // Allocate to global arena |
200 MutexLocker ml(SymbolTable_lock); // Protect arena |
200 MutexLockerEx ml(SymbolArena_lock, Mutex::_no_safepoint_check_flag); // Protect arena |
201 sym = new (len, arena(), THREAD) Symbol((const u1*)name, len, PERM_REFCOUNT); |
201 sym = new (len, arena(), THREAD) Symbol((const u1*)name, len, PERM_REFCOUNT); |
202 } |
202 } |
203 return sym; |
203 return sym; |
204 } |
204 } |
205 |
205 |