comparison src/share/vm/runtime/compilationPolicy.cpp @ 6972:bd7a7ce2e264

6830717: replay of compilations would help with debugging Summary: When java process crashed in compiler thread, repeat the compilation process will help finding root cause. This is done with using SA dump application class data and replay data from core dump, then use debug version of jvm to recompile the problematic java method. Reviewed-by: kvn, twisti, sspitsyn Contributed-by: yumin.qi@oracle.com
author minqi
date Mon, 12 Nov 2012 14:03:53 -0800
parents 18fb7da42534
children 2cb439954abf b84fd7d73702 aeaca88565e6
comparison
equal deleted inserted replaced
6965:3be318ecfae5 6972:bd7a7ce2e264
95 95
96 // Returns true if m must be compiled before executing it 96 // Returns true if m must be compiled before executing it
97 // This is intended to force compiles for methods (usually for 97 // This is intended to force compiles for methods (usually for
98 // debugging) that would otherwise be interpreted for some reason. 98 // debugging) that would otherwise be interpreted for some reason.
99 bool CompilationPolicy::must_be_compiled(methodHandle m, int comp_level) { 99 bool CompilationPolicy::must_be_compiled(methodHandle m, int comp_level) {
100 // Don't allow Xcomp to cause compiles in replay mode
101 if (ReplayCompiles) return false;
102
100 if (m->has_compiled_code()) return false; // already compiled 103 if (m->has_compiled_code()) return false; // already compiled
101 if (!can_be_compiled(m, comp_level)) return false; 104 if (!can_be_compiled(m, comp_level)) return false;
102 105
103 return !UseInterpreter || // must compile all methods 106 return !UseInterpreter || // must compile all methods
104 (UseCompiler && AlwaysCompileLoopMethods && m->has_loops() && CompileBroker::should_compile_new_jobs()); // eagerly compile loop methods 107 (UseCompiler && AlwaysCompileLoopMethods && m->has_loops() && CompileBroker::should_compile_new_jobs()); // eagerly compile loop methods
320 if (bci != InvocationEntryBci) { 323 if (bci != InvocationEntryBci) {
321 reset_counter_for_back_branch_event(method); 324 reset_counter_for_back_branch_event(method);
322 return NULL; 325 return NULL;
323 } 326 }
324 } 327 }
328 if (CompileTheWorld || ReplayCompiles) {
329 // Don't trigger other compiles in testing mode
330 if (bci == InvocationEntryBci) {
331 reset_counter_for_invocation_event(method);
332 } else {
333 reset_counter_for_back_branch_event(method);
334 }
335 return NULL;
336 }
337
325 if (bci == InvocationEntryBci) { 338 if (bci == InvocationEntryBci) {
326 // when code cache is full, compilation gets switched off, UseCompiler 339 // when code cache is full, compilation gets switched off, UseCompiler
327 // is set to false 340 // is set to false
328 if (!method->has_compiled_code() && UseCompiler) { 341 if (!method->has_compiled_code() && UseCompiler) {
329 method_invocation_event(method, thread); 342 method_invocation_event(method, thread);