comparison src/share/vm/code/nmethod.cpp @ 1748:3e8fbc61cee8

6978355: renaming for 6961697 Summary: This is the renaming part of 6961697 to keep the actual changes small for review. Reviewed-by: kvn, never
author twisti
date Wed, 25 Aug 2010 05:27:54 -0700
parents 71faaa8e3ccc
children 0878d7bae69f
comparison
equal deleted inserted replaced
1747:53dbe853fb3a 1748:3e8fbc61cee8
85 static 85 static
86 struct nmethod_stats_struct { 86 struct nmethod_stats_struct {
87 int nmethod_count; 87 int nmethod_count;
88 int total_size; 88 int total_size;
89 int relocation_size; 89 int relocation_size;
90 int code_size; 90 int insts_size;
91 int stub_size; 91 int stub_size;
92 int consts_size; 92 int consts_size;
93 int scopes_data_size; 93 int scopes_data_size;
94 int scopes_pcs_size; 94 int scopes_pcs_size;
95 int dependencies_size; 95 int dependencies_size;
99 99
100 void note_nmethod(nmethod* nm) { 100 void note_nmethod(nmethod* nm) {
101 nmethod_count += 1; 101 nmethod_count += 1;
102 total_size += nm->size(); 102 total_size += nm->size();
103 relocation_size += nm->relocation_size(); 103 relocation_size += nm->relocation_size();
104 code_size += nm->code_size(); 104 insts_size += nm->insts_size();
105 stub_size += nm->stub_size(); 105 stub_size += nm->stub_size();
106 consts_size += nm->consts_size(); 106 consts_size += nm->consts_size();
107 oops_size += nm->oops_size(); 107 oops_size += nm->oops_size();
108 scopes_data_size += nm->scopes_data_size(); 108 scopes_data_size += nm->scopes_data_size();
109 scopes_pcs_size += nm->scopes_pcs_size(); 109 scopes_pcs_size += nm->scopes_pcs_size();
114 void print_nmethod_stats() { 114 void print_nmethod_stats() {
115 if (nmethod_count == 0) return; 115 if (nmethod_count == 0) return;
116 tty->print_cr("Statistics for %d bytecoded nmethods:", nmethod_count); 116 tty->print_cr("Statistics for %d bytecoded nmethods:", nmethod_count);
117 if (total_size != 0) tty->print_cr(" total in heap = %d", total_size); 117 if (total_size != 0) tty->print_cr(" total in heap = %d", total_size);
118 if (relocation_size != 0) tty->print_cr(" relocation = %d", relocation_size); 118 if (relocation_size != 0) tty->print_cr(" relocation = %d", relocation_size);
119 if (code_size != 0) tty->print_cr(" main code = %d", code_size); 119 if (insts_size != 0) tty->print_cr(" main code = %d", insts_size);
120 if (stub_size != 0) tty->print_cr(" stub code = %d", stub_size); 120 if (stub_size != 0) tty->print_cr(" stub code = %d", stub_size);
121 if (consts_size != 0) tty->print_cr(" constants = %d", consts_size); 121 if (consts_size != 0) tty->print_cr(" constants = %d", consts_size);
122 if (oops_size != 0) tty->print_cr(" oops = %d", oops_size); 122 if (oops_size != 0) tty->print_cr(" oops = %d", oops_size);
123 if (scopes_data_size != 0) tty->print_cr(" scopes data = %d", scopes_data_size); 123 if (scopes_data_size != 0) tty->print_cr(" scopes data = %d", scopes_data_size);
124 if (scopes_pcs_size != 0) tty->print_cr(" scopes pcs = %d", scopes_pcs_size); 124 if (scopes_pcs_size != 0) tty->print_cr(" scopes pcs = %d", scopes_pcs_size);
128 } 128 }
129 129
130 int native_nmethod_count; 130 int native_nmethod_count;
131 int native_total_size; 131 int native_total_size;
132 int native_relocation_size; 132 int native_relocation_size;
133 int native_code_size; 133 int native_insts_size;
134 int native_oops_size; 134 int native_oops_size;
135 void note_native_nmethod(nmethod* nm) { 135 void note_native_nmethod(nmethod* nm) {
136 native_nmethod_count += 1; 136 native_nmethod_count += 1;
137 native_total_size += nm->size(); 137 native_total_size += nm->size();
138 native_relocation_size += nm->relocation_size(); 138 native_relocation_size += nm->relocation_size();
139 native_code_size += nm->code_size(); 139 native_insts_size += nm->insts_size();
140 native_oops_size += nm->oops_size(); 140 native_oops_size += nm->oops_size();
141 } 141 }
142 void print_native_nmethod_stats() { 142 void print_native_nmethod_stats() {
143 if (native_nmethod_count == 0) return; 143 if (native_nmethod_count == 0) return;
144 tty->print_cr("Statistics for %d native nmethods:", native_nmethod_count); 144 tty->print_cr("Statistics for %d native nmethods:", native_nmethod_count);
145 if (native_total_size != 0) tty->print_cr(" N. total size = %d", native_total_size); 145 if (native_total_size != 0) tty->print_cr(" N. total size = %d", native_total_size);
146 if (native_relocation_size != 0) tty->print_cr(" N. relocation = %d", native_relocation_size); 146 if (native_relocation_size != 0) tty->print_cr(" N. relocation = %d", native_relocation_size);
147 if (native_code_size != 0) tty->print_cr(" N. main code = %d", native_code_size); 147 if (native_insts_size != 0) tty->print_cr(" N. main code = %d", native_insts_size);
148 if (native_oops_size != 0) tty->print_cr(" N. oops = %d", native_oops_size); 148 if (native_oops_size != 0) tty->print_cr(" N. oops = %d", native_oops_size);
149 } 149 }
150 150
151 int pc_desc_resets; // number of resets (= number of caches) 151 int pc_desc_resets; // number of resets (= number of caches)
152 int pc_desc_queries; // queries to nmethod::find_pc_desc 152 int pc_desc_queries; // queries to nmethod::find_pc_desc
402 //-------------end of code for ExceptionCache-------------- 402 //-------------end of code for ExceptionCache--------------
403 403
404 404
405 int nmethod::total_size() const { 405 int nmethod::total_size() const {
406 return 406 return
407 code_size() + 407 insts_size() +
408 stub_size() + 408 stub_size() +
409 consts_size() + 409 consts_size() +
410 scopes_data_size() + 410 scopes_data_size() +
411 scopes_pcs_size() + 411 scopes_pcs_size() +
412 handler_table_size() + 412 handler_table_size() +
616 _exception_offset = 0; 616 _exception_offset = 0;
617 _deoptimize_offset = 0; 617 _deoptimize_offset = 0;
618 _deoptimize_mh_offset = 0; 618 _deoptimize_mh_offset = 0;
619 _orig_pc_offset = 0; 619 _orig_pc_offset = 0;
620 620
621 _consts_offset = data_offset();
621 _stub_offset = data_offset(); 622 _stub_offset = data_offset();
622 _consts_offset = data_offset();
623 _oops_offset = data_offset(); 623 _oops_offset = data_offset();
624 _scopes_data_offset = _oops_offset + round_to(code_buffer->total_oop_size(), oopSize); 624 _scopes_data_offset = _oops_offset + round_to(code_buffer->total_oop_size(), oopSize);
625 _scopes_pcs_offset = _scopes_data_offset; 625 _scopes_pcs_offset = _scopes_data_offset;
626 _dependencies_offset = _scopes_pcs_offset; 626 _dependencies_offset = _scopes_pcs_offset;
627 _handler_table_offset = _dependencies_offset; 627 _handler_table_offset = _dependencies_offset;
628 _nul_chk_table_offset = _handler_table_offset; 628 _nul_chk_table_offset = _handler_table_offset;
629 _nmethod_end_offset = _nul_chk_table_offset; 629 _nmethod_end_offset = _nul_chk_table_offset;
630 _compile_id = 0; // default 630 _compile_id = 0; // default
631 _comp_level = CompLevel_none; 631 _comp_level = CompLevel_none;
632 _entry_point = instructions_begin(); 632 _entry_point = code_begin() + offsets->value(CodeOffsets::Entry);
633 _verified_entry_point = instructions_begin() + offsets->value(CodeOffsets::Verified_Entry); 633 _verified_entry_point = code_begin() + offsets->value(CodeOffsets::Verified_Entry);
634 _osr_entry_point = NULL; 634 _osr_entry_point = NULL;
635 _exception_cache = NULL; 635 _exception_cache = NULL;
636 _pc_desc_cache.reset_to(NULL); 636 _pc_desc_cache.reset_to(NULL);
637 637
638 code_buffer->copy_oops_to(this); 638 code_buffer->copy_oops_to(this);
694 _deoptimize_offset = 0; 694 _deoptimize_offset = 0;
695 _deoptimize_mh_offset = 0; 695 _deoptimize_mh_offset = 0;
696 _unwind_handler_offset = -1; 696 _unwind_handler_offset = -1;
697 _trap_offset = offsets->value(CodeOffsets::Dtrace_trap); 697 _trap_offset = offsets->value(CodeOffsets::Dtrace_trap);
698 _orig_pc_offset = 0; 698 _orig_pc_offset = 0;
699 _consts_offset = data_offset();
699 _stub_offset = data_offset(); 700 _stub_offset = data_offset();
700 _consts_offset = data_offset();
701 _oops_offset = data_offset(); 701 _oops_offset = data_offset();
702 _scopes_data_offset = _oops_offset + round_to(code_buffer->total_oop_size(), oopSize); 702 _scopes_data_offset = _oops_offset + round_to(code_buffer->total_oop_size(), oopSize);
703 _scopes_pcs_offset = _scopes_data_offset; 703 _scopes_pcs_offset = _scopes_data_offset;
704 _dependencies_offset = _scopes_pcs_offset; 704 _dependencies_offset = _scopes_pcs_offset;
705 _handler_table_offset = _dependencies_offset; 705 _handler_table_offset = _dependencies_offset;
706 _nul_chk_table_offset = _handler_table_offset; 706 _nul_chk_table_offset = _handler_table_offset;
707 _nmethod_end_offset = _nul_chk_table_offset; 707 _nmethod_end_offset = _nul_chk_table_offset;
708 _compile_id = 0; // default 708 _compile_id = 0; // default
709 _comp_level = CompLevel_none; 709 _comp_level = CompLevel_none;
710 _entry_point = instructions_begin(); 710 _entry_point = code_begin() + offsets->value(CodeOffsets::Entry);
711 _verified_entry_point = instructions_begin() + offsets->value(CodeOffsets::Verified_Entry); 711 _verified_entry_point = code_begin() + offsets->value(CodeOffsets::Verified_Entry);
712 _osr_entry_point = NULL; 712 _osr_entry_point = NULL;
713 _exception_cache = NULL; 713 _exception_cache = NULL;
714 _pc_desc_cache.reset_to(NULL); 714 _pc_desc_cache.reset_to(NULL);
715 715
716 code_buffer->copy_oops_to(this); 716 code_buffer->copy_oops_to(this);
785 _entry_bci = entry_bci; 785 _entry_bci = entry_bci;
786 _compile_id = compile_id; 786 _compile_id = compile_id;
787 _comp_level = comp_level; 787 _comp_level = comp_level;
788 _compiler = compiler; 788 _compiler = compiler;
789 _orig_pc_offset = orig_pc_offset; 789 _orig_pc_offset = orig_pc_offset;
790 _stub_offset = instructions_offset() + code_buffer->total_offset_of(code_buffer->stubs()->start()); 790
791 // Section offsets
792 _consts_offset = content_offset() + code_buffer->total_offset_of(code_buffer->consts()->start());
793 _stub_offset = content_offset() + code_buffer->total_offset_of(code_buffer->stubs()->start());
791 794
792 // Exception handler and deopt handler are in the stub section 795 // Exception handler and deopt handler are in the stub section
793 _exception_offset = _stub_offset + offsets->value(CodeOffsets::Exceptions); 796 _exception_offset = _stub_offset + offsets->value(CodeOffsets::Exceptions);
794 _deoptimize_offset = _stub_offset + offsets->value(CodeOffsets::Deopt); 797 _deoptimize_offset = _stub_offset + offsets->value(CodeOffsets::Deopt);
795 _deoptimize_mh_offset = _stub_offset + offsets->value(CodeOffsets::DeoptMH); 798 _deoptimize_mh_offset = _stub_offset + offsets->value(CodeOffsets::DeoptMH);
796 if (offsets->value(CodeOffsets::UnwindHandler) != -1) { 799 if (offsets->value(CodeOffsets::UnwindHandler) != -1) {
797 _unwind_handler_offset = instructions_offset() + offsets->value(CodeOffsets::UnwindHandler); 800 _unwind_handler_offset = code_offset() + offsets->value(CodeOffsets::UnwindHandler);
798 } else { 801 } else {
799 _unwind_handler_offset = -1; 802 _unwind_handler_offset = -1;
800 } 803 }
801 _consts_offset = instructions_offset() + code_buffer->total_offset_of(code_buffer->consts()->start()); 804
802 _oops_offset = data_offset(); 805 _oops_offset = data_offset();
803 _scopes_data_offset = _oops_offset + round_to(code_buffer->total_oop_size (), oopSize); 806 _scopes_data_offset = _oops_offset + round_to(code_buffer->total_oop_size (), oopSize);
804 _scopes_pcs_offset = _scopes_data_offset + round_to(debug_info->data_size (), oopSize); 807 _scopes_pcs_offset = _scopes_data_offset + round_to(debug_info->data_size (), oopSize);
805 _dependencies_offset = _scopes_pcs_offset + adjust_pcs_size(debug_info->pcs_size()); 808 _dependencies_offset = _scopes_pcs_offset + adjust_pcs_size(debug_info->pcs_size());
806 _handler_table_offset = _dependencies_offset + round_to(dependencies->size_in_bytes (), oopSize); 809 _handler_table_offset = _dependencies_offset + round_to(dependencies->size_in_bytes (), oopSize);
807 _nul_chk_table_offset = _handler_table_offset + round_to(handler_table->size_in_bytes(), oopSize); 810 _nul_chk_table_offset = _handler_table_offset + round_to(handler_table->size_in_bytes(), oopSize);
808 _nmethod_end_offset = _nul_chk_table_offset + round_to(nul_chk_table->size_in_bytes(), oopSize); 811 _nmethod_end_offset = _nul_chk_table_offset + round_to(nul_chk_table->size_in_bytes(), oopSize);
809 812
810 _entry_point = instructions_begin(); 813 _entry_point = code_begin() + offsets->value(CodeOffsets::Entry);
811 _verified_entry_point = instructions_begin() + offsets->value(CodeOffsets::Verified_Entry); 814 _verified_entry_point = code_begin() + offsets->value(CodeOffsets::Verified_Entry);
812 _osr_entry_point = instructions_begin() + offsets->value(CodeOffsets::OSR_Entry); 815 _osr_entry_point = code_begin() + offsets->value(CodeOffsets::OSR_Entry);
813 _exception_cache = NULL; 816 _exception_cache = NULL;
814 _pc_desc_cache.reset_to(scopes_pcs_begin()); 817 _pc_desc_cache.reset_to(scopes_pcs_begin());
815 818
816 // Copy contents of ScopeDescRecorder to nmethod 819 // Copy contents of ScopeDescRecorder to nmethod
817 code_buffer->copy_oops_to(this); 820 code_buffer->copy_oops_to(this);
876 if (LogCompilation && xtty != NULL) { 879 if (LogCompilation && xtty != NULL) {
877 ttyLocker ttyl; 880 ttyLocker ttyl;
878 HandleMark hm; 881 HandleMark hm;
879 xtty->begin_elem("nmethod"); 882 xtty->begin_elem("nmethod");
880 log_identity(xtty); 883 log_identity(xtty);
881 xtty->print(" entry='" INTPTR_FORMAT "' size='%d'", 884 xtty->print(" entry='" INTPTR_FORMAT "' size='%d'", code_begin(), size());
882 instructions_begin(), size());
883 xtty->print(" address='" INTPTR_FORMAT "'", (intptr_t) this); 885 xtty->print(" address='" INTPTR_FORMAT "'", (intptr_t) this);
884 886
885 LOG_OFFSET(xtty, relocation); 887 LOG_OFFSET(xtty, relocation);
886 LOG_OFFSET(xtty, code); 888 LOG_OFFSET(xtty, insts);
887 LOG_OFFSET(xtty, stub); 889 LOG_OFFSET(xtty, stub);
888 LOG_OFFSET(xtty, consts); 890 LOG_OFFSET(xtty, consts);
889 LOG_OFFSET(xtty, scopes_data); 891 LOG_OFFSET(xtty, scopes_data);
890 LOG_OFFSET(xtty, scopes_pcs); 892 LOG_OFFSET(xtty, scopes_pcs);
891 LOG_OFFSET(xtty, dependencies); 893 LOG_OFFSET(xtty, dependencies);
1458 moop->klass_name()->utf8_length(), 1460 moop->klass_name()->utf8_length(),
1459 moop->name()->bytes(), 1461 moop->name()->bytes(),
1460 moop->name()->utf8_length(), 1462 moop->name()->utf8_length(),
1461 moop->signature()->bytes(), 1463 moop->signature()->bytes(),
1462 moop->signature()->utf8_length(), 1464 moop->signature()->utf8_length(),
1463 code_begin(), code_size()); 1465 insts_begin(), insts_size());
1464 1466
1465 if (JvmtiExport::should_post_compiled_method_load() || 1467 if (JvmtiExport::should_post_compiled_method_load() ||
1466 JvmtiExport::should_post_compiled_method_unload()) { 1468 JvmtiExport::should_post_compiled_method_unload()) {
1467 get_and_cache_jmethod_id(); 1469 get_and_cache_jmethod_id();
1468 } 1470 }
1500 // it's being unloaded there's no way to look it up since the weak 1502 // it's being unloaded there's no way to look it up since the weak
1501 // ref will have been cleared. 1503 // ref will have been cleared.
1502 if (_jmethod_id != NULL && JvmtiExport::should_post_compiled_method_unload()) { 1504 if (_jmethod_id != NULL && JvmtiExport::should_post_compiled_method_unload()) {
1503 assert(!unload_reported(), "already unloaded"); 1505 assert(!unload_reported(), "already unloaded");
1504 HandleMark hm; 1506 HandleMark hm;
1505 JvmtiExport::post_compiled_method_unload(_jmethod_id, code_begin()); 1507 JvmtiExport::post_compiled_method_unload(_jmethod_id, insts_begin());
1506 } 1508 }
1507 1509
1508 // The JVMTI CompiledMethodUnload event can be enabled or disabled at 1510 // The JVMTI CompiledMethodUnload event can be enabled or disabled at
1509 // any time. As the nmethod is being unloaded now we mark it has 1511 // any time. As the nmethod is being unloaded now we mark it has
1510 // having the unload event reported - this will ensure that we don't 1512 // having the unload event reported - this will ensure that we don't
1852 memcpy(scopes_pcs_begin(), pcs, size); 1854 memcpy(scopes_pcs_begin(), pcs, size);
1853 1855
1854 // Adjust the final sentinel downward. 1856 // Adjust the final sentinel downward.
1855 PcDesc* last_pc = &scopes_pcs_begin()[count-1]; 1857 PcDesc* last_pc = &scopes_pcs_begin()[count-1];
1856 assert(last_pc->pc_offset() == PcDesc::upper_offset_limit, "sanity"); 1858 assert(last_pc->pc_offset() == PcDesc::upper_offset_limit, "sanity");
1857 last_pc->set_pc_offset(instructions_size() + 1); 1859 last_pc->set_pc_offset(content_size() + 1);
1858 for (; last_pc + 1 < scopes_pcs_end(); last_pc += 1) { 1860 for (; last_pc + 1 < scopes_pcs_end(); last_pc += 1) {
1859 // Fill any rounding gaps with copies of the last record. 1861 // Fill any rounding gaps with copies of the last record.
1860 last_pc[1] = last_pc[0]; 1862 last_pc[1] = last_pc[0];
1861 } 1863 }
1862 // The following assert could fail if sizeof(PcDesc) is not 1864 // The following assert could fail if sizeof(PcDesc) is not
1892 #endif 1894 #endif
1893 1895
1894 1896
1895 // Finds a PcDesc with real-pc equal to "pc" 1897 // Finds a PcDesc with real-pc equal to "pc"
1896 PcDesc* nmethod::find_pc_desc_internal(address pc, bool approximate) { 1898 PcDesc* nmethod::find_pc_desc_internal(address pc, bool approximate) {
1897 address base_address = instructions_begin(); 1899 address base_address = code_begin();
1898 if ((pc < base_address) || 1900 if ((pc < base_address) ||
1899 (pc - base_address) >= (ptrdiff_t) PcDesc::upper_offset_limit) { 1901 (pc - base_address) >= (ptrdiff_t) PcDesc::upper_offset_limit) {
1900 return NULL; // PC is wildly out of range 1902 return NULL; // PC is wildly out of range
1901 } 1903 }
1902 int pc_offset = (int) (pc - base_address); 1904 int pc_offset = (int) (pc - base_address);
2040 return false; 2042 return false;
2041 } 2043 }
2042 2044
2043 2045
2044 bool nmethod::is_patchable_at(address instr_addr) { 2046 bool nmethod::is_patchable_at(address instr_addr) {
2045 assert (code_contains(instr_addr), "wrong nmethod used"); 2047 assert(insts_contains(instr_addr), "wrong nmethod used");
2046 if (is_zombie()) { 2048 if (is_zombie()) {
2047 // a zombie may never be patched 2049 // a zombie may never be patched
2048 return false; 2050 return false;
2049 } 2051 }
2050 return true; 2052 return true;
2052 2054
2053 2055
2054 address nmethod::continuation_for_implicit_exception(address pc) { 2056 address nmethod::continuation_for_implicit_exception(address pc) {
2055 // Exception happened outside inline-cache check code => we are inside 2057 // Exception happened outside inline-cache check code => we are inside
2056 // an active nmethod => use cpc to determine a return address 2058 // an active nmethod => use cpc to determine a return address
2057 int exception_offset = pc - instructions_begin(); 2059 int exception_offset = pc - code_begin();
2058 int cont_offset = ImplicitExceptionTable(this).at( exception_offset ); 2060 int cont_offset = ImplicitExceptionTable(this).at( exception_offset );
2059 #ifdef ASSERT 2061 #ifdef ASSERT
2060 if (cont_offset == 0) { 2062 if (cont_offset == 0) {
2061 Thread* thread = ThreadLocalStorage::get_thread_slow(); 2063 Thread* thread = ThreadLocalStorage::get_thread_slow();
2062 ResetNoHandleMark rnm; // Might be called from LEAF/QUICK ENTRY 2064 ResetNoHandleMark rnm; // Might be called from LEAF/QUICK ENTRY
2073 #endif 2075 #endif
2074 if (cont_offset == 0) { 2076 if (cont_offset == 0) {
2075 // Let the normal error handling report the exception 2077 // Let the normal error handling report the exception
2076 return NULL; 2078 return NULL;
2077 } 2079 }
2078 return instructions_begin() + cont_offset; 2080 return code_begin() + cont_offset;
2079 } 2081 }
2080 2082
2081 2083
2082 2084
2083 void nmethod_init() { 2085 void nmethod_init() {
2332 size()); 2334 size());
2333 if (relocation_size () > 0) tty->print_cr(" relocation [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d", 2335 if (relocation_size () > 0) tty->print_cr(" relocation [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
2334 relocation_begin(), 2336 relocation_begin(),
2335 relocation_end(), 2337 relocation_end(),
2336 relocation_size()); 2338 relocation_size());
2337 if (code_size () > 0) tty->print_cr(" main code [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d", 2339 if (insts_size () > 0) tty->print_cr(" main code [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
2338 code_begin(), 2340 insts_begin(),
2339 code_end(), 2341 insts_end(),
2340 code_size()); 2342 insts_size());
2341 if (stub_size () > 0) tty->print_cr(" stub code [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d", 2343 if (stub_size () > 0) tty->print_cr(" stub code [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
2342 stub_begin(), 2344 stub_begin(),
2343 stub_end(), 2345 stub_end(),
2344 stub_size()); 2346 stub_size());
2345 if (consts_size () > 0) tty->print_cr(" constants [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d", 2347 if (consts_size () > 0) tty->print_cr(" constants [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
2605 2607
2606 void nmethod::print_code_comment_on(outputStream* st, int column, u_char* begin, u_char* end) { 2608 void nmethod::print_code_comment_on(outputStream* st, int column, u_char* begin, u_char* end) {
2607 // First, find an oopmap in (begin, end]. 2609 // First, find an oopmap in (begin, end].
2608 // We use the odd half-closed interval so that oop maps and scope descs 2610 // We use the odd half-closed interval so that oop maps and scope descs
2609 // which are tied to the byte after a call are printed with the call itself. 2611 // which are tied to the byte after a call are printed with the call itself.
2610 address base = instructions_begin(); 2612 address base = code_begin();
2611 OopMapSet* oms = oop_maps(); 2613 OopMapSet* oms = oop_maps();
2612 if (oms != NULL) { 2614 if (oms != NULL) {
2613 for (int i = 0, imax = oms->size(); i < imax; i++) { 2615 for (int i = 0, imax = oms->size(); i < imax; i++) {
2614 OopMap* om = oms->at(i); 2616 OopMap* om = oms->at(i);
2615 address pc = base + om->offset(); 2617 address pc = base + om->offset();
2693 if (str != NULL) { 2695 if (str != NULL) {
2694 if (sd != NULL) st->cr(); 2696 if (sd != NULL) st->cr();
2695 st->move_to(column); 2697 st->move_to(column);
2696 st->print("; {%s}", str); 2698 st->print("; {%s}", str);
2697 } 2699 }
2698 int cont_offset = ImplicitExceptionTable(this).at(begin - instructions_begin()); 2700 int cont_offset = ImplicitExceptionTable(this).at(begin - code_begin());
2699 if (cont_offset != 0) { 2701 if (cont_offset != 0) {
2700 st->move_to(column); 2702 st->move_to(column);
2701 st->print("; implicit exception: dispatches to " INTPTR_FORMAT, instructions_begin() + cont_offset); 2703 st->print("; implicit exception: dispatches to " INTPTR_FORMAT, code_begin() + cont_offset);
2702 } 2704 }
2703 2705
2704 } 2706 }
2705 2707
2706 #ifndef PRODUCT 2708 #ifndef PRODUCT
2730 void nmethod::print_handler_table() { 2732 void nmethod::print_handler_table() {
2731 ExceptionHandlerTable(this).print(); 2733 ExceptionHandlerTable(this).print();
2732 } 2734 }
2733 2735
2734 void nmethod::print_nul_chk_table() { 2736 void nmethod::print_nul_chk_table() {
2735 ImplicitExceptionTable(this).print(instructions_begin()); 2737 ImplicitExceptionTable(this).print(code_begin());
2736 } 2738 }
2737 2739
2738 void nmethod::print_statistics() { 2740 void nmethod::print_statistics() {
2739 ttyLocker ttyl; 2741 ttyLocker ttyl;
2740 if (xtty != NULL) xtty->head("statistics type='nmethod'"); 2742 if (xtty != NULL) xtty->head("statistics type='nmethod'");