本文整理汇总了C++中MethodCounters类的典型用法代码示例。如果您正苦于以下问题:C++ MethodCounters类的具体用法?C++ MethodCounters怎么用?C++ MethodCounters使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MethodCounters类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: assert
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: disable_compilation
void NonTieredCompPolicy::disable_compilation(Method* method) {
MethodCounters* mcs = method->method_counters();
if (mcs != NULL) {
mcs->invocation_counter()->set_state(InvocationCounter::wait_for_nothing);
mcs->backedge_counter()->set_state(InvocationCounter::wait_for_nothing);
}
}
示例3: delay_compilation
// This method can be called by any component of the runtime to notify the policy
// that it's recommended to delay the compilation of this method.
void NonTieredCompPolicy::delay_compilation(Method* method) {
MethodCounters* mcs = method->method_counters();
if (mcs != NULL) {
mcs->invocation_counter()->decay();
mcs->backedge_counter()->decay();
}
}
示例4: interpreter_throwout_count
int interpreter_throwout_count() const {
MethodCounters* mcs = method_counters();
if (mcs == NULL) {
return 0;
} else {
return mcs->interpreter_throwout_count();
}
}
示例5: number_of_breakpoints
// Tracking number of breakpoints, for fullspeed debugging.
// Only mutated by VM thread.
u2 number_of_breakpoints() const {
MethodCounters* mcs = method_counters();
if (mcs == NULL) {
return 0;
} else {
return mcs->number_of_breakpoints();
}
}
示例6: interpreter_invocation_count
int interpreter_invocation_count() {
if (TieredCompilation) {
return invocation_count();
} else {
MethodCounters* mcs = method_counters();
return (mcs == NULL) ? 0 : mcs->interpreter_invocation_count();
}
}
示例7: handle_counter_overflow
// Set carry flags on the counters if necessary
void SimpleThresholdPolicy::handle_counter_overflow(Method* method) {
MethodCounters *mcs = method->method_counters();
if (mcs != NULL) {
set_carry_if_necessary(mcs->invocation_counter());
set_carry_if_necessary(mcs->backedge_counter());
}
MethodData* mdo = method->method_data();
if (mdo != NULL) {
set_carry_if_necessary(mdo->invocation_counter());
set_carry_if_necessary(mdo->backedge_counter());
}
}
示例8: MAX2
// Get a measure of how much mileage the method has on it.
int MethodData::mileage_of(Method* method) {
int mileage = 0;
if (TieredCompilation) {
mileage = MAX2(method->invocation_count(), method->backedge_count());
} else {
int iic = method->interpreter_invocation_count();
if (mileage < iic) mileage = iic;
MethodCounters* mcs = method->method_counters();
if (mcs != NULL) {
InvocationCounter* ic = mcs->invocation_counter();
InvocationCounter* bc = mcs->backedge_counter();
int icval = ic->count();
if (ic->carry()) icval += CompileThreshold;
if (mileage < icval) mileage = icval;
int bcval = bc->count();
if (bc->carry()) bcval += CompileThreshold;
if (mileage < bcval) mileage = bcval;
}
}
return mileage;
}
示例9: reprofile
void NonTieredCompPolicy::reprofile(ScopeDesc* trap_scope, bool is_osr) {
ScopeDesc* sd = trap_scope;
MethodCounters* mcs;
InvocationCounter* c;
for (; !sd->is_top(); sd = sd->sender()) {
mcs = sd->method()->method_counters();
if (mcs != NULL) {
// Reset ICs of inlined methods, since they can trigger compilations also.
mcs->invocation_counter()->reset();
}
}
mcs = sd->method()->method_counters();
if (mcs != NULL) {
c = mcs->invocation_counter();
if (is_osr) {
// It was an OSR method, so bump the count higher.
c->set(c->state(), CompileThreshold);
} else {
c->reset();
}
mcs->backedge_counter()->reset();
}
}
示例10: interpreter_throwout_increment
// Count of times method was exited via exception while interpreting
void interpreter_throwout_increment(TRAPS) {
MethodCounters* mcs = get_method_counters(CHECK);
if (mcs != NULL) {
mcs->interpreter_throwout_increment();
}
}
示例11: decr_number_of_breakpoints
void decr_number_of_breakpoints(TRAPS) {
MethodCounters* mcs = get_method_counters(CHECK);
if (mcs != NULL) {
mcs->decr_number_of_breakpoints();
}
}
示例12: rate
float rate() const {
MethodCounters* mcs = method_counters();
return mcs == NULL ? 0 : mcs->rate();
}
示例13: assert
int CppInterpreter::native_entry(Method* method, intptr_t UNUSED, TRAPS) {
// Make sure method is native and not abstract
assert(method->is_native() && !method->is_abstract(), "should be");
JavaThread *thread = (JavaThread *) THREAD;
ZeroStack *stack = thread->zero_stack();
// Allocate and initialize our frame
InterpreterFrame *frame = InterpreterFrame::build(method, CHECK_0);
thread->push_zero_frame(frame);
interpreterState istate = frame->interpreter_state();
intptr_t *locals = istate->locals();
// Update the invocation counter
if ((UseCompiler || CountCompiledCalls) && !method->is_synchronized()) {
MethodCounters* mcs = method->method_counters();
if (mcs == NULL) {
CALL_VM_NOCHECK(mcs = InterpreterRuntime::build_method_counters(thread, method));
if (HAS_PENDING_EXCEPTION)
goto unwind_and_return;
}
InvocationCounter *counter = mcs->invocation_counter();
counter->increment();
if (counter->reached_InvocationLimit(mcs->backedge_counter())) {
CALL_VM_NOCHECK(
InterpreterRuntime::frequency_counter_overflow(thread, NULL));
if (HAS_PENDING_EXCEPTION)
goto unwind_and_return;
}
}
// Lock if necessary
BasicObjectLock *monitor;
monitor = NULL;
if (method->is_synchronized()) {
monitor = (BasicObjectLock*) istate->stack_base();
oop lockee = monitor->obj();
markOop disp = lockee->mark()->set_unlocked();
monitor->lock()->set_displaced_header(disp);
if (Atomic::cmpxchg_ptr(monitor, lockee->mark_addr(), disp) != disp) {
if (thread->is_lock_owned((address) disp->clear_lock_bits())) {
monitor->lock()->set_displaced_header(NULL);
}
else {
CALL_VM_NOCHECK(InterpreterRuntime::monitorenter(thread, monitor));
if (HAS_PENDING_EXCEPTION)
goto unwind_and_return;
}
}
}
// Get the signature handler
InterpreterRuntime::SignatureHandler *handler; {
address handlerAddr = method->signature_handler();
if (handlerAddr == NULL) {
CALL_VM_NOCHECK(InterpreterRuntime::prepare_native_call(thread, method));
if (HAS_PENDING_EXCEPTION)
goto unlock_unwind_and_return;
handlerAddr = method->signature_handler();
assert(handlerAddr != NULL, "eh?");
}
if (handlerAddr == (address) InterpreterRuntime::slow_signature_handler) {
CALL_VM_NOCHECK(handlerAddr =
InterpreterRuntime::slow_signature_handler(thread, method, NULL,NULL));
if (HAS_PENDING_EXCEPTION)
goto unlock_unwind_and_return;
}
handler = \
InterpreterRuntime::SignatureHandler::from_handlerAddr(handlerAddr);
}
// Get the native function entry point
address function;
function = method->native_function();
assert(function != NULL, "should be set if signature handler is");
// Build the argument list
stack->overflow_check(handler->argument_count() * 2, THREAD);
if (HAS_PENDING_EXCEPTION)
goto unlock_unwind_and_return;
void **arguments;
void *mirror; {
arguments =
(void **) stack->alloc(handler->argument_count() * sizeof(void **));
void **dst = arguments;
void *env = thread->jni_environment();
*(dst++) = &env;
if (method->is_static()) {
istate->set_oop_temp(
method->constants()->pool_holder()->java_mirror());
mirror = istate->oop_temp_addr();
*(dst++) = &mirror;
}
intptr_t *src = locals;
//.........这里部分代码省略.........
示例14: set_rate
void set_rate(float rate, TRAPS) {
MethodCounters* mcs = get_method_counters(CHECK);
if (mcs != NULL) {
mcs->set_rate(rate);
}
}
示例15: do_method
static void do_method(Method* m) {
MethodCounters* mcs = m->method_counters();
if (mcs != NULL) {
mcs->invocation_counter()->decay();
}
}