comparison src/share/vm/c1/c1_Compilation.cpp @ 6843:c3e799c37717

7177003: C1: LogCompilation support Summary: add LogCompilation support in C1 - both client and tiered mode. Reviewed-by: twisti, kvn
author vlivanov
date Fri, 05 Oct 2012 18:57:10 -0700
parents 137868b7aa6f
children d804e148cff8
comparison
equal deleted inserted replaced
6830:81e878c53615 6843:c3e799c37717
30 #include "c1/c1_LinearScan.hpp" 30 #include "c1/c1_LinearScan.hpp"
31 #include "c1/c1_MacroAssembler.hpp" 31 #include "c1/c1_MacroAssembler.hpp"
32 #include "c1/c1_ValueMap.hpp" 32 #include "c1/c1_ValueMap.hpp"
33 #include "c1/c1_ValueStack.hpp" 33 #include "c1/c1_ValueStack.hpp"
34 #include "code/debugInfoRec.hpp" 34 #include "code/debugInfoRec.hpp"
35 #include "compiler/compileLog.hpp"
35 36
36 37
37 typedef enum { 38 typedef enum {
38 _t_compile, 39 _t_compile,
39 _t_setup, 40 _t_setup,
65 static int totalInstructionNodes = 0; 66 static int totalInstructionNodes = 0;
66 67
67 class PhaseTraceTime: public TraceTime { 68 class PhaseTraceTime: public TraceTime {
68 private: 69 private:
69 JavaThread* _thread; 70 JavaThread* _thread;
71 CompileLog* _log;
70 72
71 public: 73 public:
72 PhaseTraceTime(TimerName timer): 74 PhaseTraceTime(TimerName timer)
73 TraceTime("", &timers[timer], CITime || CITimeEach, Verbose) { 75 : TraceTime("", &timers[timer], CITime || CITimeEach, Verbose), _log(NULL) {
76 if (Compilation::current() != NULL) {
77 _log = Compilation::current()->log();
78 }
79
80 if (_log != NULL) {
81 _log->begin_head("phase name='%s'", timer_name[timer]);
82 _log->stamp();
83 _log->end_head();
84 }
85 }
86
87 ~PhaseTraceTime() {
88 if (_log != NULL)
89 _log->done("phase");
74 } 90 }
75 }; 91 };
76 92
77 // Implementation of Compilation 93 // Implementation of Compilation
78 94
388 if (InstallMethods) { 404 if (InstallMethods) {
389 // install code 405 // install code
390 PhaseTraceTime timeit(_t_codeinstall); 406 PhaseTraceTime timeit(_t_codeinstall);
391 install_code(frame_size); 407 install_code(frame_size);
392 } 408 }
409
410 if (log() != NULL) // Print code cache state into compiler log
411 log()->code_cache_state();
412
393 totalInstructionNodes += Instruction::number_of_instructions(); 413 totalInstructionNodes += Instruction::number_of_instructions();
394 } 414 }
395 415
396 416
397 void Compilation::generate_exception_handler_table() { 417 void Compilation::generate_exception_handler_table() {
454 474
455 Compilation::Compilation(AbstractCompiler* compiler, ciEnv* env, ciMethod* method, 475 Compilation::Compilation(AbstractCompiler* compiler, ciEnv* env, ciMethod* method,
456 int osr_bci, BufferBlob* buffer_blob) 476 int osr_bci, BufferBlob* buffer_blob)
457 : _compiler(compiler) 477 : _compiler(compiler)
458 , _env(env) 478 , _env(env)
479 , _log(env->log())
459 , _method(method) 480 , _method(method)
460 , _osr_bci(osr_bci) 481 , _osr_bci(osr_bci)
461 , _hir(NULL) 482 , _hir(NULL)
462 , _max_spills(-1) 483 , _max_spills(-1)
463 , _frame_map(NULL) 484 , _frame_map(NULL)