mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 01:54:47 +02:00
8240693: Sweeper should not examine dying metadata in is_unloading() nmethod during static call stub cleaning
Reviewed-by: kvn, coleenp, pliden
This commit is contained in:
parent
76a8557d0c
commit
a5b81d97f9
2 changed files with 7 additions and 2 deletions
|
@ -1073,8 +1073,8 @@ void CodeCache::old_nmethods_do(MetadataClosure* f) {
|
||||||
length = old_compiled_method_table->length();
|
length = old_compiled_method_table->length();
|
||||||
for (int i = 0; i < length; i++) {
|
for (int i = 0; i < length; i++) {
|
||||||
CompiledMethod* cm = old_compiled_method_table->at(i);
|
CompiledMethod* cm = old_compiled_method_table->at(i);
|
||||||
// Only walk alive nmethods, the dead ones will get removed by the sweeper.
|
// Only walk alive nmethods, the dead ones will get removed by the sweeper or GC.
|
||||||
if (cm->is_alive()) {
|
if (cm->is_alive() && !cm->is_unloading()) {
|
||||||
old_compiled_method_table->at(i)->metadata_do(f);
|
old_compiled_method_table->at(i)->metadata_do(f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -642,6 +642,11 @@ bool CompiledMethod::cleanup_inline_caches_impl(bool unloading_occurred, bool cl
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
is_in_static_stub = false;
|
is_in_static_stub = false;
|
||||||
|
if (is_unloading()) {
|
||||||
|
// If the nmethod itself is dying, then it may point at dead metadata.
|
||||||
|
// Nobody should follow that metadata; it is strictly unsafe.
|
||||||
|
continue;
|
||||||
|
}
|
||||||
metadata_Relocation* r = iter.metadata_reloc();
|
metadata_Relocation* r = iter.metadata_reloc();
|
||||||
Metadata* md = r->metadata_value();
|
Metadata* md = r->metadata_value();
|
||||||
if (md != NULL && md->is_method()) {
|
if (md != NULL && md->is_method()) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue