Mercurial > hg > truffle
comparison src/share/vm/code/nmethod.cpp @ 9925:07e76b6fcc38
Backed out changeset: 7bd4a69b4ce1
author | Christian Haeubl <haeubl@ssw.jku.at> |
---|---|
date | Thu, 23 May 2013 13:51:49 +0200 |
parents | 7bd4a69b4ce1 |
children | ebb32c4589f3 |
comparison
equal
deleted
inserted
replaced
9924:6c7f40e6effd | 9925:07e76b6fcc38 |
---|---|
122 // NMethod statistics | 122 // NMethod statistics |
123 // They are printed under various flags, including: | 123 // They are printed under various flags, including: |
124 // PrintC1Statistics, PrintOptoStatistics, LogVMOutput, and LogCompilation. | 124 // PrintC1Statistics, PrintOptoStatistics, LogVMOutput, and LogCompilation. |
125 // (In the latter two cases, they like other stats are printed to the log only.) | 125 // (In the latter two cases, they like other stats are printed to the log only.) |
126 | 126 |
127 #if !defined(PRODUCT) || defined(GRAAL) | |
128 #define NOT_PRODUCT_OR_GRAAL(code) code | |
129 | |
130 // These variables are put into one block to reduce relocations | 127 // These variables are put into one block to reduce relocations |
131 // and make it simpler to print from the debugger. | 128 // and make it simpler to print from the debugger. |
132 static | 129 static |
133 struct nmethod_stats_struct { | 130 struct nmethod_stats_struct { |
134 int nmethod_count; | 131 int nmethod_count; |
214 pc_desc_queries, pc_desc_approx, | 211 pc_desc_queries, pc_desc_approx, |
215 pc_desc_repeats, pc_desc_hits, | 212 pc_desc_repeats, pc_desc_hits, |
216 pc_desc_tests, pc_desc_searches, pc_desc_adds); | 213 pc_desc_tests, pc_desc_searches, pc_desc_adds); |
217 } | 214 } |
218 } nmethod_stats; | 215 } nmethod_stats; |
219 #else // !PRODUCT || GRAAL | 216 |
220 #define NOT_PRODUCT_OR_GRAAL(code) | |
221 #endif // !PRODUCT || GRAAL | |
222 | 217 |
223 //--------------------------------------------------------------------------------- | 218 //--------------------------------------------------------------------------------- |
224 | 219 |
225 | 220 |
226 ExceptionCache::ExceptionCache(Handle exception, address pc, address handler) { | 221 ExceptionCache::ExceptionCache(Handle exception, address pc, address handler) { |
522 nm = new (native_nmethod_size) nmethod(method(), native_nmethod_size, | 517 nm = new (native_nmethod_size) nmethod(method(), native_nmethod_size, |
523 compile_id, &offsets, | 518 compile_id, &offsets, |
524 code_buffer, frame_size, | 519 code_buffer, frame_size, |
525 basic_lock_owner_sp_offset, | 520 basic_lock_owner_sp_offset, |
526 basic_lock_sp_offset, oop_maps); | 521 basic_lock_sp_offset, oop_maps); |
527 NOT_PRODUCT_OR_GRAAL(if (nm != NULL) nmethod_stats.note_native_nmethod(nm)); | 522 if (nm != NULL) nmethod_stats.note_native_nmethod(nm); |
528 if (PrintAssembly && nm != NULL) | 523 if (PrintAssembly && nm != NULL) |
529 Disassembler::decode(nm); | 524 Disassembler::decode(nm); |
530 } | 525 } |
531 } | 526 } |
532 // verify nmethod | 527 // verify nmethod |
559 offsets.set_value(CodeOffsets::Frame_Complete, frame_complete); | 554 offsets.set_value(CodeOffsets::Frame_Complete, frame_complete); |
560 | 555 |
561 nm = new (nmethod_size) nmethod(method(), nmethod_size, | 556 nm = new (nmethod_size) nmethod(method(), nmethod_size, |
562 &offsets, code_buffer, frame_size); | 557 &offsets, code_buffer, frame_size); |
563 | 558 |
564 NOT_PRODUCT_OR_GRAAL(if (nm != NULL) nmethod_stats.note_nmethod(nm)); | 559 if (nm != NULL) nmethod_stats.note_nmethod(nm); |
565 if (PrintAssembly && nm != NULL) | 560 if (PrintAssembly && nm != NULL) |
566 Disassembler::decode(nm); | 561 Disassembler::decode(nm); |
567 } | 562 } |
568 } | 563 } |
569 // verify nmethod | 564 // verify nmethod |
643 | 638 |
644 // record this nmethod as dependent on this klass | 639 // record this nmethod as dependent on this klass |
645 InstanceKlass::cast(klass)->add_dependent_nmethod(nm); | 640 InstanceKlass::cast(klass)->add_dependent_nmethod(nm); |
646 } | 641 } |
647 } | 642 } |
648 NOT_PRODUCT_OR_GRAAL(if (nm != NULL) nmethod_stats.note_nmethod(nm)); | 643 if (nm != NULL) nmethod_stats.note_nmethod(nm); |
649 if (PrintAssembly && nm != NULL) | 644 if (PrintAssembly && nm != NULL) |
650 Disassembler::decode(nm); | 645 Disassembler::decode(nm); |
651 } | 646 } |
652 | 647 |
653 // verify nmethod | 648 // verify nmethod |
3022 } | 3017 } |
3023 | 3018 |
3024 #endif // PRODUCT | 3019 #endif // PRODUCT |
3025 | 3020 |
3026 void nmethod::print_statistics() { | 3021 void nmethod::print_statistics() { |
3027 #if !defined(PRODUCT) || defined(GRAAL) | |
3028 ttyLocker ttyl; | 3022 ttyLocker ttyl; |
3029 if (xtty != NULL) xtty->head("statistics type='nmethod'"); | 3023 if (xtty != NULL) xtty->head("statistics type='nmethod'"); |
3030 nmethod_stats.print_native_nmethod_stats(); | 3024 nmethod_stats.print_native_nmethod_stats(); |
3031 nmethod_stats.print_nmethod_stats(); | 3025 nmethod_stats.print_nmethod_stats(); |
3032 DebugInformationRecorder::print_statistics(); | 3026 DebugInformationRecorder::print_statistics(); |
3033 nmethod_stats.print_pc_stats(); | 3027 nmethod_stats.print_pc_stats(); |
3034 Dependencies::print_statistics(); | 3028 Dependencies::print_statistics(); |
3035 if (xtty != NULL) xtty->tail("statistics"); | 3029 if (xtty != NULL) xtty->tail("statistics"); |
3036 #endif | 3030 } |
3037 } | |
3038 | |
3039 #undef NOT_PRODUCT_OR_GRAAL |