Mercurial > hg > truffle
comparison src/share/vm/code/nmethod.cpp @ 8152:2bc6f232f74e
More fixes in the C++ part.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Thu, 07 Mar 2013 21:18:35 +0100 |
parents | b8f261ba79c6 |
children | 3c29f7da5c66 |
comparison
equal
deleted
inserted
replaced
8151:b8f261ba79c6 | 8152:2bc6f232f74e |
---|---|
123 // NMethod statistics | 123 // NMethod statistics |
124 // They are printed under various flags, including: | 124 // They are printed under various flags, including: |
125 // PrintC1Statistics, PrintOptoStatistics, LogVMOutput, and LogCompilation. | 125 // PrintC1Statistics, PrintOptoStatistics, LogVMOutput, and LogCompilation. |
126 // (In the latter two cases, they like other stats are printed to the log only.) | 126 // (In the latter two cases, they like other stats are printed to the log only.) |
127 | 127 |
128 #ifndef PRODUCT | |
128 // These variables are put into one block to reduce relocations | 129 // These variables are put into one block to reduce relocations |
129 // and make it simpler to print from the debugger. | 130 // and make it simpler to print from the debugger. |
130 static | 131 static |
131 struct nmethod_stats_struct { | 132 struct nmethod_stats_struct { |
132 int nmethod_count; | 133 int nmethod_count; |
212 pc_desc_queries, pc_desc_approx, | 213 pc_desc_queries, pc_desc_approx, |
213 pc_desc_repeats, pc_desc_hits, | 214 pc_desc_repeats, pc_desc_hits, |
214 pc_desc_tests, pc_desc_searches, pc_desc_adds); | 215 pc_desc_tests, pc_desc_searches, pc_desc_adds); |
215 } | 216 } |
216 } nmethod_stats; | 217 } nmethod_stats; |
218 #endif //PRODUCT | |
217 | 219 |
218 | 220 |
219 //--------------------------------------------------------------------------------- | 221 //--------------------------------------------------------------------------------- |
220 | 222 |
221 | 223 |
551 offsets.set_value(CodeOffsets::Dtrace_trap, trap_offset); | 553 offsets.set_value(CodeOffsets::Dtrace_trap, trap_offset); |
552 offsets.set_value(CodeOffsets::Frame_Complete, frame_complete); | 554 offsets.set_value(CodeOffsets::Frame_Complete, frame_complete); |
553 | 555 |
554 nm = new (nmethod_size) nmethod(method(), nmethod_size, &offsets, code_buffer, frame_size); | 556 nm = new (nmethod_size) nmethod(method(), nmethod_size, &offsets, code_buffer, frame_size); |
555 | 557 |
556 if (nm != NULL) nmethod_stats.note_nmethod(nm); | 558 NOT_PRODUCT(if (nm != NULL) nmethod_stats.note_nmethod(nm)); |
557 if (PrintAssembly && nm != NULL) | 559 if (PrintAssembly && nm != NULL) |
558 Disassembler::decode(nm); | 560 Disassembler::decode(nm); |
559 } | 561 } |
560 // verify nmethod | 562 // verify nmethod |
561 debug_only(if (nm) nm->verify();) // might block | 563 debug_only(if (nm) nm->verify();) // might block |
630 | 632 |
631 // record this nmethod as dependent on this klass | 633 // record this nmethod as dependent on this klass |
632 InstanceKlass::cast(klass)->add_dependent_nmethod(nm); | 634 InstanceKlass::cast(klass)->add_dependent_nmethod(nm); |
633 } | 635 } |
634 } | 636 } |
635 if (nm != NULL) nmethod_stats.note_nmethod(nm); | 637 NOT_PRODUCT(if (nm != NULL) nmethod_stats.note_nmethod(nm)); |
636 if (PrintAssembly && nm != NULL) | 638 if (PrintAssembly && nm != NULL) |
637 Disassembler::decode(nm); | 639 Disassembler::decode(nm); |
638 } | 640 } |
639 | 641 |
640 // verify nmethod | 642 // verify nmethod |
1808 // all strong references alive. Any weak references should have been | 1810 // all strong references alive. Any weak references should have been |
1809 // cleared as well. Visit all the metadata and ensure that it's | 1811 // cleared as well. Visit all the metadata and ensure that it's |
1810 // really alive. | 1812 // really alive. |
1811 void nmethod::verify_metadata_loaders(address low_boundary, BoolObjectClosure* is_alive) { | 1813 void nmethod::verify_metadata_loaders(address low_boundary, BoolObjectClosure* is_alive) { |
1812 #ifdef ASSERT | 1814 #ifdef ASSERT |
1813 RelocIterator iter(this, low_boundary); | 1815 RelocIterator iter(this, low_boundary); |
1814 while (iter.next()) { | 1816 while (iter.next()) { |
1815 // static_stub_Relocations may have dangling references to | 1817 // static_stub_Relocations may have dangling references to |
1816 // Method*s so trim them out here. Otherwise it looks like | 1818 // Method*s so trim them out here. Otherwise it looks like |
1817 // compiled code is maintaining a link to dead metadata. | 1819 // compiled code is maintaining a link to dead metadata. |
1818 address static_call_addr = NULL; | 1820 address static_call_addr = NULL; |
1819 if (iter.type() == relocInfo::opt_virtual_call_type) { | 1821 if (iter.type() == relocInfo::opt_virtual_call_type) { |
2499 // Right now there is no way to find out which entries support | 2501 // Right now there is no way to find out which entries support |
2500 // an interrupt point. It would be nice if we had this | 2502 // an interrupt point. It would be nice if we had this |
2501 // information in a table. | 2503 // information in a table. |
2502 break; | 2504 break; |
2503 } | 2505 } |
2504 #ifndef GRAAL | |
2505 assert(stub == NULL || stub_contains(stub), "static call stub outside stub section"); | 2506 assert(stub == NULL || stub_contains(stub), "static call stub outside stub section"); |
2506 #endif | |
2507 } | 2507 } |
2508 } | 2508 } |
2509 | 2509 |
2510 | 2510 |
2511 // ----------------------------------------------------------------------------- | 2511 // ----------------------------------------------------------------------------- |
2993 | 2993 |
2994 void nmethod::print_nul_chk_table() { | 2994 void nmethod::print_nul_chk_table() { |
2995 ImplicitExceptionTable(this).print(code_begin()); | 2995 ImplicitExceptionTable(this).print(code_begin()); |
2996 } | 2996 } |
2997 | 2997 |
2998 #endif // PRODUCT | |
2999 | |
3000 void nmethod::print_statistics() { | 2998 void nmethod::print_statistics() { |
3001 ttyLocker ttyl; | 2999 ttyLocker ttyl; |
3002 if (xtty != NULL) xtty->head("statistics type='nmethod'"); | 3000 if (xtty != NULL) xtty->head("statistics type='nmethod'"); |
3003 nmethod_stats.print_native_nmethod_stats(); | 3001 nmethod_stats.print_native_nmethod_stats(); |
3004 nmethod_stats.print_nmethod_stats(); | 3002 nmethod_stats.print_nmethod_stats(); |
3005 DebugInformationRecorder::print_statistics(); | 3003 DebugInformationRecorder::print_statistics(); |
3006 nmethod_stats.print_pc_stats(); | 3004 nmethod_stats.print_pc_stats(); |
3007 Dependencies::print_statistics(); | 3005 Dependencies::print_statistics(); |
3008 if (xtty != NULL) xtty->tail("statistics"); | 3006 if (xtty != NULL) xtty->tail("statistics"); |
3009 } | 3007 } |
3008 | |
3009 #endif // PRODUCT |