本文整理汇总了C++中methodHandle::highest_osr_comp_level方法的典型用法代码示例。如果您正苦于以下问题:C++ methodHandle::highest_osr_comp_level方法的具体用法?C++ methodHandle::highest_osr_comp_level怎么用?C++ methodHandle::highest_osr_comp_level使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类methodHandle
的用法示例。
在下文中一共展示了methodHandle::highest_osr_comp_level方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: print_counters
void SimpleThresholdPolicy::print_counters(const char* prefix, methodHandle mh) {
int invocation_count = mh->invocation_count();
int backedge_count = mh->backedge_count();
MethodData* mdh = mh->method_data();
int mdo_invocations = 0, mdo_backedges = 0;
int mdo_invocations_start = 0, mdo_backedges_start = 0;
if (mdh != NULL) {
mdo_invocations = mdh->invocation_count();
mdo_backedges = mdh->backedge_count();
mdo_invocations_start = mdh->invocation_count_start();
mdo_backedges_start = mdh->backedge_count_start();
}
tty->print(" %stotal=%d,%d %smdo=%d(%d),%d(%d)", prefix,
invocation_count, backedge_count, prefix,
mdo_invocations, mdo_invocations_start,
mdo_backedges, mdo_backedges_start);
tty->print(" %smax levels=%d,%d", prefix,
mh->highest_comp_level(), mh->highest_osr_comp_level());
}
示例2: method_back_branch_event
// Handle the back branch event. Notice that we can compile the method
// with a regular entry from here.
void AdvancedThresholdPolicy::method_back_branch_event(const methodHandle& mh, const methodHandle& imh,
int bci, CompLevel level, nmethod* nm, JavaThread* thread) {
if (should_create_mdo(mh(), level)) {
create_mdo(mh, thread);
}
// Check if MDO should be created for the inlined method
if (should_create_mdo(imh(), level)) {
create_mdo(imh, thread);
}
if (is_compilation_enabled()) {
CompLevel next_osr_level = loop_event(imh(), level);
CompLevel max_osr_level = (CompLevel)imh->highest_osr_comp_level();
// At the very least compile the OSR version
if (!CompileBroker::compilation_is_in_queue(imh) && (next_osr_level != level)) {
compile(imh, bci, next_osr_level, thread);
}
// Use loop event as an opportunity to also check if there's been
// enough calls.
CompLevel cur_level, next_level;
if (mh() != imh()) { // If there is an enclosing method
guarantee(nm != NULL, "Should have nmethod here");
cur_level = comp_level(mh());
next_level = call_event(mh(), cur_level);
if (max_osr_level == CompLevel_full_optimization) {
// The inlinee OSRed to full opt, we need to modify the enclosing method to avoid deopts
bool make_not_entrant = false;
if (nm->is_osr_method()) {
// This is an osr method, just make it not entrant and recompile later if needed
make_not_entrant = true;
} else {
if (next_level != CompLevel_full_optimization) {
// next_level is not full opt, so we need to recompile the
// enclosing method without the inlinee
cur_level = CompLevel_none;
make_not_entrant = true;
}
}
if (make_not_entrant) {
if (PrintTieredEvents) {
int osr_bci = nm->is_osr_method() ? nm->osr_entry_bci() : InvocationEntryBci;
print_event(MAKE_NOT_ENTRANT, mh(), mh(), osr_bci, level);
}
nm->make_not_entrant();
}
}
if (!CompileBroker::compilation_is_in_queue(mh)) {
// Fix up next_level if necessary to avoid deopts
if (next_level == CompLevel_limited_profile && max_osr_level == CompLevel_full_profile) {
next_level = CompLevel_full_profile;
}
if (cur_level != next_level) {
compile(mh, InvocationEntryBci, next_level, thread);
}
}
} else {
cur_level = comp_level(imh());
next_level = call_event(imh(), cur_level);
if (!CompileBroker::compilation_is_in_queue(imh) && (next_level != cur_level)) {
compile(imh, InvocationEntryBci, next_level, thread);
}
}
}
}