8223585: vmTestbase/runtime/pcl/* get SEGV in MetadataOnStackClosure::do_metadata(Metadata*)+0x0
Adjust old method table by only one thread. Reviewed-by: kvn, jcbeyler, sspitsyn
This commit is contained in:
parent
08193be19c
commit
bc264ba95b
@ -1055,7 +1055,7 @@ static void reset_old_method_table() {
|
||||
|
||||
// Remove this method when zombied or unloaded.
|
||||
void CodeCache::unregister_old_nmethod(CompiledMethod* c) {
|
||||
assert_locked_or_safepoint(CodeCache_lock);
|
||||
assert_lock_strong(CodeCache_lock);
|
||||
if (old_compiled_method_table != NULL) {
|
||||
int index = old_compiled_method_table->find(c);
|
||||
if (index != -1) {
|
||||
@ -1070,7 +1070,11 @@ void CodeCache::old_nmethods_do(MetadataClosure* f) {
|
||||
if (old_compiled_method_table != NULL) {
|
||||
length = old_compiled_method_table->length();
|
||||
for (int i = 0; i < length; i++) {
|
||||
old_compiled_method_table->at(i)->metadata_do(f);
|
||||
CompiledMethod* cm = old_compiled_method_table->at(i);
|
||||
// Only walk alive nmethods, the dead ones will get removed by the sweeper.
|
||||
if (cm->is_alive()) {
|
||||
old_compiled_method_table->at(i)->metadata_do(f);
|
||||
}
|
||||
}
|
||||
}
|
||||
log_debug(redefine, class, nmethod)("Walked %d nmethods for mark_on_stack", length);
|
||||
|
@ -1143,7 +1143,6 @@ void nmethod::make_unloaded() {
|
||||
MutexLocker ml(SafepointSynchronize::is_at_safepoint() ? NULL : CodeCache_lock,
|
||||
Mutex::_no_safepoint_check_flag);
|
||||
Universe::heap()->unregister_nmethod(this);
|
||||
CodeCache::unregister_old_nmethod(this);
|
||||
}
|
||||
|
||||
// Clear the method of this dead nmethod
|
||||
@ -1336,7 +1335,6 @@ bool nmethod::make_not_entrant_or_zombie(int state) {
|
||||
MutexLocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
|
||||
if (nmethod_needs_unregister) {
|
||||
Universe::heap()->unregister_nmethod(this);
|
||||
CodeCache::unregister_old_nmethod(this);
|
||||
}
|
||||
flush_dependencies(/*delete_immediately*/true);
|
||||
}
|
||||
@ -1415,6 +1413,7 @@ void nmethod::flush() {
|
||||
}
|
||||
|
||||
Universe::heap()->flush_nmethod(this);
|
||||
CodeCache::unregister_old_nmethod(this);
|
||||
|
||||
CodeBlob::flush();
|
||||
CodeCache::free(this);
|
||||
|
Loading…
Reference in New Issue
Block a user