mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 11:04:34 +02:00
8043063: Code aging should allocate MethodCounters when flushing a method
Make sure that MethodCounters are present when the method is flushed for the first time to switch on code aging Reviewed-by: kvn
This commit is contained in:
parent
397abe646b
commit
d7b76028a4
1 changed files with 5 additions and 0 deletions
|
@ -615,6 +615,11 @@ void NMethodSweeper::possibly_flush(nmethod* nm) {
|
||||||
// flat profiles). Check the age counter for possible data.
|
// flat profiles). Check the age counter for possible data.
|
||||||
if (UseCodeAging && make_not_entrant && (nm->is_compiled_by_c2() || nm->is_compiled_by_c1())) {
|
if (UseCodeAging && make_not_entrant && (nm->is_compiled_by_c2() || nm->is_compiled_by_c1())) {
|
||||||
MethodCounters* mc = nm->method()->method_counters();
|
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 = Method::build_method_counters(nm->method(), Thread::current());
|
||||||
|
}
|
||||||
if (mc != NULL) {
|
if (mc != NULL) {
|
||||||
// Snapshot the value as it's changed concurrently
|
// Snapshot the value as it's changed concurrently
|
||||||
int age = mc->nmethod_age();
|
int age = mc->nmethod_age();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue