本文整理汇总了C++中methodHandle::has_compiled_code方法的典型用法代码示例。如果您正苦于以下问题:C++ methodHandle::has_compiled_code方法的具体用法?C++ methodHandle::has_compiled_code怎么用?C++ methodHandle::has_compiled_code使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类methodHandle
的用法示例。
在下文中一共展示了methodHandle::has_compiled_code方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: must_be_compiled
// Returns true if m must be compiled before executing it
// This is intended to force compiles for methods (usually for
// debugging) that would otherwise be interpreted for some reason.
bool CompilationPolicy::must_be_compiled(methodHandle m, int comp_level) {
if (m->has_compiled_code()) return false; // already compiled
if (!can_be_compiled(m, comp_level)) return false;
return !UseInterpreter || // must compile all methods
(UseCompiler && AlwaysCompileLoopMethods && m->has_loops() && CompileBroker::should_compile_new_jobs()); // eagerly compile loop methods
}
示例2: mustBeCompiled
// Returns true if m must be compiled before executing it
// This is intended to force compiles for methods (usually for
// debugging) that would otherwise be interpreted for some reason.
bool CompilationPolicy::mustBeCompiled(methodHandle m) {
if (m->has_compiled_code()) return false; // already compiled
if (!canBeCompiled(m)) return false;
return !UseInterpreter || // must compile all methods
(UseCompiler && AlwaysCompileLoopMethods && m->has_loops()); // eagerly compile loop methods
}
示例3: compile
// Check if the method can be compiled, change level if necessary
void SimpleThresholdPolicy::compile(const methodHandle& mh, int bci, CompLevel level, JavaThread* thread) {
assert(level <= TieredStopAtLevel, "Invalid compilation level");
if (level == CompLevel_none) {
return;
}
if (level == CompLevel_aot) {
if (mh->has_aot_code()) {
if (PrintTieredEvents) {
print_event(COMPILE, mh, mh, bci, level);
}
MutexLocker ml(Compile_lock);
NoSafepointVerifier nsv;
if (mh->has_aot_code() && mh->code() != mh->aot_code()) {
mh->aot_code()->make_entrant();
if (mh->has_compiled_code()) {
mh->code()->make_not_entrant();
}
Method::set_code(mh, mh->aot_code());
}
}
return;
}
// Check if the method can be compiled. If it cannot be compiled with C1, continue profiling
// in the interpreter and then compile with C2 (the transition function will request that,
// see common() ). If the method cannot be compiled with C2 but still can with C1, compile it with
// pure C1.
if (!can_be_compiled(mh, level)) {
if (level == CompLevel_full_optimization && can_be_compiled(mh, CompLevel_simple)) {
compile(mh, bci, CompLevel_simple, thread);
}
return;
}
if (bci != InvocationEntryBci && mh->is_not_osr_compilable(level)) {
return;
}
if (!CompileBroker::compilation_is_in_queue(mh)) {
if (PrintTieredEvents) {
print_event(COMPILE, mh, mh, bci, level);
}
submit_compile(mh, bci, level, thread);
}
}