mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8214523: Fix nmethod asserts for concurrent nmethod unloading
Reviewed-by: coleenp, kvn
This commit is contained in:
parent
fff6e05c96
commit
86a41aa926
1 changed files with 8 additions and 2 deletions
|
@ -1053,7 +1053,8 @@ void nmethod::make_unloaded() {
|
||||||
// recorded in instanceKlasses get flushed.
|
// recorded in instanceKlasses get flushed.
|
||||||
// Since this work is being done during a GC, defer deleting dependencies from the
|
// Since this work is being done during a GC, defer deleting dependencies from the
|
||||||
// InstanceKlass.
|
// InstanceKlass.
|
||||||
assert(Universe::heap()->is_gc_active(), "should only be called during gc");
|
assert(Universe::heap()->is_gc_active() || Thread::current()->is_ConcurrentGC_thread(),
|
||||||
|
"should only be called during gc");
|
||||||
flush_dependencies(/*delete_immediately*/false);
|
flush_dependencies(/*delete_immediately*/false);
|
||||||
|
|
||||||
// Break cycle between nmethod & method
|
// Break cycle between nmethod & method
|
||||||
|
@ -1095,7 +1096,8 @@ void nmethod::make_unloaded() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make the class unloaded - i.e., change state and notify sweeper
|
// Make the class unloaded - i.e., change state and notify sweeper
|
||||||
assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
|
assert(SafepointSynchronize::is_at_safepoint() || Thread::current()->is_ConcurrentGC_thread(),
|
||||||
|
"must be at safepoint");
|
||||||
|
|
||||||
// Unregister must be done before the state change
|
// Unregister must be done before the state change
|
||||||
Universe::heap()->unregister_nmethod(this);
|
Universe::heap()->unregister_nmethod(this);
|
||||||
|
@ -2923,6 +2925,10 @@ void nmethod::clear_speculation_log() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void nmethod::maybe_invalidate_installed_code() {
|
void nmethod::maybe_invalidate_installed_code() {
|
||||||
|
if (!is_compiled_by_jvmci()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
assert(Patching_lock->is_locked() ||
|
assert(Patching_lock->is_locked() ||
|
||||||
SafepointSynchronize::is_at_safepoint(), "should be performed under a lock for consistency");
|
SafepointSynchronize::is_at_safepoint(), "should be performed under a lock for consistency");
|
||||||
oop installed_code = JNIHandles::resolve(_jvmci_installed_code);
|
oop installed_code = JNIHandles::resolve(_jvmci_installed_code);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue