本文整理汇总了C++中methodHandle::method_counters方法的典型用法代码示例。如果您正苦于以下问题:C++ methodHandle::method_counters方法的具体用法?C++ methodHandle::method_counters怎么用?C++ methodHandle::method_counters使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类methodHandle
的用法示例。
在下文中一共展示了methodHandle::method_counters方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: trace_frequency_counter_overflow
void NonTieredCompPolicy::trace_frequency_counter_overflow(const methodHandle& m, int branch_bci, int bci) {
if (TraceInvocationCounterOverflow) {
MethodCounters* mcs = m->method_counters();
assert(mcs != NULL, "MethodCounters cannot be NULL for profiling");
InvocationCounter* ic = mcs->invocation_counter();
InvocationCounter* bc = mcs->backedge_counter();
ResourceMark rm;
if (bci == InvocationEntryBci) {
tty->print("comp-policy cntr ovfl @ %d in entry of ", bci);
} else {
tty->print("comp-policy cntr ovfl @ %d in loop of ", bci);
}
m->print_value();
tty->cr();
ic->print();
bc->print();
if (ProfileInterpreter) {
if (bci != InvocationEntryBci) {
MethodData* 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);
}
}
}
}
}
示例2: reset_counter_for_invocation_event
void NonTieredCompPolicy::reset_counter_for_invocation_event(const 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).
MethodCounters* mcs = m->method_counters();
assert(mcs != NULL, "MethodCounters cannot be NULL for profiling");
mcs->invocation_counter()->set_carry();
mcs->backedge_counter()->set_carry();
assert(!m->was_never_executed(), "don't reset to 0 -- could be mistaken for never-executed");
}
示例3: reset_counter_for_back_branch_event
void NonTieredCompPolicy::reset_counter_for_back_branch_event(const methodHandle& m) {
// Delay next back-branch event but pump up invocation counter to trigger
// whole method compilation.
MethodCounters* mcs = m->method_counters();
assert(mcs != NULL, "MethodCounters cannot be NULL for profiling");
InvocationCounter* i = mcs->invocation_counter();
InvocationCounter* b = mcs->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);
}