void NonTieredCompPolicy::trace_frequency_counter_overflow(methodHandle m, int branch_bci, int bci) { if (TraceInvocationCounterOverflow) { InvocationCounter* ic = m->invocation_counter(); InvocationCounter* bc = m->backedge_counter(); ResourceMark rm; const char* msg = bci == InvocationEntryBci ? "comp-policy cntr ovfl @ %d in entry of " : "comp-policy cntr ovfl @ %d in loop of "; tty->print(msg, bci); m->print_value(); tty->cr(); ic->print(); bc->print(); if (ProfileInterpreter) { if (bci != InvocationEntryBci) { methodDataOop mdo = m->method_data(); if (mdo != NULL) { int count = mdo->bci_to_data(branch_bci)->as_JumpData()->taken(); tty->print_cr("back branch count = %d", count); } } } } }
void NonTieredCompPolicy::reset_counter_for_invocation_event(methodHandle m) { // Make sure invocation and backedge counter doesn't overflow again right away // as would be the case for native methods. // BUT also make sure the method doesn't look like it was never executed. // Set carry bit and reduce counter's value to min(count, CompileThreshold/2). m->invocation_counter()->set_carry(); m->backedge_counter()->set_carry(); assert(!m->was_never_executed(), "don't reset to 0 -- could be mistaken for never-executed"); }
void NonTieredCompPolicy::reset_counter_for_back_branch_event(methodHandle m) { // Delay next back-branch event but pump up invocation counter to triger // whole method compilation. InvocationCounter* i = m->invocation_counter(); InvocationCounter* b = m->backedge_counter(); // Don't set invocation_counter's value too low otherwise the method will // look like immature (ic < ~5300) which prevents the inlining based on // the type profiling. i->set(i->state(), CompileThreshold); // Don't reset counter too low - it is used to check if OSR method is ready. b->set(b->state(), CompileThreshold / 2); }
static address do_decay(methodHandle method, TRAPS) { // decay invocation counters so compilation gets delayed method->invocation_counter()->decay(); return NULL; }
static address do_nothing(methodHandle method, TRAPS) { // dummy action for inactive invocation counters method->invocation_counter()->set_carry(); method->invocation_counter()->set_state(InvocationCounter::wait_for_nothing); return NULL; }