From 7f5cdefb5d555334284a766c2ba81574a279fdf5 Mon Sep 17 00:00:00 2001 From: neliasso Date: Tue, 11 Feb 2014 13:29:53 +0100 Subject: [PATCH] 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 --- src/share/vm/oops/instanceKlass.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/share/vm/oops/instanceKlass.cpp b/src/share/vm/oops/instanceKlass.cpp index 06a1324e8..db0e0a54a 100644 --- a/src/share/vm/oops/instanceKlass.cpp +++ b/src/share/vm/oops/instanceKlass.cpp @@ -2771,7 +2771,7 @@ void InstanceKlass::remove_osr_nmethod(nmethod* n) { 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()); } @@ -2793,7 +2793,9 @@ void InstanceKlass::remove_osr_nmethod(nmethod* n) { 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); -- GitLab