8058564: Tiered compilation performance drop in PIT

Ensure MethodCounters are created before method is enqueued for compilation

Reviewed-by: kvn, drchase, jiangli
This commit is contained in:
Igor Veresov 2014-09-17 21:15:03 -07:00
parent 964c442938
commit ad7e67c98f
4 changed files with 18 additions and 17 deletions

View file

@ -616,12 +616,7 @@ void NMethodSweeper::possibly_flush(nmethod* nm) {
// The stack-scanning low-cost detection may not see the method was used (which can happen for
// flat profiles). Check the age counter for possible data.
if (UseCodeAging && make_not_entrant && (nm->is_compiled_by_c2() || nm->is_compiled_by_c1())) {
MethodCounters* mc = nm->method()->method_counters();
if (mc == NULL) {
// Sometimes we can get here without MethodCounters. For example if we run with -Xcomp.
// Try to allocate them.
mc = nm->method()->get_method_counters(Thread::current());
}
MethodCounters* mc = nm->method()->get_method_counters(Thread::current());
if (mc != NULL) {
// Snapshot the value as it's changed concurrently
int age = mc->nmethod_age();