src/share/vm/runtime/simpleThresholdPolicy.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File hotspot Cdiff src/share/vm/runtime/simpleThresholdPolicy.cpp

src/share/vm/runtime/simpleThresholdPolicy.cpp

Print this page

        

*** 31,40 **** --- 31,41 ---- #include "code/scopeDesc.hpp" #if INCLUDE_JVMCI #include "jvmci/jvmciRuntime.hpp" #endif + #ifdef TIERED 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();
*** 240,249 **** --- 241,267 ---- 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.
*** 273,282 **** --- 291,303 ---- // Call and loop predicates determine whether a transition to a higher // compilation level should be performed (pointers to predicate functions // are passed to common() transition function). bool SimpleThresholdPolicy::loop_predicate(int i, int b, CompLevel cur_level, Method* method) { switch(cur_level) { + case CompLevel_aot: { + return loop_predicate_helper<CompLevel_aot>(i, b, 1.0, method); + } case CompLevel_none: case CompLevel_limited_profile: { return loop_predicate_helper<CompLevel_none>(i, b, 1.0, method); } case CompLevel_full_profile: {
*** 287,296 **** --- 308,320 ---- } } bool SimpleThresholdPolicy::call_predicate(int i, int b, CompLevel cur_level, Method* method) { switch(cur_level) { + case CompLevel_aot: { + return call_predicate_helper<CompLevel_aot>(i, b, 1.0, method); + } case CompLevel_none: case CompLevel_limited_profile: { return call_predicate_helper<CompLevel_none>(i, b, 1.0, method); } case CompLevel_full_profile: {
*** 319,332 **** CompLevel SimpleThresholdPolicy::common(Predicate p, Method* method, CompLevel cur_level) { CompLevel next_level = cur_level; int i = method->invocation_count(); int b = method->backedge_count(); ! if (is_trivial(method)) { next_level = CompLevel_simple; } else { switch(cur_level) { case CompLevel_none: // If we were at full profile level, would we switch to full opt? if (common(p, method, CompLevel_full_profile) == CompLevel_full_optimization) { next_level = CompLevel_full_optimization; } else if ((this->*p)(i, b, cur_level, method)) { --- 343,362 ---- CompLevel SimpleThresholdPolicy::common(Predicate p, Method* method, CompLevel cur_level) { CompLevel next_level = cur_level; int i = method->invocation_count(); int b = method->backedge_count(); ! if (is_trivial(method) && cur_level != CompLevel_aot) { next_level = CompLevel_simple; } else { switch(cur_level) { + case CompLevel_aot: { + if ((this->*p)(i, b, cur_level, method)) { + next_level = CompLevel_full_profile; + } + } + break; case CompLevel_none: // If we were at full profile level, would we switch to full opt? if (common(p, method, CompLevel_full_profile) == CompLevel_full_optimization) { next_level = CompLevel_full_optimization; } else if ((this->*p)(i, b, cur_level, method)) {
*** 436,440 **** --- 466,472 ---- if (!is_compiling && next_osr_level != level) { compile(mh, bci, next_osr_level, thread); } } } + + #endif
src/share/vm/runtime/simpleThresholdPolicy.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File