Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/share/vm/runtime/compilationPolicy.cpp
32285 views
/*1* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#include "precompiled.hpp"25#include "code/compiledIC.hpp"26#include "code/nmethod.hpp"27#include "code/scopeDesc.hpp"28#include "compiler/compilerOracle.hpp"29#include "interpreter/interpreter.hpp"30#include "oops/methodData.hpp"31#include "oops/method.hpp"32#include "oops/oop.inline.hpp"33#include "prims/nativeLookup.hpp"34#include "runtime/advancedThresholdPolicy.hpp"35#include "runtime/compilationPolicy.hpp"36#include "runtime/frame.hpp"37#include "runtime/handles.inline.hpp"38#include "runtime/rframe.hpp"39#include "runtime/simpleThresholdPolicy.hpp"40#include "runtime/stubRoutines.hpp"41#include "runtime/thread.hpp"42#include "runtime/timer.hpp"43#include "runtime/vframe.hpp"44#include "runtime/vm_operations.hpp"45#include "utilities/events.hpp"46#include "utilities/globalDefinitions.hpp"4748CompilationPolicy* CompilationPolicy::_policy;49elapsedTimer CompilationPolicy::_accumulated_time;50bool CompilationPolicy::_in_vm_startup;5152// Determine compilation policy based on command line argument53void compilationPolicy_init() {54CompilationPolicy::set_in_vm_startup(DelayCompilationDuringStartup);5556switch(CompilationPolicyChoice) {57case 0:58CompilationPolicy::set_policy(new SimpleCompPolicy());59break;6061case 1:62#ifdef COMPILER263CompilationPolicy::set_policy(new StackWalkCompPolicy());64#else65Unimplemented();66#endif67break;68case 2:69#ifdef TIERED70CompilationPolicy::set_policy(new SimpleThresholdPolicy());71#else72Unimplemented();73#endif74break;75case 3:76#ifdef TIERED77CompilationPolicy::set_policy(new AdvancedThresholdPolicy());78#else79Unimplemented();80#endif81break;82default:83fatal("CompilationPolicyChoice must be in the range: [0-3]");84}85CompilationPolicy::policy()->initialize();86}8788void CompilationPolicy::completed_vm_startup() {89if (TraceCompilationPolicy) {90tty->print("CompilationPolicy: completed vm startup.\n");91}92_in_vm_startup = false;93}9495// Returns true if m must be compiled before executing it96// This is intended to force compiles for methods (usually for97// debugging) that would otherwise be interpreted for some reason.98bool CompilationPolicy::must_be_compiled(methodHandle m, int comp_level) {99// Don't allow Xcomp to cause compiles in replay mode100if (ReplayCompiles) return false;101102if (m->has_compiled_code()) return false; // already compiled103if (!can_be_compiled(m, comp_level)) return false;104105return !UseInterpreter || // must compile all methods106(UseCompiler && AlwaysCompileLoopMethods && m->has_loops() && CompileBroker::should_compile_new_jobs()); // eagerly compile loop methods107}108109// Returns true if m is allowed to be compiled110bool CompilationPolicy::can_be_compiled(methodHandle m, int comp_level) {111// allow any levels for WhiteBox112assert(WhiteBoxAPI || comp_level == CompLevel_all || is_compile(comp_level), "illegal compilation level");113114if (m->is_abstract()) return false;115if (DontCompileHugeMethods && m->code_size() > HugeMethodLimit) return false;116117// Math intrinsics should never be compiled as this can lead to118// monotonicity problems because the interpreter will prefer the119// compiled code to the intrinsic version. This can't happen in120// production because the invocation counter can't be incremented121// but we shouldn't expose the system to this problem in testing122// modes.123if (!AbstractInterpreter::can_be_compiled(m)) {124return false;125}126if (comp_level == CompLevel_all) {127if (TieredCompilation) {128// enough to be compilable at any level for tiered129return !m->is_not_compilable(CompLevel_simple) || !m->is_not_compilable(CompLevel_full_optimization);130} else {131// must be compilable at available level for non-tiered132return !m->is_not_compilable(CompLevel_highest_tier);133}134} else if (is_compile(comp_level)) {135return !m->is_not_compilable(comp_level);136}137return false;138}139140// Returns true if m is allowed to be osr compiled141bool CompilationPolicy::can_be_osr_compiled(methodHandle m, int comp_level) {142bool result = false;143if (comp_level == CompLevel_all) {144if (TieredCompilation) {145// enough to be osr compilable at any level for tiered146result = !m->is_not_osr_compilable(CompLevel_simple) || !m->is_not_osr_compilable(CompLevel_full_optimization);147} else {148// must be osr compilable at available level for non-tiered149result = !m->is_not_osr_compilable(CompLevel_highest_tier);150}151} else if (is_compile(comp_level)) {152result = !m->is_not_osr_compilable(comp_level);153}154return (result && can_be_compiled(m, comp_level));155}156157bool CompilationPolicy::is_compilation_enabled() {158// NOTE: CompileBroker::should_compile_new_jobs() checks for UseCompiler159return !delay_compilation_during_startup() && CompileBroker::should_compile_new_jobs();160}161162#ifndef PRODUCT163void CompilationPolicy::print_time() {164tty->print_cr ("Accumulated compilationPolicy times:");165tty->print_cr ("---------------------------");166tty->print_cr (" Total: %3.3f sec.", _accumulated_time.seconds());167}168169void NonTieredCompPolicy::trace_osr_completion(nmethod* osr_nm) {170if (TraceOnStackReplacement) {171if (osr_nm == NULL) tty->print_cr("compilation failed");172else tty->print_cr("nmethod " INTPTR_FORMAT, p2i(osr_nm));173}174}175#endif // !PRODUCT176177void NonTieredCompPolicy::initialize() {178// Setup the compiler thread numbers179if (CICompilerCountPerCPU) {180// Example: if CICompilerCountPerCPU is true, then we get181// max(log2(8)-1,1) = 2 compiler threads on an 8-way machine.182// May help big-app startup time.183_compiler_count = MAX2(log2_int(os::active_processor_count())-1,1);184FLAG_SET_ERGO(intx, CICompilerCount, _compiler_count);185} else {186_compiler_count = CICompilerCount;187}188}189190// Note: this policy is used ONLY if TieredCompilation is off.191// compiler_count() behaves the following way:192// - with TIERED build (with both COMPILER1 and COMPILER2 defined) it should return193// zero for the c1 compilation levels, hence the particular ordering of the194// statements.195// - the same should happen when COMPILER2 is defined and COMPILER1 is not196// (server build without TIERED defined).197// - if only COMPILER1 is defined (client build), zero should be returned for198// the c2 level.199// - if neither is defined - always return zero.200int NonTieredCompPolicy::compiler_count(CompLevel comp_level) {201assert(!TieredCompilation, "This policy should not be used with TieredCompilation");202#ifdef COMPILER2203if (is_c2_compile(comp_level)) {204return _compiler_count;205} else {206return 0;207}208#endif209210#ifdef COMPILER1211if (is_c1_compile(comp_level)) {212return _compiler_count;213} else {214return 0;215}216#endif217218return 0;219}220221void NonTieredCompPolicy::reset_counter_for_invocation_event(methodHandle m) {222// Make sure invocation and backedge counter doesn't overflow again right away223// as would be the case for native methods.224225// BUT also make sure the method doesn't look like it was never executed.226// Set carry bit and reduce counter's value to min(count, CompileThreshold/2).227MethodCounters* mcs = m->method_counters();228assert(mcs != NULL, "MethodCounters cannot be NULL for profiling");229mcs->invocation_counter()->set_carry();230mcs->backedge_counter()->set_carry();231232assert(!m->was_never_executed(), "don't reset to 0 -- could be mistaken for never-executed");233}234235void NonTieredCompPolicy::reset_counter_for_back_branch_event(methodHandle m) {236// Delay next back-branch event but pump up invocation counter to triger237// whole method compilation.238MethodCounters* mcs = m->method_counters();239assert(mcs != NULL, "MethodCounters cannot be NULL for profiling");240InvocationCounter* i = mcs->invocation_counter();241InvocationCounter* b = mcs->backedge_counter();242243// Don't set invocation_counter's value too low otherwise the method will244// look like immature (ic < ~5300) which prevents the inlining based on245// the type profiling.246i->set(i->state(), CompileThreshold);247// Don't reset counter too low - it is used to check if OSR method is ready.248b->set(b->state(), CompileThreshold / 2);249}250251//252// CounterDecay253//254// Interates through invocation counters and decrements them. This255// is done at each safepoint.256//257class CounterDecay : public AllStatic {258static jlong _last_timestamp;259static void do_method(Method* m) {260MethodCounters* mcs = m->method_counters();261if (mcs != NULL) {262mcs->invocation_counter()->decay();263}264}265public:266static void decay();267static bool is_decay_needed() {268return (os::javaTimeMillis() - _last_timestamp) > CounterDecayMinIntervalLength;269}270};271272jlong CounterDecay::_last_timestamp = 0;273274void CounterDecay::decay() {275_last_timestamp = os::javaTimeMillis();276277// This operation is going to be performed only at the end of a safepoint278// and hence GC's will not be going on, all Java mutators are suspended279// at this point and hence SystemDictionary_lock is also not needed.280assert(SafepointSynchronize::is_at_safepoint(), "can only be executed at a safepoint");281int nclasses = SystemDictionary::number_of_classes();282double classes_per_tick = nclasses * (CounterDecayMinIntervalLength * 1e-3 /283CounterHalfLifeTime);284for (int i = 0; i < classes_per_tick; i++) {285Klass* k = SystemDictionary::try_get_next_class();286if (k != NULL && k->oop_is_instance()) {287InstanceKlass::cast(k)->methods_do(do_method);288}289}290}291292// Called at the end of the safepoint293void NonTieredCompPolicy::do_safepoint_work() {294if(UseCounterDecay && CounterDecay::is_decay_needed()) {295CounterDecay::decay();296}297}298299void NonTieredCompPolicy::reprofile(ScopeDesc* trap_scope, bool is_osr) {300ScopeDesc* sd = trap_scope;301MethodCounters* mcs;302InvocationCounter* c;303for (; !sd->is_top(); sd = sd->sender()) {304mcs = sd->method()->method_counters();305if (mcs != NULL) {306// Reset ICs of inlined methods, since they can trigger compilations also.307mcs->invocation_counter()->reset();308}309}310mcs = sd->method()->method_counters();311if (mcs != NULL) {312c = mcs->invocation_counter();313if (is_osr) {314// It was an OSR method, so bump the count higher.315c->set(c->state(), CompileThreshold);316} else {317c->reset();318}319mcs->backedge_counter()->reset();320}321}322323// This method can be called by any component of the runtime to notify the policy324// that it's recommended to delay the complation of this method.325void NonTieredCompPolicy::delay_compilation(Method* method) {326MethodCounters* mcs = method->method_counters();327if (mcs != NULL) {328mcs->invocation_counter()->decay();329mcs->backedge_counter()->decay();330}331}332333void NonTieredCompPolicy::disable_compilation(Method* method) {334MethodCounters* mcs = method->method_counters();335if (mcs != NULL) {336mcs->invocation_counter()->set_state(InvocationCounter::wait_for_nothing);337mcs->backedge_counter()->set_state(InvocationCounter::wait_for_nothing);338}339}340341CompileTask* NonTieredCompPolicy::select_task(CompileQueue* compile_queue) {342return compile_queue->first();343}344345bool NonTieredCompPolicy::is_mature(Method* method) {346MethodData* mdo = method->method_data();347assert(mdo != NULL, "Should be");348uint current = mdo->mileage_of(method);349uint initial = mdo->creation_mileage();350if (current < initial)351return true; // some sort of overflow352uint target;353if (ProfileMaturityPercentage <= 0)354target = (uint) -ProfileMaturityPercentage; // absolute value355else356target = (uint)( (ProfileMaturityPercentage * CompileThreshold) / 100 );357return (current >= initial + target);358}359360nmethod* NonTieredCompPolicy::event(methodHandle method, methodHandle inlinee, int branch_bci,361int bci, CompLevel comp_level, nmethod* nm, JavaThread* thread) {362assert(comp_level == CompLevel_none, "This should be only called from the interpreter");363NOT_PRODUCT(trace_frequency_counter_overflow(method, branch_bci, bci));364if (JvmtiExport::can_post_interpreter_events() && thread->is_interp_only_mode()) {365// If certain JVMTI events (e.g. frame pop event) are requested then the366// thread is forced to remain in interpreted code. This is367// implemented partly by a check in the run_compiled_code368// section of the interpreter whether we should skip running369// compiled code, and partly by skipping OSR compiles for370// interpreted-only threads.371if (bci != InvocationEntryBci) {372reset_counter_for_back_branch_event(method);373return NULL;374}375}376if (CompileTheWorld || ReplayCompiles) {377// Don't trigger other compiles in testing mode378if (bci == InvocationEntryBci) {379reset_counter_for_invocation_event(method);380} else {381reset_counter_for_back_branch_event(method);382}383return NULL;384}385386if (bci == InvocationEntryBci) {387// when code cache is full, compilation gets switched off, UseCompiler388// is set to false389if (!method->has_compiled_code() && UseCompiler) {390method_invocation_event(method, thread);391} else {392// Force counter overflow on method entry, even if no compilation393// happened. (The method_invocation_event call does this also.)394reset_counter_for_invocation_event(method);395}396// compilation at an invocation overflow no longer goes and retries test for397// compiled method. We always run the loser of the race as interpreted.398// so return NULL399return NULL;400} else {401// counter overflow in a loop => try to do on-stack-replacement402nmethod* osr_nm = method->lookup_osr_nmethod_for(bci, CompLevel_highest_tier, true);403NOT_PRODUCT(trace_osr_request(method, osr_nm, bci));404// when code cache is full, we should not compile any more...405if (osr_nm == NULL && UseCompiler) {406method_back_branch_event(method, bci, thread);407osr_nm = method->lookup_osr_nmethod_for(bci, CompLevel_highest_tier, true);408}409if (osr_nm == NULL) {410reset_counter_for_back_branch_event(method);411return NULL;412}413return osr_nm;414}415return NULL;416}417418#ifndef PRODUCT419PRAGMA_FORMAT_NONLITERAL_IGNORED_EXTERNAL420void NonTieredCompPolicy::trace_frequency_counter_overflow(methodHandle m, int branch_bci, int bci) {421if (TraceInvocationCounterOverflow) {422MethodCounters* mcs = m->method_counters();423assert(mcs != NULL, "MethodCounters cannot be NULL for profiling");424InvocationCounter* ic = mcs->invocation_counter();425InvocationCounter* bc = mcs->backedge_counter();426ResourceMark rm;427const char* msg =428bci == InvocationEntryBci429? "comp-policy cntr ovfl @ %d in entry of "430: "comp-policy cntr ovfl @ %d in loop of ";431PRAGMA_DIAG_PUSH432PRAGMA_FORMAT_NONLITERAL_IGNORED_INTERNAL433tty->print(msg, bci);434PRAGMA_DIAG_POP435m->print_value();436tty->cr();437ic->print();438bc->print();439if (ProfileInterpreter) {440if (bci != InvocationEntryBci) {441MethodData* mdo = m->method_data();442if (mdo != NULL) {443int count = mdo->bci_to_data(branch_bci)->as_JumpData()->taken();444tty->print_cr("back branch count = %d", count);445}446}447}448}449}450451void NonTieredCompPolicy::trace_osr_request(methodHandle method, nmethod* osr, int bci) {452if (TraceOnStackReplacement) {453ResourceMark rm;454tty->print(osr != NULL ? "Reused OSR entry for " : "Requesting OSR entry for ");455method->print_short_name(tty);456tty->print_cr(" at bci %d", bci);457}458}459#endif // !PRODUCT460461// SimpleCompPolicy - compile current method462463void SimpleCompPolicy::method_invocation_event(methodHandle m, JavaThread* thread) {464const int comp_level = CompLevel_highest_tier;465const int hot_count = m->invocation_count();466reset_counter_for_invocation_event(m);467const char* comment = "count";468469if (is_compilation_enabled() && can_be_compiled(m, comp_level)) {470nmethod* nm = m->code();471if (nm == NULL ) {472CompileBroker::compile_method(m, InvocationEntryBci, comp_level, m, hot_count, comment, thread);473}474}475}476477void SimpleCompPolicy::method_back_branch_event(methodHandle m, int bci, JavaThread* thread) {478const int comp_level = CompLevel_highest_tier;479const int hot_count = m->backedge_count();480const char* comment = "backedge_count";481482if (is_compilation_enabled() && can_be_osr_compiled(m, comp_level)) {483CompileBroker::compile_method(m, bci, comp_level, m, hot_count, comment, thread);484NOT_PRODUCT(trace_osr_completion(m->lookup_osr_nmethod_for(bci, comp_level, true));)485}486}487// StackWalkCompPolicy - walk up stack to find a suitable method to compile488489#ifdef COMPILER2490const char* StackWalkCompPolicy::_msg = NULL;491492493// Consider m for compilation494void StackWalkCompPolicy::method_invocation_event(methodHandle m, JavaThread* thread) {495const int comp_level = CompLevel_highest_tier;496const int hot_count = m->invocation_count();497reset_counter_for_invocation_event(m);498const char* comment = "count";499500if (is_compilation_enabled() && m->code() == NULL && can_be_compiled(m, comp_level)) {501ResourceMark rm(thread);502frame fr = thread->last_frame();503assert(fr.is_interpreted_frame(), "must be interpreted");504assert(fr.interpreter_frame_method() == m(), "bad method");505506if (TraceCompilationPolicy) {507tty->print("method invocation trigger: ");508m->print_short_name(tty);509tty->print(" ( interpreted " INTPTR_FORMAT ", size=%d ) ", p2i((address)m()), m->code_size());510}511RegisterMap reg_map(thread, false);512javaVFrame* triggerVF = thread->last_java_vframe(®_map);513// triggerVF is the frame that triggered its counter514RFrame* first = new InterpretedRFrame(triggerVF->fr(), thread, m);515516if (first->top_method()->code() != NULL) {517// called obsolete method/nmethod -- no need to recompile518if (TraceCompilationPolicy) tty->print_cr(" --> " INTPTR_FORMAT, p2i(first->top_method()->code()));519} else {520if (TimeCompilationPolicy) accumulated_time()->start();521GrowableArray<RFrame*>* stack = new GrowableArray<RFrame*>(50);522stack->push(first);523RFrame* top = findTopInlinableFrame(stack);524if (TimeCompilationPolicy) accumulated_time()->stop();525assert(top != NULL, "findTopInlinableFrame returned null");526if (TraceCompilationPolicy) top->print();527CompileBroker::compile_method(top->top_method(), InvocationEntryBci, comp_level,528m, hot_count, comment, thread);529}530}531}532533void StackWalkCompPolicy::method_back_branch_event(methodHandle m, int bci, JavaThread* thread) {534const int comp_level = CompLevel_highest_tier;535const int hot_count = m->backedge_count();536const char* comment = "backedge_count";537538if (is_compilation_enabled() && can_be_osr_compiled(m, comp_level)) {539CompileBroker::compile_method(m, bci, comp_level, m, hot_count, comment, thread);540NOT_PRODUCT(trace_osr_completion(m->lookup_osr_nmethod_for(bci, comp_level, true));)541}542}543544RFrame* StackWalkCompPolicy::findTopInlinableFrame(GrowableArray<RFrame*>* stack) {545// go up the stack until finding a frame that (probably) won't be inlined546// into its caller547RFrame* current = stack->at(0); // current choice for stopping548assert( current && !current->is_compiled(), "" );549const char* msg = NULL;550551while (1) {552553// before going up the stack further, check if doing so would get us into554// compiled code555RFrame* next = senderOf(current, stack);556if( !next ) // No next frame up the stack?557break; // Then compile with current frame558559methodHandle m = current->top_method();560methodHandle next_m = next->top_method();561562if (TraceCompilationPolicy && Verbose) {563tty->print("[caller: ");564next_m->print_short_name(tty);565tty->print("] ");566}567568if( !Inline ) { // Inlining turned off569msg = "Inlining turned off";570break;571}572if (next_m->is_not_compilable()) { // Did fail to compile this before/573msg = "caller not compilable";574break;575}576if (next->num() > MaxRecompilationSearchLength) {577// don't go up too high when searching for recompilees578msg = "don't go up any further: > MaxRecompilationSearchLength";579break;580}581if (next->distance() > MaxInterpretedSearchLength) {582// don't go up too high when searching for recompilees583msg = "don't go up any further: next > MaxInterpretedSearchLength";584break;585}586// Compiled frame above already decided not to inline;587// do not recompile him.588if (next->is_compiled()) {589msg = "not going up into optimized code";590break;591}592593// Interpreted frame above us was already compiled. Do not force594// a recompile, although if the frame above us runs long enough an595// OSR might still happen.596if( current->is_interpreted() && next_m->has_compiled_code() ) {597msg = "not going up -- already compiled caller";598break;599}600601// Compute how frequent this call site is. We have current method 'm'.602// We know next method 'next_m' is interpreted. Find the call site and603// check the various invocation counts.604int invcnt = 0; // Caller counts605if (ProfileInterpreter) {606invcnt = next_m->interpreter_invocation_count();607}608int cnt = 0; // Call site counts609if (ProfileInterpreter && next_m->method_data() != NULL) {610ResourceMark rm;611int bci = next->top_vframe()->bci();612ProfileData* data = next_m->method_data()->bci_to_data(bci);613if (data != NULL && data->is_CounterData())614cnt = data->as_CounterData()->count();615}616617// Caller counts / call-site counts; i.e. is this call site618// a hot call site for method next_m?619int freq = (invcnt) ? cnt/invcnt : cnt;620621// Check size and frequency limits622if ((msg = shouldInline(m, freq, cnt)) != NULL) {623break;624}625// Check inlining negative tests626if ((msg = shouldNotInline(m)) != NULL) {627break;628}629630631// If the caller method is too big or something then we do not want to632// compile it just to inline a method633if (!can_be_compiled(next_m, CompLevel_any)) {634msg = "caller cannot be compiled";635break;636}637638if( next_m->name() == vmSymbols::class_initializer_name() ) {639msg = "do not compile class initializer (OSR ok)";640break;641}642643if (TraceCompilationPolicy && Verbose) {644tty->print("\n\t check caller: ");645next_m->print_short_name(tty);646tty->print(" ( interpreted " INTPTR_FORMAT ", size=%d ) ", p2i((address)next_m()), next_m->code_size());647}648649current = next;650}651652assert( !current || !current->is_compiled(), "" );653654if (TraceCompilationPolicy && msg) tty->print("(%s)\n", msg);655656return current;657}658659RFrame* StackWalkCompPolicy::senderOf(RFrame* rf, GrowableArray<RFrame*>* stack) {660RFrame* sender = rf->caller();661if (sender && sender->num() == stack->length()) stack->push(sender);662return sender;663}664665666const char* StackWalkCompPolicy::shouldInline(methodHandle m, float freq, int cnt) {667// Allows targeted inlining668// positive filter: should send be inlined? returns NULL (--> yes)669// or rejection msg670int max_size = MaxInlineSize;671int cost = m->code_size();672673// Check for too many throws (and not too huge)674if (m->interpreter_throwout_count() > InlineThrowCount && cost < InlineThrowMaxSize ) {675return NULL;676}677678// bump the max size if the call is frequent679if ((freq >= InlineFrequencyRatio) || (cnt >= InlineFrequencyCount)) {680if (TraceFrequencyInlining) {681tty->print("(Inlined frequent method)\n");682m->print();683}684max_size = FreqInlineSize;685}686if (cost > max_size) {687return (_msg = "too big");688}689return NULL;690}691692693const char* StackWalkCompPolicy::shouldNotInline(methodHandle m) {694// negative filter: should send NOT be inlined? returns NULL (--> inline) or rejection msg695if (m->is_abstract()) return (_msg = "abstract method");696// note: we allow ik->is_abstract()697if (!m->method_holder()->is_initialized()) return (_msg = "method holder not initialized");698if (m->is_native()) return (_msg = "native method");699nmethod* m_code = m->code();700if (m_code != NULL && m_code->code_size() > InlineSmallCode)701return (_msg = "already compiled into a big method");702703// use frequency-based objections only for non-trivial methods704if (m->code_size() <= MaxTrivialSize) return NULL;705if (UseInterpreter) { // don't use counts with -Xcomp706if ((m->code() == NULL) && m->was_never_executed()) return (_msg = "never executed");707if (!m->was_executed_more_than(MIN2(MinInliningThreshold, CompileThreshold >> 1))) return (_msg = "executed < MinInliningThreshold times");708}709if (Method::has_unloaded_classes_in_signature(m, JavaThread::current())) return (_msg = "unloaded signature classes");710711return NULL;712}713714715716#endif // COMPILER2717718719