equal
deleted
inserted
replaced
614 } |
614 } |
615 |
615 |
616 // The stack-scanning low-cost detection may not see the method was used (which can happen for |
616 // The stack-scanning low-cost detection may not see the method was used (which can happen for |
617 // flat profiles). Check the age counter for possible data. |
617 // flat profiles). Check the age counter for possible data. |
618 if (UseCodeAging && make_not_entrant && (nm->is_compiled_by_c2() || nm->is_compiled_by_c1())) { |
618 if (UseCodeAging && make_not_entrant && (nm->is_compiled_by_c2() || nm->is_compiled_by_c1())) { |
619 MethodCounters* mc = nm->method()->method_counters(); |
619 MethodCounters* mc = nm->method()->get_method_counters(Thread::current()); |
620 if (mc == NULL) { |
|
621 // Sometimes we can get here without MethodCounters. For example if we run with -Xcomp. |
|
622 // Try to allocate them. |
|
623 mc = nm->method()->get_method_counters(Thread::current()); |
|
624 } |
|
625 if (mc != NULL) { |
620 if (mc != NULL) { |
626 // Snapshot the value as it's changed concurrently |
621 // Snapshot the value as it's changed concurrently |
627 int age = mc->nmethod_age(); |
622 int age = mc->nmethod_age(); |
628 if (MethodCounters::is_nmethod_hot(age)) { |
623 if (MethodCounters::is_nmethod_hot(age)) { |
629 // The method has gone through flushing, and it became relatively hot that it deopted |
624 // The method has gone through flushing, and it became relatively hot that it deopted |