src/share/vm/runtime/compilationPolicy.cpp

Print this page
rev 1085 : checkpoint unloading changes on 100107

*** 64,74 **** 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 } // Returns true if m is allowed to be compiled bool CompilationPolicy::canBeCompiled(methodHandle m) { if (m->is_abstract()) return false; --- 64,74 ---- 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() && CompileBroker::should_compile_new_jobs()); // eagerly compile loop methods } // Returns true if m is allowed to be compiled bool CompilationPolicy::canBeCompiled(methodHandle m) { if (m->is_abstract()) return false;
*** 125,135 **** int hot_count = m->invocation_count(); reset_counter_for_invocation_event(m); const char* comment = "count"; ! if (!delayCompilationDuringStartup() && canBeCompiled(m) && UseCompiler) { nmethod* nm = m->code(); if (nm == NULL ) { const char* comment = "count"; CompileBroker::compile_method(m, InvocationEntryBci, m, hot_count, comment, CHECK); --- 125,135 ---- int hot_count = m->invocation_count(); reset_counter_for_invocation_event(m); const char* comment = "count"; ! if (!delayCompilationDuringStartup() && canBeCompiled(m) && UseCompiler && CompileBroker::should_compile_new_jobs()) { nmethod* nm = m->code(); if (nm == NULL ) { const char* comment = "count"; CompileBroker::compile_method(m, InvocationEntryBci, m, hot_count, comment, CHECK);
*** 150,160 **** assert(UseCompiler || CompileTheWorld, "UseCompiler should be set by now."); int hot_count = m->backedge_count(); const char* comment = "backedge_count"; ! if (!m->is_not_osr_compilable() && !delayCompilationDuringStartup() && canBeCompiled(m)) { CompileBroker::compile_method(m, loop_top_bci, m, hot_count, comment, CHECK); NOT_PRODUCT(trace_osr_completion(m->lookup_osr_nmethod_for(loop_top_bci));) } } --- 150,160 ---- assert(UseCompiler || CompileTheWorld, "UseCompiler should be set by now."); int hot_count = m->backedge_count(); const char* comment = "backedge_count"; ! if (!m->is_not_osr_compilable() && !delayCompilationDuringStartup() && canBeCompiled(m) && CompileBroker::should_compile_new_jobs()) { CompileBroker::compile_method(m, loop_top_bci, m, hot_count, comment, CHECK); NOT_PRODUCT(trace_osr_completion(m->lookup_osr_nmethod_for(loop_top_bci));) } }
*** 192,202 **** int hot_count = m->invocation_count(); reset_counter_for_invocation_event(m); const char* comment = "count"; ! if (m->code() == NULL && !delayCompilationDuringStartup() && canBeCompiled(m) && UseCompiler) { ResourceMark rm(THREAD); JavaThread *thread = (JavaThread*)THREAD; frame fr = thread->last_frame(); assert(fr.is_interpreted_frame(), "must be interpreted"); assert(fr.interpreter_frame_method() == m(), "bad method"); --- 192,202 ---- int hot_count = m->invocation_count(); reset_counter_for_invocation_event(m); const char* comment = "count"; ! if (m->code() == NULL && !delayCompilationDuringStartup() && canBeCompiled(m) && UseCompiler && CompileBroker::should_compile_new_jobs()) { ResourceMark rm(THREAD); JavaThread *thread = (JavaThread*)THREAD; frame fr = thread->last_frame(); assert(fr.is_interpreted_frame(), "must be interpreted"); assert(fr.interpreter_frame_method() == m(), "bad method");
*** 236,246 **** assert(UseCompiler || CompileTheWorld, "UseCompiler should be set by now."); int hot_count = m->backedge_count(); const char* comment = "backedge_count"; ! if (!m->is_not_osr_compilable() && !delayCompilationDuringStartup() && canBeCompiled(m)) { CompileBroker::compile_method(m, loop_top_bci, m, hot_count, comment, CHECK); NOT_PRODUCT(trace_osr_completion(m->lookup_osr_nmethod_for(loop_top_bci));) } } --- 236,246 ---- assert(UseCompiler || CompileTheWorld, "UseCompiler should be set by now."); int hot_count = m->backedge_count(); const char* comment = "backedge_count"; ! if (!m->is_not_osr_compilable() && !delayCompilationDuringStartup() && canBeCompiled(m) && CompileBroker::should_compile_new_jobs()) { CompileBroker::compile_method(m, loop_top_bci, m, hot_count, comment, CHECK); NOT_PRODUCT(trace_osr_completion(m->lookup_osr_nmethod_for(loop_top_bci));) } }