1.1 --- a/src/share/vm/runtime/compilationPolicy.cpp Mon Sep 24 14:46:06 2012 -0700 1.2 +++ b/src/share/vm/runtime/compilationPolicy.cpp Mon Sep 24 17:59:24 2012 -0700 1.3 @@ -394,28 +394,27 @@ 1.4 // SimpleCompPolicy - compile current method 1.5 1.6 void SimpleCompPolicy::method_invocation_event(methodHandle m, JavaThread* thread) { 1.7 - int hot_count = m->invocation_count(); 1.8 + const int comp_level = CompLevel_highest_tier; 1.9 + const int hot_count = m->invocation_count(); 1.10 reset_counter_for_invocation_event(m); 1.11 const char* comment = "count"; 1.12 1.13 if (is_compilation_enabled() && can_be_compiled(m)) { 1.14 nmethod* nm = m->code(); 1.15 if (nm == NULL ) { 1.16 - const char* comment = "count"; 1.17 - CompileBroker::compile_method(m, InvocationEntryBci, CompLevel_highest_tier, 1.18 - m, hot_count, comment, thread); 1.19 + CompileBroker::compile_method(m, InvocationEntryBci, comp_level, m, hot_count, comment, thread); 1.20 } 1.21 } 1.22 } 1.23 1.24 void SimpleCompPolicy::method_back_branch_event(methodHandle m, int bci, JavaThread* thread) { 1.25 - int hot_count = m->backedge_count(); 1.26 + const int comp_level = CompLevel_highest_tier; 1.27 + const int hot_count = m->backedge_count(); 1.28 const char* comment = "backedge_count"; 1.29 1.30 - if (is_compilation_enabled() && !m->is_not_osr_compilable() && can_be_compiled(m)) { 1.31 - CompileBroker::compile_method(m, bci, CompLevel_highest_tier, 1.32 - m, hot_count, comment, thread); 1.33 - NOT_PRODUCT(trace_osr_completion(m->lookup_osr_nmethod_for(bci, CompLevel_highest_tier, true));) 1.34 + if (is_compilation_enabled() && !m->is_not_osr_compilable(comp_level) && can_be_compiled(m)) { 1.35 + CompileBroker::compile_method(m, bci, comp_level, m, hot_count, comment, thread); 1.36 + NOT_PRODUCT(trace_osr_completion(m->lookup_osr_nmethod_for(bci, comp_level, true));) 1.37 } 1.38 } 1.39 // StackWalkCompPolicy - walk up stack to find a suitable method to compile 1.40 @@ -426,7 +425,8 @@ 1.41 1.42 // Consider m for compilation 1.43 void StackWalkCompPolicy::method_invocation_event(methodHandle m, JavaThread* thread) { 1.44 - int hot_count = m->invocation_count(); 1.45 + const int comp_level = CompLevel_highest_tier; 1.46 + const int hot_count = m->invocation_count(); 1.47 reset_counter_for_invocation_event(m); 1.48 const char* comment = "count"; 1.49 1.50 @@ -457,20 +457,20 @@ 1.51 if (TimeCompilationPolicy) accumulated_time()->stop(); 1.52 assert(top != NULL, "findTopInlinableFrame returned null"); 1.53 if (TraceCompilationPolicy) top->print(); 1.54 - CompileBroker::compile_method(top->top_method(), InvocationEntryBci, CompLevel_highest_tier, 1.55 + CompileBroker::compile_method(top->top_method(), InvocationEntryBci, comp_level, 1.56 m, hot_count, comment, thread); 1.57 } 1.58 } 1.59 } 1.60 1.61 void StackWalkCompPolicy::method_back_branch_event(methodHandle m, int bci, JavaThread* thread) { 1.62 - int hot_count = m->backedge_count(); 1.63 + const int comp_level = CompLevel_highest_tier; 1.64 + const int hot_count = m->backedge_count(); 1.65 const char* comment = "backedge_count"; 1.66 1.67 - if (is_compilation_enabled() && !m->is_not_osr_compilable() && can_be_compiled(m)) { 1.68 - CompileBroker::compile_method(m, bci, CompLevel_highest_tier, m, hot_count, comment, thread); 1.69 - 1.70 - NOT_PRODUCT(trace_osr_completion(m->lookup_osr_nmethod_for(bci, CompLevel_highest_tier, true));) 1.71 + if (is_compilation_enabled() && !m->is_not_osr_compilable(comp_level) && can_be_compiled(m)) { 1.72 + CompileBroker::compile_method(m, bci, comp_level, m, hot_count, comment, thread); 1.73 + NOT_PRODUCT(trace_osr_completion(m->lookup_osr_nmethod_for(bci, comp_level, true));) 1.74 } 1.75 } 1.76