8245128: Kitchensink fails with: assert(destination == (address)-1 || destination == entry) failed: b) MT-unsafe modification of inline cache

Fix too strong assertion by additionally considering races due to class unloading and redefinition.

Reviewed-by: eosterlund, kvn, coleenp, sspitsyn
This commit is contained in:
Christian Hagedorn 2020-06-25 11:43:20 +02:00
parent 31c511e6a5
commit 601e566b26

View File

@ -756,7 +756,9 @@ void CompiledDirectStaticCall::verify_mt_safe(const methodHandle& callee, addres
"a) MT-unsafe modification of inline cache");
address destination = jump->jump_destination();
assert(destination == (address)-1 || destination == entry,
assert(destination == (address)-1 || destination == entry
|| old_method == NULL || !old_method->method_holder()->is_loader_alive() // may have a race due to class unloading.
|| old_method->is_old(), // may be race patching deoptimized nmethod due to redefinition.
"b) MT-unsafe modification of inline cache");
}
#endif // !PRODUCT