Mercurial > hg > graal-compiler
comparison src/share/vm/code/nmethod.cpp @ 4561:35ca3ade314d
enabled nmethod statistics for product build
author | Christian Haeubl <christian.haeubl@oracle.com> |
---|---|
date | Fri, 10 Feb 2012 10:07:48 -0800 |
parents | 125678ef7587 |
children | ef00461e29af |
comparison
equal
deleted
inserted
replaced
4554:daba89671d29 | 4561:35ca3ade314d |
---|---|
117 // NMethod statistics | 117 // NMethod statistics |
118 // They are printed under various flags, including: | 118 // They are printed under various flags, including: |
119 // PrintC1Statistics, PrintOptoStatistics, LogVMOutput, and LogCompilation. | 119 // PrintC1Statistics, PrintOptoStatistics, LogVMOutput, and LogCompilation. |
120 // (In the latter two cases, they like other stats are printed to the log only.) | 120 // (In the latter two cases, they like other stats are printed to the log only.) |
121 | 121 |
122 #ifndef PRODUCT | |
123 // These variables are put into one block to reduce relocations | 122 // These variables are put into one block to reduce relocations |
124 // and make it simpler to print from the debugger. | 123 // and make it simpler to print from the debugger. |
125 static | 124 static |
126 struct nmethod_stats_struct { | 125 struct nmethod_stats_struct { |
127 int nmethod_count; | 126 int nmethod_count; |
207 pc_desc_queries, pc_desc_approx, | 206 pc_desc_queries, pc_desc_approx, |
208 pc_desc_repeats, pc_desc_hits, | 207 pc_desc_repeats, pc_desc_hits, |
209 pc_desc_tests, pc_desc_searches, pc_desc_adds); | 208 pc_desc_tests, pc_desc_searches, pc_desc_adds); |
210 } | 209 } |
211 } nmethod_stats; | 210 } nmethod_stats; |
212 #endif //PRODUCT | |
213 | 211 |
214 | 212 |
215 //--------------------------------------------------------------------------------- | 213 //--------------------------------------------------------------------------------- |
216 | 214 |
217 | 215 |
510 nm = new (native_nmethod_size) | 508 nm = new (native_nmethod_size) |
511 nmethod(method(), native_nmethod_size, compile_id, &offsets, | 509 nmethod(method(), native_nmethod_size, compile_id, &offsets, |
512 code_buffer, frame_size, | 510 code_buffer, frame_size, |
513 basic_lock_owner_sp_offset, basic_lock_sp_offset, | 511 basic_lock_owner_sp_offset, basic_lock_sp_offset, |
514 oop_maps); | 512 oop_maps); |
515 NOT_PRODUCT(if (nm != NULL) nmethod_stats.note_native_nmethod(nm)); | 513 if (nm != NULL) nmethod_stats.note_native_nmethod(nm); |
516 if (PrintAssembly && nm != NULL) | 514 if (PrintAssembly && nm != NULL) |
517 Disassembler::decode(nm); | 515 Disassembler::decode(nm); |
518 } | 516 } |
519 // verify nmethod | 517 // verify nmethod |
520 debug_only(if (nm) nm->verify();) // might block | 518 debug_only(if (nm) nm->verify();) // might block |
543 offsets.set_value(CodeOffsets::Dtrace_trap, trap_offset); | 541 offsets.set_value(CodeOffsets::Dtrace_trap, trap_offset); |
544 offsets.set_value(CodeOffsets::Frame_Complete, frame_complete); | 542 offsets.set_value(CodeOffsets::Frame_Complete, frame_complete); |
545 | 543 |
546 nm = new (nmethod_size) nmethod(method(), nmethod_size, &offsets, code_buffer, frame_size); | 544 nm = new (nmethod_size) nmethod(method(), nmethod_size, &offsets, code_buffer, frame_size); |
547 | 545 |
548 NOT_PRODUCT(if (nm != NULL) nmethod_stats.note_nmethod(nm)); | 546 if (nm != NULL) nmethod_stats.note_nmethod(nm); |
549 if (PrintAssembly && nm != NULL) | 547 if (PrintAssembly && nm != NULL) |
550 Disassembler::decode(nm); | 548 Disassembler::decode(nm); |
551 } | 549 } |
552 // verify nmethod | 550 // verify nmethod |
553 debug_only(if (nm) nm->verify();) // might block | 551 debug_only(if (nm) nm->verify();) // might block |
610 | 608 |
611 // record this nmethod as dependent on this klass | 609 // record this nmethod as dependent on this klass |
612 instanceKlass::cast(klass)->add_dependent_nmethod(nm); | 610 instanceKlass::cast(klass)->add_dependent_nmethod(nm); |
613 } | 611 } |
614 } | 612 } |
615 NOT_PRODUCT(if (nm != NULL) nmethod_stats.note_nmethod(nm)); | 613 if (nm != NULL) nmethod_stats.note_nmethod(nm); |
616 if (PrintAssembly && nm != NULL) | 614 if (PrintAssembly && nm != NULL) |
617 Disassembler::decode(nm); | 615 Disassembler::decode(nm); |
618 } | 616 } |
619 | 617 |
620 // verify nmethod | 618 // verify nmethod |
2830 | 2828 |
2831 void nmethod::print_nul_chk_table() { | 2829 void nmethod::print_nul_chk_table() { |
2832 ImplicitExceptionTable(this).print(code_begin()); | 2830 ImplicitExceptionTable(this).print(code_begin()); |
2833 } | 2831 } |
2834 | 2832 |
2833 #endif // PRODUCT | |
2834 | |
2835 void nmethod::print_statistics() { | 2835 void nmethod::print_statistics() { |
2836 ttyLocker ttyl; | 2836 ttyLocker ttyl; |
2837 if (xtty != NULL) xtty->head("statistics type='nmethod'"); | 2837 if (xtty != NULL) xtty->head("statistics type='nmethod'"); |
2838 nmethod_stats.print_native_nmethod_stats(); | 2838 nmethod_stats.print_native_nmethod_stats(); |
2839 nmethod_stats.print_nmethod_stats(); | 2839 nmethod_stats.print_nmethod_stats(); |
2840 DebugInformationRecorder::print_statistics(); | 2840 DebugInformationRecorder::print_statistics(); |
2841 nmethod_stats.print_pc_stats(); | 2841 nmethod_stats.print_pc_stats(); |
2842 Dependencies::print_statistics(); | 2842 Dependencies::print_statistics(); |
2843 if (xtty != NULL) xtty->tail("statistics"); | 2843 if (xtty != NULL) xtty->tail("statistics"); |
2844 } | 2844 } |
2845 | |
2846 #endif // PRODUCT |