--- old/src/share/vm/runtime/sweeper.cpp 2014-09-17 17:19:52.000000000 -0700 +++ new/src/share/vm/runtime/sweeper.cpp 2014-09-17 17:19:52.000000000 -0700 @@ -616,12 +616,7 @@ // 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();