8061817: Whitebox.deoptimizeMethod() does not deoptimize all OSR versions of method

Fixed Whitebox.deoptimizeMethod() to deoptimize all OSR versions of the method.

Reviewed-by: kvn, iignatyev
This commit is contained in:
Tobias Hartmann 2014-10-30 13:03:30 +01:00
parent 8aa05f7690
commit fe1762fbd6
5 changed files with 119 additions and 12 deletions

View file

@ -2845,6 +2845,22 @@ void InstanceKlass::remove_osr_nmethod(nmethod* n) {
}
}
int InstanceKlass::mark_osr_nmethods(const Method* m) {
// This is a short non-blocking critical region, so the no safepoint check is ok.
MutexLockerEx ml(OsrList_lock, Mutex::_no_safepoint_check_flag);
nmethod* osr = osr_nmethods_head();
int found = 0;
while (osr != NULL) {
assert(osr->is_osr_method(), "wrong kind of nmethod found in chain");
if (osr->method() == m) {
osr->mark_for_deoptimization();
found++;
}
osr = osr->osr_link();
}
return found;
}
nmethod* InstanceKlass::lookup_osr_nmethod(const Method* m, int bci, int comp_level, bool match_level) const {
// This is a short non-blocking critical region, so the no safepoint check is ok.
MutexLockerEx ml(OsrList_lock, Mutex::_no_safepoint_check_flag);