8034188: OSR methods may not be recompiled at proper compilation level

Remove_osr_nmethod doesn't check that it is the correct method

Reviewed-by: kvn, iveresov
This commit is contained in:
Nils Eliasson 2014-02-11 13:29:53 +01:00
parent 94a86285a7
commit cde5c5862b

View file

@ -2711,7 +2711,7 @@ void InstanceKlass::remove_osr_nmethod(nmethod* n) {
Method* m = n->method(); Method* m = n->method();
// Search for match // Search for match
while(cur != NULL && cur != n) { while(cur != NULL && cur != n) {
if (TieredCompilation) { if (TieredCompilation && m == cur->method()) {
// Find max level before n // Find max level before n
max_level = MAX2(max_level, cur->comp_level()); max_level = MAX2(max_level, cur->comp_level());
} }
@ -2733,7 +2733,9 @@ void InstanceKlass::remove_osr_nmethod(nmethod* n) {
cur = next; cur = next;
while (cur != NULL) { while (cur != NULL) {
// Find max level after n // Find max level after n
max_level = MAX2(max_level, cur->comp_level()); if (m == cur->method()) {
max_level = MAX2(max_level, cur->comp_level());
}
cur = cur->osr_link(); cur = cur->osr_link();
} }
m->set_highest_osr_comp_level(max_level); m->set_highest_osr_comp_level(max_level);