mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8173338: C2: continuous CallSite relinkage eventually disables compilation for a method
Reviewed-by: jrose, dlong, kvn
This commit is contained in:
parent
81e25c58fb
commit
95ff3ccdb4
4 changed files with 19 additions and 3 deletions
|
@ -1146,6 +1146,14 @@ bool nmethod::make_not_entrant_or_zombie(unsigned int state) {
|
|||
assert(state == zombie || state == not_entrant, "must be zombie or not_entrant");
|
||||
assert(!is_zombie(), "should not already be a zombie");
|
||||
|
||||
if (_state == state) {
|
||||
// Avoid taking the lock if already in required state.
|
||||
// This is safe from races because the state is an end-state,
|
||||
// which the nmethod cannot back out of once entered.
|
||||
// No need for fencing either.
|
||||
return false;
|
||||
}
|
||||
|
||||
// Make sure neither the nmethod nor the method is flushed in case of a safepoint in code below.
|
||||
nmethodLocker nml(this);
|
||||
methodHandle the_method(method());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue