8034188: OSR methods may not be recompiled at proper compilation level
Summary: remove_osr_nmethod doesn't check that it is the correct method
Reviewed-by: kvn, iveresov
--- a/hotspot/src/share/vm/oops/instanceKlass.cpp Wed Feb 26 07:46:46 2014 +0100
+++ b/hotspot/src/share/vm/oops/instanceKlass.cpp Tue Feb 11 13:29:53 2014 +0100
@@ -2711,7 +2711,7 @@
Method* m = n->method();
// Search for match
while(cur != NULL && cur != n) {
- if (TieredCompilation) {
+ if (TieredCompilation && m == cur->method()) {
// Find max level before n
max_level = MAX2(max_level, cur->comp_level());
}
@@ -2733,7 +2733,9 @@
cur = next;
while (cur != NULL) {
// 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();
}
m->set_highest_osr_comp_level(max_level);