671
672 // handle the case of an anchor explicitly set in continuation code that doesn't have a callee
673 JavaThread* thread = reg_map->thread();
674 if ((thread->has_last_Java_frame() && fr.sp() == thread->last_Java_sp())
675 JVMTI_ONLY(|| (method()->is_continuation_enter_intrinsic() && thread->on_monitor_waited_event()))) {
676 return;
677 }
678
679 if (!method()->is_native()) {
680 address pc = fr.pc();
681 bool has_receiver, has_appendix;
682 Symbol* signature;
683
684 // The method attached by JIT-compilers should be used, if present.
685 // Bytecode can be inaccurate in such case.
686 Method* callee = attached_method_before_pc(pc);
687 if (callee != nullptr) {
688 has_receiver = !(callee->access_flags().is_static());
689 has_appendix = false;
690 signature = callee->signature();
691 } else {
692 SimpleScopeDesc ssd(this, pc);
693
694 Bytecode_invoke call(methodHandle(Thread::current(), ssd.method()), ssd.bci());
695 has_receiver = call.has_receiver();
696 has_appendix = call.has_appendix();
697 signature = call.signature();
698 }
699
700 fr.oops_compiled_arguments_do(signature, has_receiver, has_appendix, reg_map, f);
701 } else if (method()->is_continuation_enter_intrinsic()) {
702 // This method only calls Continuation.enter()
703 Symbol* signature = vmSymbols::continuationEnter_signature();
704 fr.oops_compiled_arguments_do(signature, false, false, reg_map, f);
705 }
706 }
707
708 Method* nmethod::attached_method(address call_instr) {
709 assert(code_contains(call_instr), "not part of the nmethod");
710 RelocIterator iter(this, call_instr, call_instr + 1);
1170 _compiled_ic_data = nullptr;
1171
1172 _is_unloading_state = 0;
1173 _state = not_installed;
1174
1175 _has_flushed_dependencies = false;
1176 _is_unlinked = false;
1177 _load_reported = false; // jvmti state
1178
1179 _deoptimization_status = not_marked;
1180
1181 // SECT_CONSTS is first in code buffer so the offset should be 0.
1182 int consts_offset = code_buffer->total_offset_of(code_buffer->consts());
1183 assert(consts_offset == 0, "const_offset: %d", consts_offset);
1184
1185 _stub_offset = content_offset() + code_buffer->total_offset_of(code_buffer->stubs());
1186
1187 CHECKED_CAST(_entry_offset, uint16_t, (offsets->value(CodeOffsets::Entry)));
1188 CHECKED_CAST(_verified_entry_offset, uint16_t, (offsets->value(CodeOffsets::Verified_Entry)));
1189
1190 _skipped_instructions_size = code_buffer->total_skipped_instructions_size();
1191 }
1192
1193 // Post initialization
1194 void nmethod::post_init() {
1195 clear_unloading_state();
1196
1197 finalize_relocations();
1198
1199 // Flush generated code
1200 ICache::invalidate_range(code_begin(), code_size());
1201
1202 Universe::heap()->register_nmethod(this);
1203
1204 #ifdef COMPILER2
1205 HotCodeCollector::register_nmethod(this);
1206 #endif // COMPILER2
1207
1208 DEBUG_ONLY(Universe::heap()->verify_nmethod(this));
1209
1217 int nmethod_size,
1218 int compile_id,
1219 CodeOffsets* offsets,
1220 CodeBuffer* code_buffer,
1221 int frame_size,
1222 ByteSize basic_lock_owner_sp_offset,
1223 ByteSize basic_lock_sp_offset,
1224 OopMapSet* oop_maps,
1225 int mutable_data_size)
1226 : CodeBlob("native nmethod", CodeBlobKind::Nmethod, code_buffer, nmethod_size, sizeof(nmethod),
1227 offsets->value(CodeOffsets::Frame_Complete), frame_size, oop_maps, false, mutable_data_size),
1228 _deoptimization_generation(0),
1229 _gc_epoch(CodeCache::gc_epoch()),
1230 _method(method),
1231 _native_receiver_sp_offset(basic_lock_owner_sp_offset),
1232 _native_basic_lock_sp_offset(basic_lock_sp_offset)
1233 {
1234 {
1235 DEBUG_ONLY(NoSafepointVerifier nsv;)
1236 assert_locked_or_safepoint(CodeCache_lock);
1237
1238 init_defaults(code_buffer, offsets);
1239
1240 _osr_entry_point = nullptr;
1241 _pc_desc_container = nullptr;
1242 _entry_bci = InvocationEntryBci;
1243 _compile_id = compile_id;
1244 _comp_level = CompLevel_none;
1245 _compiler_type = type;
1246 _orig_pc_offset = 0;
1247 _num_stack_arg_slots = 0;
1248
1249 if (offsets->value(CodeOffsets::Exceptions) != -1) {
1250 // Continuation enter intrinsic
1251 _exception_offset = code_offset() + offsets->value(CodeOffsets::Exceptions);
1252 } else {
1253 _exception_offset = 0;
1254 }
1255 // Native wrappers do not have deopt handlers. Make the values
1256 // something that will never match a pc like the nmethod vtable entry
1257 _deopt_handler_entry_offset = 0;
1358 _mutable_data = (address)os::malloc(_mutable_data_size, mtCode);
1359 if (_mutable_data == nullptr) {
1360 vm_exit_out_of_memory(_mutable_data_size, OOM_MALLOC_ERROR, "nmethod: no space for mutable data");
1361 }
1362 memcpy(mutable_data_begin(), nm.mutable_data_begin(), nm.mutable_data_size());
1363 } else {
1364 _mutable_data = nullptr;
1365 }
1366
1367 _deoptimization_generation = 0;
1368 _gc_epoch = CodeCache::gc_epoch();
1369 _method = nm._method;
1370 _osr_link = nullptr;
1371
1372 _exception_cache = nullptr;
1373 _gc_data = nullptr;
1374 _oops_do_mark_nmethods = nullptr;
1375 _oops_do_mark_link = nullptr;
1376 _compiled_ic_data = nullptr;
1377
1378 if (nm._osr_entry_point != nullptr) {
1379 _osr_entry_point = (nm._osr_entry_point - (address) &nm) + (address) this;
1380 } else {
1381 _osr_entry_point = nullptr;
1382 }
1383
1384 _entry_offset = nm._entry_offset;
1385 _verified_entry_offset = nm._verified_entry_offset;
1386 _entry_bci = nm._entry_bci;
1387 _immutable_data_size = nm._immutable_data_size;
1388
1389 _skipped_instructions_size = nm._skipped_instructions_size;
1390 _stub_offset = nm._stub_offset;
1391 _exception_offset = nm._exception_offset;
1392 _deopt_handler_entry_offset = nm._deopt_handler_entry_offset;
1393 _unwind_handler_offset = nm._unwind_handler_offset;
1394 _num_stack_arg_slots = nm._num_stack_arg_slots;
1395 _nul_chk_table_offset = nm._nul_chk_table_offset;
1396 _handler_table_offset = nm._handler_table_offset;
1397 _scopes_pcs_offset = nm._scopes_pcs_offset;
1398 _scopes_data_offset = nm._scopes_data_offset;
1399 _immutable_data_ref_count_offset = nm._immutable_data_ref_count_offset;
1400
1401 // Increment number of references to immutable data to share it between nmethods
1402 if (_immutable_data_size > 0) {
1403 _immutable_data = nm._immutable_data;
1404 inc_immutable_data_ref_count();
1405 } else {
1640 "C2 compiler doesn't provide exception handler stub code.");
1641 if (has_exception_handler) {
1642 _exception_offset = _stub_offset + offsets->value(CodeOffsets::Exceptions);
1643 } else {
1644 _exception_offset = -1;
1645 }
1646
1647 _deopt_handler_entry_offset = _stub_offset + offsets->value(CodeOffsets::Deopt);
1648
1649 if (offsets->value(CodeOffsets::UnwindHandler) != -1) {
1650 // C1 generates UnwindHandler at the end of instructions section.
1651 // Calculate positive offset as distance between the start of stubs section
1652 // (which is also the end of instructions section) and the start of the handler.
1653 int unwind_handler_offset = code_offset() + offsets->value(CodeOffsets::UnwindHandler);
1654 CHECKED_CAST(_unwind_handler_offset, int16_t, (_stub_offset - unwind_handler_offset));
1655 } else {
1656 _unwind_handler_offset = -1;
1657 }
1658
1659 int metadata_size = align_up(code_buffer->total_metadata_size(), wordSize);
1660 assert(_mutable_data_size == _relocation_size + metadata_size,
1661 "wrong mutable data size: %d != %d + %d",
1662 _mutable_data_size, _relocation_size, metadata_size);
1663 assert(nmethod_size == data_end() - header_begin(), "wrong nmethod size: %d != %d",
1664 nmethod_size, (int)(code_end() - header_begin()));
1665
1666 _immutable_data_size = immutable_data_size;
1667 if (immutable_data_size > 0) {
1668 assert(immutable_data != nullptr, "required");
1669 _immutable_data = immutable_data;
1670 } else {
1671 // We need unique not null address
1672 _immutable_data = blob_end();
1673 }
1674 CHECKED_CAST(_nul_chk_table_offset, uint16_t, (align_up((int)dependencies->size_in_bytes(), oopSize)));
1675 CHECKED_CAST(_handler_table_offset, uint16_t, (_nul_chk_table_offset + align_up(nul_chk_table->size_in_bytes(), oopSize)));
1676 _scopes_pcs_offset = _handler_table_offset + align_up(handler_table->size_in_bytes(), oopSize);
1677 _scopes_data_offset = _scopes_pcs_offset + adjust_pcs_size(debug_info->pcs_size());
1678
1679 _immutable_data_ref_count_offset = _scopes_data_offset + align_up(debug_info->data_size(), oopSize);
3062 }
3063
3064 bool nmethod::check_dependency_on(DepChange& changes) {
3065 // What has happened:
3066 // 1) a new class dependee has been added
3067 // 2) dependee and all its super classes have been marked
3068 bool found_check = false; // set true if we are upset
3069 for (Dependencies::DepStream deps(this); deps.next(); ) {
3070 // Evaluate only relevant dependencies.
3071 if (deps.spot_check_dependency_at(changes) != nullptr) {
3072 found_check = true;
3073 NOT_DEBUG(break);
3074 }
3075 }
3076 return found_check;
3077 }
3078
3079 // Called from mark_for_deoptimization, when dependee is invalidated.
3080 bool nmethod::is_dependent_on_method(Method* dependee) {
3081 for (Dependencies::DepStream deps(this); deps.next(); ) {
3082 if (deps.type() != Dependencies::evol_method)
3083 continue;
3084 Method* method = deps.method_argument(0);
3085 if (method == dependee) return true;
3086 }
3087 return false;
3088 }
3089
3090 void nmethod_init() {
3091 // make sure you didn't forget to adjust the filler fields
3092 assert(sizeof(nmethod) % oopSize == 0, "nmethod size must be multiple of a word");
3093 }
3094
3095 // -----------------------------------------------------------------------------
3096 // Verification
3097
3098 class VerifyOopsClosure: public OopClosure {
3099 nmethod* _nm;
3100 bool _ok;
3101 public:
3102 VerifyOopsClosure(nmethod* nm) : _nm(nm), _ok(true) { }
3103 bool ok() { return _ok; }
3104 virtual void do_oop(oop* p) {
3105 if (oopDesc::is_oop_or_null(*p)) return;
3261 if (size () > 0) st->print_cr(" total in heap [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
3262 p2i(this),
3263 p2i(this) + size(),
3264 size());
3265 if (consts_size () > 0) st->print_cr(" constants [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
3266 p2i(consts_begin()),
3267 p2i(consts_end()),
3268 consts_size());
3269 if (insts_size () > 0) st->print_cr(" main code [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
3270 p2i(insts_begin()),
3271 p2i(insts_end()),
3272 insts_size());
3273 if (stub_size () > 0) st->print_cr(" stub code [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
3274 p2i(stub_begin()),
3275 p2i(stub_end()),
3276 stub_size());
3277 if (oops_size () > 0) st->print_cr(" oops [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
3278 p2i(oops_begin()),
3279 p2i(oops_end()),
3280 oops_size());
3281 if (mutable_data_size() > 0) st->print_cr(" mutable data [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
3282 p2i(mutable_data_begin()),
3283 p2i(mutable_data_end()),
3284 mutable_data_size());
3285 if (relocation_size() > 0) st->print_cr(" relocation [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
3286 p2i(relocation_begin()),
3287 p2i(relocation_end()),
3288 relocation_size());
3289 if (metadata_size () > 0) st->print_cr(" metadata [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
3290 p2i(metadata_begin()),
3291 p2i(metadata_end()),
3292 metadata_size());
3293 if (immutable_data_size() > 0) st->print_cr(" immutable data [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
3294 p2i(immutable_data_begin()),
3295 p2i(immutable_data_end()),
3296 immutable_data_size());
3297 if (dependencies_size () > 0) st->print_cr(" dependencies [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
3298 p2i(dependencies_begin()),
3299 p2i(dependencies_end()),
3300 dependencies_size());
3301 if (nul_chk_table_size() > 0) st->print_cr(" nul chk table [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
3302 p2i(nul_chk_table_begin()),
3303 p2i(nul_chk_table_end()),
3304 nul_chk_table_size());
3305 if (handler_table_size() > 0) st->print_cr(" handler table [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
3828 return st.as_string();
3829 }
3830 case relocInfo::static_call_type: {
3831 stringStream st;
3832 st.print_raw("static_call");
3833 static_call_Relocation* r = iter.static_call_reloc();
3834 Method* m = r->method_value();
3835 if (m != nullptr) {
3836 assert(m->is_method(), "");
3837 m->print_short_name(&st);
3838 }
3839 return st.as_string();
3840 }
3841 case relocInfo::static_stub_type: return "static_stub";
3842 case relocInfo::external_word_type: return "external_word";
3843 case relocInfo::internal_word_type: return "internal_word";
3844 case relocInfo::section_word_type: return "section_word";
3845 case relocInfo::poll_type: return "poll";
3846 case relocInfo::poll_return_type: return "poll_return";
3847 case relocInfo::trampoline_stub_type: return "trampoline_stub";
3848 case relocInfo::entry_guard_type: return "entry_guard";
3849 case relocInfo::post_call_nop_type: return "post_call_nop";
3850 case relocInfo::barrier_type: {
3851 barrier_Relocation* const reloc = iter.barrier_reloc();
3852 stringStream st;
3853 st.print("barrier format=%d", reloc->format());
3854 return st.as_string();
3855 }
3856
3857 case relocInfo::type_mask: return "type_bit_mask";
3858
3859 default: {
3860 stringStream st;
3861 st.print("unknown relocInfo=%d", (int) iter.type());
3862 return st.as_string();
3863 }
3864 }
3865 }
3866 return have_one ? "other" : nullptr;
3867 }
3868
3869 // Return the last scope in (begin..end]
3870 ScopeDesc* nmethod::scope_desc_in(address begin, address end) {
3871 PcDesc* p = pc_desc_near(begin+1);
3872 if (p != nullptr && p->real_pc(this) <= end) {
3873 return new ScopeDesc(this, p);
3874 }
3875 return nullptr;
3876 }
3877
3878 const char* nmethod::nmethod_section_label(address pos) const {
3879 const char* label = nullptr;
3880 if (pos == code_begin()) label = "[Instructions begin]";
3881 if (pos == entry_point()) label = "[Entry Point]";
3882 if (pos == verified_entry_point()) label = "[Verified Entry Point]";
3883 if (pos == consts_begin() && pos != insts_begin()) label = "[Constants]";
3884 // Check stub_code before checking exception_handler or deopt_handler.
3885 if (pos == this->stub_begin()) label = "[Stub Code]";
3886 if (pos == exception_begin()) label = "[Exception Handler]";
3887 if (pos == deopt_handler_entry()) label = "[Deopt Handler Entry Point]";
3888 return label;
3889 }
3890
3891 void nmethod::print_nmethod_labels(outputStream* stream, address block_begin, bool print_section_labels) const {
3892 if (print_section_labels) {
3893 const char* label = nmethod_section_label(block_begin);
3894 if (label != nullptr) {
3895 stream->bol();
3896 stream->print_cr("%s", label);
3897 }
3898 }
3899
3900 if (block_begin == entry_point()) {
3901 Method* m = method();
3902 if (m != nullptr) {
3903 stream->print(" # ");
3904 m->print_value_on(stream);
3905 stream->cr();
3906 }
3907 if (m != nullptr && !is_osr_method()) {
3908 ResourceMark rm;
3909 int sizeargs = m->size_of_parameters();
3910 BasicType* sig_bt = NEW_RESOURCE_ARRAY(BasicType, sizeargs);
3911 VMRegPair* regs = NEW_RESOURCE_ARRAY(VMRegPair, sizeargs);
3912 {
3913 int sig_index = 0;
3914 if (!m->is_static())
3915 sig_bt[sig_index++] = T_OBJECT; // 'this'
3916 for (SignatureStream ss(m->signature()); !ss.at_return_type(); ss.next()) {
3917 BasicType t = ss.type();
3918 sig_bt[sig_index++] = t;
3919 if (type2size[t] == 2) {
3920 sig_bt[sig_index++] = T_VOID;
3921 } else {
3922 assert(type2size[t] == 1, "size is 1 or 2");
3923 }
3924 }
3925 assert(sig_index == sizeargs, "");
3926 }
3927 const char* spname = "sp"; // make arch-specific?
3928 SharedRuntime::java_calling_convention(sig_bt, regs, sizeargs);
3929 int stack_slot_offset = this->frame_size() * wordSize;
3930 int tab1 = 14, tab2 = 24;
3931 int sig_index = 0;
3932 int arg_index = (m->is_static() ? 0 : -1);
3933 bool did_old_sp = false;
3934 for (SignatureStream ss(m->signature()); !ss.at_return_type(); ) {
3935 bool at_this = (arg_index == -1);
3936 bool at_old_sp = false;
3937 BasicType t = (at_this ? T_OBJECT : ss.type());
3938 assert(t == sig_bt[sig_index], "sigs in sync");
3939 if (at_this)
3940 stream->print(" # this: ");
3941 else
3942 stream->print(" # parm%d: ", arg_index);
3943 stream->move_to(tab1);
3944 VMReg fst = regs[sig_index].first();
3945 VMReg snd = regs[sig_index].second();
3946 if (fst->is_reg()) {
3947 stream->print("%s", fst->name());
3948 if (snd->is_valid()) {
3949 stream->print(":%s", snd->name());
3950 }
3951 } else if (fst->is_stack()) {
3952 int offset = fst->reg2stack() * VMRegImpl::stack_slot_size + stack_slot_offset;
3953 if (offset == stack_slot_offset) at_old_sp = true;
3954 stream->print("[%s+0x%x]", spname, offset);
3955 } else {
3956 stream->print("reg%d:%d??", (int)(intptr_t)fst, (int)(intptr_t)snd);
3957 }
3958 stream->print(" ");
3959 stream->move_to(tab2);
3960 stream->print("= ");
3961 if (at_this) {
3962 m->method_holder()->print_value_on(stream);
3963 } else {
3964 bool did_name = false;
3965 if (!at_this && ss.is_reference()) {
3966 Symbol* name = ss.as_symbol();
3967 name->print_value_on(stream);
3968 did_name = true;
3969 }
3970 if (!did_name)
3971 stream->print("%s", type2name(t));
3972 }
3973 if (at_old_sp) {
3974 stream->print(" (%s of caller)", spname);
3975 did_old_sp = true;
3976 }
3977 stream->cr();
3978 sig_index += type2size[t];
3979 arg_index += 1;
3980 if (!at_this) ss.next();
3981 }
3982 if (!did_old_sp) {
3983 stream->print(" # ");
3984 stream->move_to(tab1);
3985 stream->print("[%s+0x%x]", spname, stack_slot_offset);
3986 stream->print(" (%s of caller)", spname);
3987 stream->cr();
3988 }
3989 }
3990 }
3991 }
3992
3993 // Returns whether this nmethod has code comments.
3994 bool nmethod::has_code_comment(address begin, address end) {
3995 // scopes?
3996 ScopeDesc* sd = scope_desc_in(begin, end);
3997 if (sd != nullptr) return true;
3998
3999 // relocations?
4000 const char* str = reloc_string_for(begin, end);
4001 if (str != nullptr) return true;
4002
4003 // implicit exceptions?
4004 int cont_offset = ImplicitExceptionTable(this).continuation_offset((uint)(begin - code_begin()));
4005 if (cont_offset != 0) return true;
4006
4007 return false;
4008 }
4009
4088 else
4089 st->print("<UNKNOWN>");
4090 break;
4091 }
4092 case Bytecodes::_getfield:
4093 case Bytecodes::_putfield:
4094 case Bytecodes::_getstatic:
4095 case Bytecodes::_putstatic:
4096 {
4097 Bytecode_field field(methodHandle(thread, sd->method()), sd->bci());
4098 st->print(" ");
4099 if (field.name() != nullptr)
4100 field.name()->print_symbol_on(st);
4101 else
4102 st->print("<UNKNOWN>");
4103 }
4104 default:
4105 break;
4106 }
4107 }
4108 st->print(" {reexecute=%d rethrow=%d return_oop=%d}", sd->should_reexecute(), sd->rethrow_exception(), sd->return_oop());
4109 }
4110
4111 // Print all scopes
4112 for (;sd != nullptr; sd = sd->sender()) {
4113 st->move_to(column, 6, 0);
4114 st->print("; -");
4115 if (sd->should_reexecute()) {
4116 st->print(" (reexecute)");
4117 }
4118 if (sd->method() == nullptr) {
4119 st->print("method is nullptr");
4120 } else {
4121 sd->method()->print_short_name(st);
4122 }
4123 int lineno = sd->method()->line_number_from_bci(sd->bci());
4124 if (lineno != -1) {
4125 st->print("@%d (line %d)", sd->bci(), lineno);
4126 } else {
4127 st->print("@%d", sd->bci());
4128 }
|
671
672 // handle the case of an anchor explicitly set in continuation code that doesn't have a callee
673 JavaThread* thread = reg_map->thread();
674 if ((thread->has_last_Java_frame() && fr.sp() == thread->last_Java_sp())
675 JVMTI_ONLY(|| (method()->is_continuation_enter_intrinsic() && thread->on_monitor_waited_event()))) {
676 return;
677 }
678
679 if (!method()->is_native()) {
680 address pc = fr.pc();
681 bool has_receiver, has_appendix;
682 Symbol* signature;
683
684 // The method attached by JIT-compilers should be used, if present.
685 // Bytecode can be inaccurate in such case.
686 Method* callee = attached_method_before_pc(pc);
687 if (callee != nullptr) {
688 has_receiver = !(callee->access_flags().is_static());
689 has_appendix = false;
690 signature = callee->signature();
691
692 // If inline types are passed as fields, use the extended signature
693 // which contains the types of all (oop) fields of the inline type.
694 if (is_compiled_by_c2() && callee->has_scalarized_args()) {
695 const GrowableArray<SigEntry>* sig = callee->adapter()->get_sig_cc();
696 assert(sig != nullptr, "sig should never be null");
697 TempNewSymbol tmp_sig = SigEntry::create_symbol(sig);
698 has_receiver = false; // The extended signature contains the receiver type
699 fr.oops_compiled_arguments_do(tmp_sig, has_receiver, has_appendix, reg_map, f);
700 return;
701 }
702 } else {
703 SimpleScopeDesc ssd(this, pc);
704
705 Bytecode_invoke call(methodHandle(Thread::current(), ssd.method()), ssd.bci());
706 has_receiver = call.has_receiver();
707 has_appendix = call.has_appendix();
708 signature = call.signature();
709 }
710
711 fr.oops_compiled_arguments_do(signature, has_receiver, has_appendix, reg_map, f);
712 } else if (method()->is_continuation_enter_intrinsic()) {
713 // This method only calls Continuation.enter()
714 Symbol* signature = vmSymbols::continuationEnter_signature();
715 fr.oops_compiled_arguments_do(signature, false, false, reg_map, f);
716 }
717 }
718
719 Method* nmethod::attached_method(address call_instr) {
720 assert(code_contains(call_instr), "not part of the nmethod");
721 RelocIterator iter(this, call_instr, call_instr + 1);
1181 _compiled_ic_data = nullptr;
1182
1183 _is_unloading_state = 0;
1184 _state = not_installed;
1185
1186 _has_flushed_dependencies = false;
1187 _is_unlinked = false;
1188 _load_reported = false; // jvmti state
1189
1190 _deoptimization_status = not_marked;
1191
1192 // SECT_CONSTS is first in code buffer so the offset should be 0.
1193 int consts_offset = code_buffer->total_offset_of(code_buffer->consts());
1194 assert(consts_offset == 0, "const_offset: %d", consts_offset);
1195
1196 _stub_offset = content_offset() + code_buffer->total_offset_of(code_buffer->stubs());
1197
1198 CHECKED_CAST(_entry_offset, uint16_t, (offsets->value(CodeOffsets::Entry)));
1199 CHECKED_CAST(_verified_entry_offset, uint16_t, (offsets->value(CodeOffsets::Verified_Entry)));
1200
1201 _inline_entry_offset = _entry_offset;
1202 _verified_inline_entry_offset = _verified_entry_offset;
1203 _verified_inline_ro_entry_offset = _verified_entry_offset;
1204
1205 _skipped_instructions_size = code_buffer->total_skipped_instructions_size();
1206 }
1207
1208 // Post initialization
1209 void nmethod::post_init() {
1210 clear_unloading_state();
1211
1212 finalize_relocations();
1213
1214 // Flush generated code
1215 ICache::invalidate_range(code_begin(), code_size());
1216
1217 Universe::heap()->register_nmethod(this);
1218
1219 #ifdef COMPILER2
1220 HotCodeCollector::register_nmethod(this);
1221 #endif // COMPILER2
1222
1223 DEBUG_ONLY(Universe::heap()->verify_nmethod(this));
1224
1232 int nmethod_size,
1233 int compile_id,
1234 CodeOffsets* offsets,
1235 CodeBuffer* code_buffer,
1236 int frame_size,
1237 ByteSize basic_lock_owner_sp_offset,
1238 ByteSize basic_lock_sp_offset,
1239 OopMapSet* oop_maps,
1240 int mutable_data_size)
1241 : CodeBlob("native nmethod", CodeBlobKind::Nmethod, code_buffer, nmethod_size, sizeof(nmethod),
1242 offsets->value(CodeOffsets::Frame_Complete), frame_size, oop_maps, false, mutable_data_size),
1243 _deoptimization_generation(0),
1244 _gc_epoch(CodeCache::gc_epoch()),
1245 _method(method),
1246 _native_receiver_sp_offset(basic_lock_owner_sp_offset),
1247 _native_basic_lock_sp_offset(basic_lock_sp_offset)
1248 {
1249 {
1250 DEBUG_ONLY(NoSafepointVerifier nsv;)
1251 assert_locked_or_safepoint(CodeCache_lock);
1252 assert(!method->has_scalarized_args(), "scalarized native wrappers not supported yet");
1253 init_defaults(code_buffer, offsets);
1254
1255 _osr_entry_point = nullptr;
1256 _pc_desc_container = nullptr;
1257 _entry_bci = InvocationEntryBci;
1258 _compile_id = compile_id;
1259 _comp_level = CompLevel_none;
1260 _compiler_type = type;
1261 _orig_pc_offset = 0;
1262 _num_stack_arg_slots = 0;
1263
1264 if (offsets->value(CodeOffsets::Exceptions) != -1) {
1265 // Continuation enter intrinsic
1266 _exception_offset = code_offset() + offsets->value(CodeOffsets::Exceptions);
1267 } else {
1268 _exception_offset = 0;
1269 }
1270 // Native wrappers do not have deopt handlers. Make the values
1271 // something that will never match a pc like the nmethod vtable entry
1272 _deopt_handler_entry_offset = 0;
1373 _mutable_data = (address)os::malloc(_mutable_data_size, mtCode);
1374 if (_mutable_data == nullptr) {
1375 vm_exit_out_of_memory(_mutable_data_size, OOM_MALLOC_ERROR, "nmethod: no space for mutable data");
1376 }
1377 memcpy(mutable_data_begin(), nm.mutable_data_begin(), nm.mutable_data_size());
1378 } else {
1379 _mutable_data = nullptr;
1380 }
1381
1382 _deoptimization_generation = 0;
1383 _gc_epoch = CodeCache::gc_epoch();
1384 _method = nm._method;
1385 _osr_link = nullptr;
1386
1387 _exception_cache = nullptr;
1388 _gc_data = nullptr;
1389 _oops_do_mark_nmethods = nullptr;
1390 _oops_do_mark_link = nullptr;
1391 _compiled_ic_data = nullptr;
1392
1393 // Relocate the OSR entry point from nm to the new nmethod.
1394 if (nm._osr_entry_point == nullptr) {
1395 _osr_entry_point = nullptr;
1396 } else {
1397 address new_addr = nm._osr_entry_point - (address) &nm + (address) this;
1398 assert(new_addr >= code_begin() && new_addr < code_end(),
1399 "relocated address must be within code bounds");
1400 _osr_entry_point = new_addr;
1401 }
1402 _entry_offset = nm._entry_offset;
1403 _verified_entry_offset = nm._verified_entry_offset;
1404 _inline_entry_offset = nm._inline_entry_offset;
1405 _verified_inline_entry_offset = nm._verified_inline_entry_offset;
1406 _verified_inline_ro_entry_offset = nm._verified_inline_ro_entry_offset;
1407
1408 _entry_bci = nm._entry_bci;
1409 _immutable_data_size = nm._immutable_data_size;
1410
1411 _skipped_instructions_size = nm._skipped_instructions_size;
1412 _stub_offset = nm._stub_offset;
1413 _exception_offset = nm._exception_offset;
1414 _deopt_handler_entry_offset = nm._deopt_handler_entry_offset;
1415 _unwind_handler_offset = nm._unwind_handler_offset;
1416 _num_stack_arg_slots = nm._num_stack_arg_slots;
1417 _nul_chk_table_offset = nm._nul_chk_table_offset;
1418 _handler_table_offset = nm._handler_table_offset;
1419 _scopes_pcs_offset = nm._scopes_pcs_offset;
1420 _scopes_data_offset = nm._scopes_data_offset;
1421 _immutable_data_ref_count_offset = nm._immutable_data_ref_count_offset;
1422
1423 // Increment number of references to immutable data to share it between nmethods
1424 if (_immutable_data_size > 0) {
1425 _immutable_data = nm._immutable_data;
1426 inc_immutable_data_ref_count();
1427 } else {
1662 "C2 compiler doesn't provide exception handler stub code.");
1663 if (has_exception_handler) {
1664 _exception_offset = _stub_offset + offsets->value(CodeOffsets::Exceptions);
1665 } else {
1666 _exception_offset = -1;
1667 }
1668
1669 _deopt_handler_entry_offset = _stub_offset + offsets->value(CodeOffsets::Deopt);
1670
1671 if (offsets->value(CodeOffsets::UnwindHandler) != -1) {
1672 // C1 generates UnwindHandler at the end of instructions section.
1673 // Calculate positive offset as distance between the start of stubs section
1674 // (which is also the end of instructions section) and the start of the handler.
1675 int unwind_handler_offset = code_offset() + offsets->value(CodeOffsets::UnwindHandler);
1676 CHECKED_CAST(_unwind_handler_offset, int16_t, (_stub_offset - unwind_handler_offset));
1677 } else {
1678 _unwind_handler_offset = -1;
1679 }
1680
1681 int metadata_size = align_up(code_buffer->total_metadata_size(), wordSize);
1682 if (offsets->value(CodeOffsets::Inline_Entry) != CodeOffsets::no_such_entry_point) {
1683 CHECKED_CAST(_inline_entry_offset , uint16_t, offsets->value(CodeOffsets::Inline_Entry));
1684 }
1685 if (offsets->value(CodeOffsets::Verified_Inline_Entry) != CodeOffsets::no_such_entry_point) {
1686 CHECKED_CAST(_verified_inline_entry_offset , uint16_t, offsets->value(CodeOffsets::Verified_Inline_Entry));
1687 }
1688 if (offsets->value(CodeOffsets::Verified_Inline_Entry_RO) != CodeOffsets::no_such_entry_point) {
1689 CHECKED_CAST(_verified_inline_ro_entry_offset, uint16_t, offsets->value(CodeOffsets::Verified_Inline_Entry_RO));
1690 }
1691
1692 assert(_mutable_data_size == _relocation_size + metadata_size,
1693 "wrong mutable data size: %d != %d + %d",
1694 _mutable_data_size, _relocation_size, metadata_size);
1695 assert(nmethod_size == data_end() - header_begin(), "wrong nmethod size: %d != %d",
1696 nmethod_size, (int)(code_end() - header_begin()));
1697
1698 _immutable_data_size = immutable_data_size;
1699 if (immutable_data_size > 0) {
1700 assert(immutable_data != nullptr, "required");
1701 _immutable_data = immutable_data;
1702 } else {
1703 // We need unique not null address
1704 _immutable_data = blob_end();
1705 }
1706 CHECKED_CAST(_nul_chk_table_offset, uint16_t, (align_up((int)dependencies->size_in_bytes(), oopSize)));
1707 CHECKED_CAST(_handler_table_offset, uint16_t, (_nul_chk_table_offset + align_up(nul_chk_table->size_in_bytes(), oopSize)));
1708 _scopes_pcs_offset = _handler_table_offset + align_up(handler_table->size_in_bytes(), oopSize);
1709 _scopes_data_offset = _scopes_pcs_offset + adjust_pcs_size(debug_info->pcs_size());
1710
1711 _immutable_data_ref_count_offset = _scopes_data_offset + align_up(debug_info->data_size(), oopSize);
3094 }
3095
3096 bool nmethod::check_dependency_on(DepChange& changes) {
3097 // What has happened:
3098 // 1) a new class dependee has been added
3099 // 2) dependee and all its super classes have been marked
3100 bool found_check = false; // set true if we are upset
3101 for (Dependencies::DepStream deps(this); deps.next(); ) {
3102 // Evaluate only relevant dependencies.
3103 if (deps.spot_check_dependency_at(changes) != nullptr) {
3104 found_check = true;
3105 NOT_DEBUG(break);
3106 }
3107 }
3108 return found_check;
3109 }
3110
3111 // Called from mark_for_deoptimization, when dependee is invalidated.
3112 bool nmethod::is_dependent_on_method(Method* dependee) {
3113 for (Dependencies::DepStream deps(this); deps.next(); ) {
3114 if (Dependencies::has_method_dep(deps.type())) {
3115 Method* method = deps.method_argument(0);
3116 if (method == dependee) return true;
3117 }
3118 }
3119 return false;
3120 }
3121
3122 void nmethod_init() {
3123 // make sure you didn't forget to adjust the filler fields
3124 assert(sizeof(nmethod) % oopSize == 0, "nmethod size must be multiple of a word");
3125 }
3126
3127 // -----------------------------------------------------------------------------
3128 // Verification
3129
3130 class VerifyOopsClosure: public OopClosure {
3131 nmethod* _nm;
3132 bool _ok;
3133 public:
3134 VerifyOopsClosure(nmethod* nm) : _nm(nm), _ok(true) { }
3135 bool ok() { return _ok; }
3136 virtual void do_oop(oop* p) {
3137 if (oopDesc::is_oop_or_null(*p)) return;
3293 if (size () > 0) st->print_cr(" total in heap [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
3294 p2i(this),
3295 p2i(this) + size(),
3296 size());
3297 if (consts_size () > 0) st->print_cr(" constants [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
3298 p2i(consts_begin()),
3299 p2i(consts_end()),
3300 consts_size());
3301 if (insts_size () > 0) st->print_cr(" main code [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
3302 p2i(insts_begin()),
3303 p2i(insts_end()),
3304 insts_size());
3305 if (stub_size () > 0) st->print_cr(" stub code [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
3306 p2i(stub_begin()),
3307 p2i(stub_end()),
3308 stub_size());
3309 if (oops_size () > 0) st->print_cr(" oops [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
3310 p2i(oops_begin()),
3311 p2i(oops_end()),
3312 oops_size());
3313 if (mutable_data_size () > 0) st->print_cr(" mutable data [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
3314 p2i(mutable_data_begin()),
3315 p2i(mutable_data_end()),
3316 mutable_data_size());
3317 if (relocation_size () > 0) st->print_cr(" relocation [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
3318 p2i(relocation_begin()),
3319 p2i(relocation_end()),
3320 relocation_size());
3321 if (metadata_size () > 0) st->print_cr(" metadata [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
3322 p2i(metadata_begin()),
3323 p2i(metadata_end()),
3324 metadata_size());
3325 if (immutable_data_size() > 0) st->print_cr(" immutable data [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
3326 p2i(immutable_data_begin()),
3327 p2i(immutable_data_end()),
3328 immutable_data_size());
3329 if (dependencies_size () > 0) st->print_cr(" dependencies [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
3330 p2i(dependencies_begin()),
3331 p2i(dependencies_end()),
3332 dependencies_size());
3333 if (nul_chk_table_size() > 0) st->print_cr(" nul chk table [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
3334 p2i(nul_chk_table_begin()),
3335 p2i(nul_chk_table_end()),
3336 nul_chk_table_size());
3337 if (handler_table_size() > 0) st->print_cr(" handler table [" INTPTR_FORMAT "," INTPTR_FORMAT "] = %d",
3860 return st.as_string();
3861 }
3862 case relocInfo::static_call_type: {
3863 stringStream st;
3864 st.print_raw("static_call");
3865 static_call_Relocation* r = iter.static_call_reloc();
3866 Method* m = r->method_value();
3867 if (m != nullptr) {
3868 assert(m->is_method(), "");
3869 m->print_short_name(&st);
3870 }
3871 return st.as_string();
3872 }
3873 case relocInfo::static_stub_type: return "static_stub";
3874 case relocInfo::external_word_type: return "external_word";
3875 case relocInfo::internal_word_type: return "internal_word";
3876 case relocInfo::section_word_type: return "section_word";
3877 case relocInfo::poll_type: return "poll";
3878 case relocInfo::poll_return_type: return "poll_return";
3879 case relocInfo::trampoline_stub_type: return "trampoline_stub";
3880 case relocInfo::post_call_nop_type: return "post_call_nop";
3881 case relocInfo::barrier_type: {
3882 barrier_Relocation* const reloc = iter.barrier_reloc();
3883 stringStream st;
3884 st.print("barrier format=%d", reloc->format());
3885 return st.as_string();
3886 }
3887
3888 case relocInfo::type_mask: return "type_bit_mask";
3889
3890 default: {
3891 stringStream st;
3892 st.print("unknown relocInfo=%d", (int) iter.type());
3893 return st.as_string();
3894 }
3895 }
3896 }
3897 return have_one ? "other" : nullptr;
3898 }
3899
3900 // Return the last scope in (begin..end]
3901 ScopeDesc* nmethod::scope_desc_in(address begin, address end) {
3902 PcDesc* p = pc_desc_near(begin+1);
3903 if (p != nullptr && p->real_pc(this) <= end) {
3904 return new ScopeDesc(this, p);
3905 }
3906 return nullptr;
3907 }
3908
3909 const char* nmethod::nmethod_section_label(address pos) const {
3910 const char* label = nullptr;
3911 if (pos == code_begin()) label = "[Instructions begin]";
3912 if (pos == entry_point()) label = "[Entry Point]";
3913 if (pos == inline_entry_point()) label = "[Inline Entry Point]";
3914 if (pos == verified_entry_point()) label = "[Verified Entry Point]";
3915 if (pos == verified_inline_entry_point()) label = "[Verified Inline Entry Point]";
3916 if (pos == verified_inline_ro_entry_point()) label = "[Verified Inline Entry Point (RO)]";
3917 if (pos == consts_begin() && pos != insts_begin()) label = "[Constants]";
3918 // Check stub_code before checking exception_handler or deopt_handler.
3919 if (pos == this->stub_begin()) label = "[Stub Code]";
3920 if (pos == exception_begin()) label = "[Exception Handler]";
3921 if (pos == deopt_handler_entry()) label = "[Deopt Handler Entry Point]";
3922 return label;
3923 }
3924
3925 static int maybe_print_entry_label(outputStream* stream, address pos, address entry, const char* label) {
3926 if (pos == entry) {
3927 stream->bol();
3928 stream->print_cr("%s", label);
3929 return 1;
3930 } else {
3931 return 0;
3932 }
3933 }
3934
3935 void nmethod::print_nmethod_labels(outputStream* stream, address block_begin, bool print_section_labels) const {
3936 if (print_section_labels) {
3937 int n = 0;
3938 // Multiple entry points may be at the same position. Print them all.
3939 n += maybe_print_entry_label(stream, block_begin, entry_point(), "[Entry Point]");
3940 n += maybe_print_entry_label(stream, block_begin, inline_entry_point(), "[Inline Entry Point]");
3941 n += maybe_print_entry_label(stream, block_begin, verified_entry_point(), "[Verified Entry Point]");
3942 n += maybe_print_entry_label(stream, block_begin, verified_inline_entry_point(), "[Verified Inline Entry Point]");
3943 n += maybe_print_entry_label(stream, block_begin, verified_inline_ro_entry_point(), "[Verified Inline Entry Point (RO)]");
3944 if (n == 0) {
3945 const char* label = nmethod_section_label(block_begin);
3946 if (label != nullptr) {
3947 stream->bol();
3948 stream->print_cr("%s", label);
3949 }
3950 }
3951 }
3952
3953 Method* m = method();
3954 if (m == nullptr || is_osr_method()) {
3955 return;
3956 }
3957
3958 // Print the name of the method (only once)
3959 address low = MIN3(entry_point(),
3960 verified_entry_point(),
3961 inline_entry_point());
3962 // The verified inline entry point and verified inline RO entry point are not always
3963 // used. When they are unused. CodeOffsets::Verified_Inline_Entry(_RO) is -1. Hence,
3964 // the calculated entry point is smaller than the block they are offsetting into.
3965 if (verified_inline_entry_point() >= block_begin) {
3966 low = MIN2(low, verified_inline_entry_point());
3967 }
3968 if (verified_inline_ro_entry_point() >= block_begin) {
3969 low = MIN2(low, verified_inline_ro_entry_point());
3970 }
3971 assert(low != nullptr, "sanity");
3972 if (block_begin == low) {
3973 stream->print(" # ");
3974 m->print_value_on(stream);
3975 stream->cr();
3976 }
3977
3978 // Print the arguments for the 3 types of verified entry points
3979 CompiledEntrySignature ces(m);
3980 ces.compute_calling_conventions(false);
3981 const GrowableArray<SigEntry>* sig_cc;
3982 const VMRegPair* regs;
3983 if (block_begin == verified_entry_point()) {
3984 sig_cc = ces.sig_cc();
3985 regs = ces.regs_cc();
3986 } else if (block_begin == verified_inline_entry_point()) {
3987 sig_cc = ces.sig();
3988 regs = ces.regs();
3989 } else if (block_begin == verified_inline_ro_entry_point()) {
3990 sig_cc = ces.sig_cc_ro();
3991 regs = ces.regs_cc_ro();
3992 } else {
3993 return;
3994 }
3995
3996 bool has_this = !m->is_static();
3997 if (ces.has_inline_recv() && block_begin == verified_entry_point()) {
3998 // <this> argument is scalarized for verified_entry_point()
3999 has_this = false;
4000 }
4001 const char* spname = "sp"; // make arch-specific?
4002 int stack_slot_offset = this->frame_size() * wordSize;
4003 int tab1 = 14, tab2 = 24;
4004 int sig_index = 0;
4005 int arg_index = has_this ? -1 : 0;
4006 bool did_old_sp = false;
4007 for (ExtendedSignature sig = ExtendedSignature(sig_cc, SigEntryFilter()); !sig.at_end(); ++sig) {
4008 bool at_this = (arg_index == -1);
4009 bool at_old_sp = false;
4010 BasicType t = (*sig)._bt;
4011 if (at_this) {
4012 stream->print(" # this: ");
4013 } else {
4014 stream->print(" # parm%d: ", arg_index);
4015 }
4016 stream->move_to(tab1);
4017 VMReg fst = regs[sig_index].first();
4018 VMReg snd = regs[sig_index].second();
4019 if (fst->is_reg()) {
4020 stream->print("%s", fst->name());
4021 if (snd->is_valid()) {
4022 stream->print(":%s", snd->name());
4023 }
4024 } else if (fst->is_stack()) {
4025 int offset = fst->reg2stack() * VMRegImpl::stack_slot_size + stack_slot_offset;
4026 if (offset == stack_slot_offset) at_old_sp = true;
4027 stream->print("[%s+0x%x]", spname, offset);
4028 } else {
4029 stream->print("reg%d:%d??", (int)(intptr_t)fst, (int)(intptr_t)snd);
4030 }
4031 stream->print(" ");
4032 stream->move_to(tab2);
4033 stream->print("= ");
4034 if (at_this) {
4035 m->method_holder()->print_value_on(stream);
4036 } else {
4037 bool did_name = false;
4038 if (is_reference_type(t) && !(*sig)._vt_oop) {
4039 Symbol* name = (*sig)._name;
4040 name->print_value_on(stream);
4041 did_name = true;
4042 }
4043 if (!did_name)
4044 stream->print("%s", type2name(t));
4045 if ((*sig)._null_marker) {
4046 stream->print(" (null marker)");
4047 }
4048 if ((*sig)._vt_oop) {
4049 stream->print(" (VT OOP)");
4050 }
4051 }
4052 if (at_old_sp) {
4053 stream->print(" (%s of caller)", spname);
4054 did_old_sp = true;
4055 }
4056 stream->cr();
4057 sig_index += type2size[t];
4058 arg_index += 1;
4059 }
4060 if (!did_old_sp) {
4061 stream->print(" # ");
4062 stream->move_to(tab1);
4063 stream->print("[%s+0x%x]", spname, stack_slot_offset);
4064 stream->print(" (%s of caller)", spname);
4065 stream->cr();
4066 }
4067 }
4068
4069 // Returns whether this nmethod has code comments.
4070 bool nmethod::has_code_comment(address begin, address end) {
4071 // scopes?
4072 ScopeDesc* sd = scope_desc_in(begin, end);
4073 if (sd != nullptr) return true;
4074
4075 // relocations?
4076 const char* str = reloc_string_for(begin, end);
4077 if (str != nullptr) return true;
4078
4079 // implicit exceptions?
4080 int cont_offset = ImplicitExceptionTable(this).continuation_offset((uint)(begin - code_begin()));
4081 if (cont_offset != 0) return true;
4082
4083 return false;
4084 }
4085
4164 else
4165 st->print("<UNKNOWN>");
4166 break;
4167 }
4168 case Bytecodes::_getfield:
4169 case Bytecodes::_putfield:
4170 case Bytecodes::_getstatic:
4171 case Bytecodes::_putstatic:
4172 {
4173 Bytecode_field field(methodHandle(thread, sd->method()), sd->bci());
4174 st->print(" ");
4175 if (field.name() != nullptr)
4176 field.name()->print_symbol_on(st);
4177 else
4178 st->print("<UNKNOWN>");
4179 }
4180 default:
4181 break;
4182 }
4183 }
4184 st->print(" {reexecute=%d rethrow=%d return_oop=%d return_scalarized=%d}", sd->should_reexecute(), sd->rethrow_exception(), sd->return_oop(), sd->return_scalarized());
4185 }
4186
4187 // Print all scopes
4188 for (;sd != nullptr; sd = sd->sender()) {
4189 st->move_to(column, 6, 0);
4190 st->print("; -");
4191 if (sd->should_reexecute()) {
4192 st->print(" (reexecute)");
4193 }
4194 if (sd->method() == nullptr) {
4195 st->print("method is nullptr");
4196 } else {
4197 sd->method()->print_short_name(st);
4198 }
4199 int lineno = sd->method()->line_number_from_bci(sd->bci());
4200 if (lineno != -1) {
4201 st->print("@%d (line %d)", sd->bci(), lineno);
4202 } else {
4203 st->print("@%d", sd->bci());
4204 }
|