< prev index next >

src/hotspot/share/code/nmethod.cpp

Print this page




 581     _entry_bci               = InvocationEntryBci;
 582     // We have no exception handler or deopt handler make the
 583     // values something that will never match a pc like the nmethod vtable entry
 584     _exception_offset        = 0;
 585     _orig_pc_offset          = 0;
 586 
 587     _consts_offset           = data_offset();
 588     _stub_offset             = data_offset();
 589     _oops_offset             = data_offset();
 590     _metadata_offset         = _oops_offset         + align_up(code_buffer->total_oop_size(), oopSize);
 591     scopes_data_offset       = _metadata_offset     + align_up(code_buffer->total_metadata_size(), wordSize);
 592     _scopes_pcs_offset       = scopes_data_offset;
 593     _dependencies_offset     = _scopes_pcs_offset;
 594     _handler_table_offset    = _dependencies_offset;
 595     _nul_chk_table_offset    = _handler_table_offset;
 596     _nmethod_end_offset      = _nul_chk_table_offset;
 597     _compile_id              = compile_id;
 598     _comp_level              = CompLevel_none;
 599     _entry_point             = code_begin()          + offsets->value(CodeOffsets::Entry);
 600     _verified_entry_point    = code_begin()          + offsets->value(CodeOffsets::Verified_Entry);


 601     _osr_entry_point         = NULL;
 602     _exception_cache         = NULL;
 603     _pc_desc_container.reset_to(NULL);
 604     _hotness_counter         = NMethodSweeper::hotness_counter_reset_val();
 605 
 606     _scopes_data_begin = (address) this + scopes_data_offset;
 607     _deopt_handler_begin = (address) this + deoptimize_offset;
 608     _deopt_mh_handler_begin = (address) this + deoptimize_mh_offset;
 609 
 610     code_buffer->copy_code_and_locs_to(this);
 611     code_buffer->copy_values_to(this);
 612 
 613     clear_unloading_state();
 614     if (ScavengeRootsInCode) {
 615       Universe::heap()->register_nmethod(this);
 616     }
 617     debug_only(Universe::heap()->verify_nmethod(this));
 618     CodeCache::commit(this);
 619   }
 620 


 741     }
 742 #endif
 743     }
 744     if (offsets->value(CodeOffsets::UnwindHandler) != -1) {
 745       _unwind_handler_offset = code_offset()         + offsets->value(CodeOffsets::UnwindHandler);
 746     } else {
 747       _unwind_handler_offset = -1;
 748     }
 749 
 750     _oops_offset             = data_offset();
 751     _metadata_offset         = _oops_offset          + align_up(code_buffer->total_oop_size(), oopSize);
 752     int scopes_data_offset   = _metadata_offset      + align_up(code_buffer->total_metadata_size(), wordSize);
 753 
 754     _scopes_pcs_offset       = scopes_data_offset    + align_up(debug_info->data_size       (), oopSize);
 755     _dependencies_offset     = _scopes_pcs_offset    + adjust_pcs_size(debug_info->pcs_size());
 756     _handler_table_offset    = _dependencies_offset  + align_up((int)dependencies->size_in_bytes (), oopSize);
 757     _nul_chk_table_offset    = _handler_table_offset + align_up(handler_table->size_in_bytes(), oopSize);
 758     _nmethod_end_offset      = _nul_chk_table_offset + align_up(nul_chk_table->size_in_bytes(), oopSize);
 759     _entry_point             = code_begin()          + offsets->value(CodeOffsets::Entry);
 760     _verified_entry_point    = code_begin()          + offsets->value(CodeOffsets::Verified_Entry);


 761     _osr_entry_point         = code_begin()          + offsets->value(CodeOffsets::OSR_Entry);
 762     _exception_cache         = NULL;
 763 
 764     _scopes_data_begin = (address) this + scopes_data_offset;
 765 
 766     _pc_desc_container.reset_to(scopes_pcs_begin());
 767 
 768     code_buffer->copy_code_and_locs_to(this);
 769     // Copy contents of ScopeDescRecorder to nmethod
 770     code_buffer->copy_values_to(this);
 771     debug_info->copy_to(this);
 772     dependencies->copy_to(this);
 773     clear_unloading_state();
 774     if (ScavengeRootsInCode) {
 775       Universe::heap()->register_nmethod(this);
 776     }
 777     debug_only(Universe::heap()->verify_nmethod(this));
 778 
 779     CodeCache::commit(this);
 780 


2207   verify_scopes();
2208 }
2209 
2210 
2211 void nmethod::verify_interrupt_point(address call_site) {
2212   // Verify IC only when nmethod installation is finished.
2213   if (!is_not_installed()) {
2214     if (CompiledICLocker::is_safe(this)) {
2215       CompiledIC_at(this, call_site);
2216       CHECK_UNHANDLED_OOPS_ONLY(Thread::current()->clear_unhandled_oops());
2217     } else {
2218       CompiledICLocker ml_verify(this);
2219       CompiledIC_at(this, call_site);
2220     }
2221   }
2222 
2223   PcDesc* pd = pc_desc_at(nativeCall_at(call_site)->return_address());
2224   assert(pd != NULL, "PcDesc must exist");
2225   for (ScopeDesc* sd = new ScopeDesc(this, pd->scope_decode_offset(),
2226                                      pd->obj_decode_offset(), pd->should_reexecute(), pd->rethrow_exception(),
2227                                      pd->return_oop());
2228        !sd->is_top(); sd = sd->sender()) {
2229     sd->verify();
2230   }
2231 }
2232 
2233 void nmethod::verify_scopes() {
2234   if( !method() ) return;       // Runtime stubs have no scope
2235   if (method()->is_native()) return; // Ignore stub methods.
2236   // iterate through all interrupt point
2237   // and verify the debug information is valid.
2238   RelocIterator iter((nmethod*)this);
2239   while (iter.next()) {
2240     address stub = NULL;
2241     switch (iter.type()) {
2242       case relocInfo::virtual_call_type:
2243         verify_interrupt_point(iter.addr());
2244         break;
2245       case relocInfo::opt_virtual_call_type:
2246         stub = iter.opt_virtual_call_reloc()->static_stub(false);
2247         verify_interrupt_point(iter.addr());


2552         case relocInfo::internal_word_type:    return "internal_word";
2553         case relocInfo::section_word_type:     return "section_word";
2554         case relocInfo::poll_type:             return "poll";
2555         case relocInfo::poll_return_type:      return "poll_return";
2556         case relocInfo::trampoline_stub_type:  return "trampoline_stub";
2557         case relocInfo::type_mask:             return "type_bit_mask";
2558 
2559         default:
2560           break;
2561     }
2562   }
2563   return have_one ? "other" : NULL;
2564 }
2565 
2566 // Return a the last scope in (begin..end]
2567 ScopeDesc* nmethod::scope_desc_in(address begin, address end) {
2568   PcDesc* p = pc_desc_near(begin+1);
2569   if (p != NULL && p->real_pc(this) <= end) {
2570     return new ScopeDesc(this, p->scope_decode_offset(),
2571                          p->obj_decode_offset(), p->should_reexecute(), p->rethrow_exception(),
2572                          p->return_oop());
2573   }
2574   return NULL;
2575 }
2576 
2577 void nmethod::print_nmethod_labels(outputStream* stream, address block_begin) const {
2578   if (block_begin == entry_point())             stream->print_cr("[Entry Point]");
2579   if (block_begin == verified_entry_point())    stream->print_cr("[Verified Entry Point]");
2580   if (JVMCI_ONLY(_exception_offset >= 0 &&) block_begin == exception_begin())         stream->print_cr("[Exception Handler]");
2581   if (block_begin == stub_begin())              stream->print_cr("[Stub Code]");
2582   if (JVMCI_ONLY(_deopt_handler_begin != NULL &&) block_begin == deopt_handler_begin())     stream->print_cr("[Deopt Handler Code]");
2583 
2584   if (has_method_handle_invokes())
2585     if (block_begin == deopt_mh_handler_begin())  stream->print_cr("[Deopt MH Handler Code]");
2586 
2587   if (block_begin == consts_begin())            stream->print_cr("[Constants]");
2588 
2589   if (block_begin == entry_point()) {
2590     methodHandle m = method();
2591     if (m.not_null()) {
2592       stream->print("  # ");
2593       m->print_value_on(stream);
2594       stream->cr();
2595     }
2596     if (m.not_null() && !is_osr_method()) {
2597       ResourceMark rm;
2598       int sizeargs = m->size_of_parameters();
2599       BasicType* sig_bt = NEW_RESOURCE_ARRAY(BasicType, sizeargs);
2600       VMRegPair* regs   = NEW_RESOURCE_ARRAY(VMRegPair, sizeargs);
2601       {
2602         int sig_index = 0;
2603         if (!m->is_static())
2604           sig_bt[sig_index++] = T_OBJECT; // 'this'
2605         for (SignatureStream ss(m->signature()); !ss.at_return_type(); ss.next()) {





2606           BasicType t = ss.type();
2607           sig_bt[sig_index++] = t;
2608           if (type2size[t] == 2) {
2609             sig_bt[sig_index++] = T_VOID;
2610           } else {
2611             assert(type2size[t] == 1, "size is 1 or 2");
2612           }
2613         }
2614         assert(sig_index == sizeargs, "");
2615       }
2616       const char* spname = "sp"; // make arch-specific?
2617       intptr_t out_preserve = SharedRuntime::java_calling_convention(sig_bt, regs, sizeargs, false);
2618       int stack_slot_offset = this->frame_size() * wordSize;
2619       int tab1 = 14, tab2 = 24;
2620       int sig_index = 0;
2621       int arg_index = (m->is_static() ? 0 : -1);

2622       bool did_old_sp = false;
2623       for (SignatureStream ss(m->signature()); !ss.at_return_type(); ) {
2624         bool at_this = (arg_index == -1);
2625         bool at_old_sp = false;
2626         BasicType t = (at_this ? T_OBJECT : ss.type());
2627         assert(t == sig_bt[sig_index], "sigs in sync");
2628         if (at_this)
2629           stream->print("  # this: ");
2630         else
2631           stream->print("  # parm%d: ", arg_index);

2632         stream->move_to(tab1);
2633         VMReg fst = regs[sig_index].first();
2634         VMReg snd = regs[sig_index].second();
2635         if (fst->is_reg()) {
2636           stream->print("%s", fst->name());
2637           if (snd->is_valid())  {
2638             stream->print(":%s", snd->name());
2639           }
2640         } else if (fst->is_stack()) {
2641           int offset = fst->reg2stack() * VMRegImpl::stack_slot_size + stack_slot_offset;
2642           if (offset == stack_slot_offset)  at_old_sp = true;
2643           stream->print("[%s+0x%x]", spname, offset);
2644         } else {
2645           stream->print("reg%d:%d??", (int)(intptr_t)fst, (int)(intptr_t)snd);
2646         }
2647         stream->print(" ");
2648         stream->move_to(tab2);
2649         stream->print("= ");
2650         if (at_this) {
2651           m->method_holder()->print_value_on(stream);
2652         } else {
2653           bool did_name = false;
2654           if (!at_this && ss.is_object()) {
2655             Symbol* name = ss.as_symbol_or_null();
2656             if (name != NULL) {
2657               name->print_value_on(stream);
2658               did_name = true;
2659             }
2660           }
2661           if (!did_name)
2662             stream->print("%s", type2name(t));
2663         }









2664         if (at_old_sp) {
2665           stream->print("  (%s of caller)", spname);
2666           did_old_sp = true;
2667         }
2668         stream->cr();
2669         sig_index += type2size[t];
2670         arg_index += 1;
2671         if (!at_this)  ss.next();
2672       }
2673       if (!did_old_sp) {
2674         stream->print("  # ");
2675         stream->move_to(tab1);
2676         stream->print("[%s+0x%x]", spname, stack_slot_offset);
2677         stream->print("  (%s of caller)", spname);
2678         stream->cr();
2679       }
2680     }
2681   }













2682 }
2683 
2684 void nmethod::print_code_comment_on(outputStream* st, int column, u_char* begin, u_char* end) {
2685   // First, find an oopmap in (begin, end].
2686   // We use the odd half-closed interval so that oop maps and scope descs
2687   // which are tied to the byte after a call are printed with the call itself.
2688   address base = code_begin();
2689   ImmutableOopMapSet* oms = oop_maps();
2690   if (oms != NULL) {
2691     for (int i = 0, imax = oms->count(); i < imax; i++) {
2692       const ImmutableOopMapPair* pair = oms->pair_at(i);
2693       const ImmutableOopMap* om = pair->get_from(oms);
2694       address pc = base + pair->pc_offset();
2695       if (pc > begin) {
2696         if (pc <= end) {
2697           st->move_to(column);
2698           st->print("; ");
2699           om->print_on(st);
2700         }
2701         break;


2740             else
2741               st->print("<UNKNOWN>");
2742             break;
2743           }
2744         case Bytecodes::_getfield:
2745         case Bytecodes::_putfield:
2746         case Bytecodes::_getstatic:
2747         case Bytecodes::_putstatic:
2748           {
2749             Bytecode_field field(sd->method(), sd->bci());
2750             st->print(" ");
2751             if (field.name() != NULL)
2752               field.name()->print_symbol_on(st);
2753             else
2754               st->print("<UNKNOWN>");
2755           }
2756         default:
2757           break;
2758         }
2759       }
2760       st->print(" {reexecute=%d rethrow=%d return_oop=%d}", sd->should_reexecute(), sd->rethrow_exception(), sd->return_oop());
2761     }
2762 
2763     // Print all scopes
2764     for (;sd != NULL; sd = sd->sender()) {
2765       st->move_to(column);
2766       st->print("; -");
2767       if (sd->method() == NULL) {
2768         st->print("method is NULL");
2769       } else {
2770         sd->method()->print_short_name(st);
2771       }
2772       int lineno = sd->method()->line_number_from_bci(sd->bci());
2773       if (lineno != -1) {
2774         st->print("@%d (line %d)", sd->bci(), lineno);
2775       } else {
2776         st->print("@%d", sd->bci());
2777       }
2778       st->cr();
2779     }
2780   }




 581     _entry_bci               = InvocationEntryBci;
 582     // We have no exception handler or deopt handler make the
 583     // values something that will never match a pc like the nmethod vtable entry
 584     _exception_offset        = 0;
 585     _orig_pc_offset          = 0;
 586 
 587     _consts_offset           = data_offset();
 588     _stub_offset             = data_offset();
 589     _oops_offset             = data_offset();
 590     _metadata_offset         = _oops_offset         + align_up(code_buffer->total_oop_size(), oopSize);
 591     scopes_data_offset       = _metadata_offset     + align_up(code_buffer->total_metadata_size(), wordSize);
 592     _scopes_pcs_offset       = scopes_data_offset;
 593     _dependencies_offset     = _scopes_pcs_offset;
 594     _handler_table_offset    = _dependencies_offset;
 595     _nul_chk_table_offset    = _handler_table_offset;
 596     _nmethod_end_offset      = _nul_chk_table_offset;
 597     _compile_id              = compile_id;
 598     _comp_level              = CompLevel_none;
 599     _entry_point             = code_begin()          + offsets->value(CodeOffsets::Entry);
 600     _verified_entry_point    = code_begin()          + offsets->value(CodeOffsets::Verified_Entry);
 601     _verified_value_entry_point = _verified_entry_point;
 602     _verified_value_ro_entry_point = _verified_entry_point;
 603     _osr_entry_point         = NULL;
 604     _exception_cache         = NULL;
 605     _pc_desc_container.reset_to(NULL);
 606     _hotness_counter         = NMethodSweeper::hotness_counter_reset_val();
 607 
 608     _scopes_data_begin = (address) this + scopes_data_offset;
 609     _deopt_handler_begin = (address) this + deoptimize_offset;
 610     _deopt_mh_handler_begin = (address) this + deoptimize_mh_offset;
 611 
 612     code_buffer->copy_code_and_locs_to(this);
 613     code_buffer->copy_values_to(this);
 614 
 615     clear_unloading_state();
 616     if (ScavengeRootsInCode) {
 617       Universe::heap()->register_nmethod(this);
 618     }
 619     debug_only(Universe::heap()->verify_nmethod(this));
 620     CodeCache::commit(this);
 621   }
 622 


 743     }
 744 #endif
 745     }
 746     if (offsets->value(CodeOffsets::UnwindHandler) != -1) {
 747       _unwind_handler_offset = code_offset()         + offsets->value(CodeOffsets::UnwindHandler);
 748     } else {
 749       _unwind_handler_offset = -1;
 750     }
 751 
 752     _oops_offset             = data_offset();
 753     _metadata_offset         = _oops_offset          + align_up(code_buffer->total_oop_size(), oopSize);
 754     int scopes_data_offset   = _metadata_offset      + align_up(code_buffer->total_metadata_size(), wordSize);
 755 
 756     _scopes_pcs_offset       = scopes_data_offset    + align_up(debug_info->data_size       (), oopSize);
 757     _dependencies_offset     = _scopes_pcs_offset    + adjust_pcs_size(debug_info->pcs_size());
 758     _handler_table_offset    = _dependencies_offset  + align_up((int)dependencies->size_in_bytes (), oopSize);
 759     _nul_chk_table_offset    = _handler_table_offset + align_up(handler_table->size_in_bytes(), oopSize);
 760     _nmethod_end_offset      = _nul_chk_table_offset + align_up(nul_chk_table->size_in_bytes(), oopSize);
 761     _entry_point             = code_begin()          + offsets->value(CodeOffsets::Entry);
 762     _verified_entry_point    = code_begin()          + offsets->value(CodeOffsets::Verified_Entry);
 763     _verified_value_entry_point = code_begin()       + offsets->value(CodeOffsets::Verified_Value_Entry);
 764     _verified_value_ro_entry_point = code_begin()    + offsets->value(CodeOffsets::Verified_Value_Entry_RO);
 765     _osr_entry_point         = code_begin()          + offsets->value(CodeOffsets::OSR_Entry);
 766     _exception_cache         = NULL;
 767 
 768     _scopes_data_begin = (address) this + scopes_data_offset;
 769 
 770     _pc_desc_container.reset_to(scopes_pcs_begin());
 771 
 772     code_buffer->copy_code_and_locs_to(this);
 773     // Copy contents of ScopeDescRecorder to nmethod
 774     code_buffer->copy_values_to(this);
 775     debug_info->copy_to(this);
 776     dependencies->copy_to(this);
 777     clear_unloading_state();
 778     if (ScavengeRootsInCode) {
 779       Universe::heap()->register_nmethod(this);
 780     }
 781     debug_only(Universe::heap()->verify_nmethod(this));
 782 
 783     CodeCache::commit(this);
 784 


2211   verify_scopes();
2212 }
2213 
2214 
2215 void nmethod::verify_interrupt_point(address call_site) {
2216   // Verify IC only when nmethod installation is finished.
2217   if (!is_not_installed()) {
2218     if (CompiledICLocker::is_safe(this)) {
2219       CompiledIC_at(this, call_site);
2220       CHECK_UNHANDLED_OOPS_ONLY(Thread::current()->clear_unhandled_oops());
2221     } else {
2222       CompiledICLocker ml_verify(this);
2223       CompiledIC_at(this, call_site);
2224     }
2225   }
2226 
2227   PcDesc* pd = pc_desc_at(nativeCall_at(call_site)->return_address());
2228   assert(pd != NULL, "PcDesc must exist");
2229   for (ScopeDesc* sd = new ScopeDesc(this, pd->scope_decode_offset(),
2230                                      pd->obj_decode_offset(), pd->should_reexecute(), pd->rethrow_exception(),
2231                                      pd->return_oop(), pd->return_vt());
2232        !sd->is_top(); sd = sd->sender()) {
2233     sd->verify();
2234   }
2235 }
2236 
2237 void nmethod::verify_scopes() {
2238   if( !method() ) return;       // Runtime stubs have no scope
2239   if (method()->is_native()) return; // Ignore stub methods.
2240   // iterate through all interrupt point
2241   // and verify the debug information is valid.
2242   RelocIterator iter((nmethod*)this);
2243   while (iter.next()) {
2244     address stub = NULL;
2245     switch (iter.type()) {
2246       case relocInfo::virtual_call_type:
2247         verify_interrupt_point(iter.addr());
2248         break;
2249       case relocInfo::opt_virtual_call_type:
2250         stub = iter.opt_virtual_call_reloc()->static_stub(false);
2251         verify_interrupt_point(iter.addr());


2556         case relocInfo::internal_word_type:    return "internal_word";
2557         case relocInfo::section_word_type:     return "section_word";
2558         case relocInfo::poll_type:             return "poll";
2559         case relocInfo::poll_return_type:      return "poll_return";
2560         case relocInfo::trampoline_stub_type:  return "trampoline_stub";
2561         case relocInfo::type_mask:             return "type_bit_mask";
2562 
2563         default:
2564           break;
2565     }
2566   }
2567   return have_one ? "other" : NULL;
2568 }
2569 
2570 // Return a the last scope in (begin..end]
2571 ScopeDesc* nmethod::scope_desc_in(address begin, address end) {
2572   PcDesc* p = pc_desc_near(begin+1);
2573   if (p != NULL && p->real_pc(this) <= end) {
2574     return new ScopeDesc(this, p->scope_decode_offset(),
2575                          p->obj_decode_offset(), p->should_reexecute(), p->rethrow_exception(),
2576                          p->return_oop(), p->return_vt());
2577   }
2578   return NULL;
2579 }
2580 
2581 void nmethod::print_nmethod_labels(outputStream* stream, address block_begin) const {
2582   address low = MIN4(entry_point(), verified_entry_point(), verified_value_entry_point(), verified_value_ro_entry_point());
2583   assert(low != 0, "sanity");
2584   if (block_begin == low) {
2585     // Print method arguments before the method entry








2586     methodHandle m = method();
2587     if (m.not_null()) {
2588       stream->print("  # ");
2589       m->print_value_on(stream);
2590       stream->cr();
2591     }
2592     if (m.not_null() && !is_osr_method()) {
2593       ResourceMark rm;
2594       int sizeargs = 0;
2595       BasicType* sig_bt = NEW_RESOURCE_ARRAY(BasicType, 256);
2596       VMRegPair* regs   = NEW_RESOURCE_ARRAY(VMRegPair, 256);
2597       Symbol* sig = m->signature();
2598       const GrowableArray<SigEntry>* sig_cc = m->adapter()->get_sig_cc();
2599       if (m->has_scalarized_args()) {
2600         // Use extended signature if value type arguments are passed as fields
2601         assert(sig_cc != NULL, "must have scalarized signature");
2602         sig = SigEntry::create_symbol(sig_cc);
2603       } else if (!m->is_static()) {
2604         sig_bt[sizeargs++] = T_OBJECT; // 'this'
2605       }
2606       for (SignatureStream ss(sig); !ss.at_return_type(); ss.next()) {
2607         BasicType t = ss.type();
2608         sig_bt[sizeargs++] = t;
2609         if (type2size[t] == 2) {
2610           sig_bt[sizeargs++] = T_VOID;
2611         } else {
2612           assert(type2size[t] == 1, "size is 1 or 2");
2613         }
2614       }


2615       const char* spname = "sp"; // make arch-specific?
2616       SharedRuntime::java_calling_convention(sig_bt, regs, sizeargs, false);
2617       int stack_slot_offset = this->frame_size() * wordSize;
2618       int tab1 = 14, tab2 = 24;
2619       int sig_index = 0;
2620       int sig_index_cc = 0;
2621       int arg_index = ((m->is_static() || m->has_scalarized_args()) ? 0 : -1);
2622       bool did_old_sp = false;
2623       for (SignatureStream ss(sig); !ss.at_return_type(); ) {
2624         bool at_this = (arg_index == -1);
2625         bool at_old_sp = false;
2626         BasicType t = (at_this ? T_OBJECT : ss.type());
2627         assert(t == sig_bt[sig_index], "sigs in sync");
2628         if (at_this) {
2629           stream->print("  # this: ");
2630         } else {
2631           stream->print("  # parm%d: ", arg_index);
2632         }
2633         stream->move_to(tab1);
2634         VMReg fst = regs[sig_index].first();
2635         VMReg snd = regs[sig_index].second();
2636         if (fst->is_reg()) {
2637           stream->print("%s", fst->name());
2638           if (snd->is_valid())  {
2639             stream->print(":%s", snd->name());
2640           }
2641         } else if (fst->is_stack()) {
2642           int offset = fst->reg2stack() * VMRegImpl::stack_slot_size + stack_slot_offset;
2643           if (offset == stack_slot_offset)  at_old_sp = true;
2644           stream->print("[%s+0x%x]", spname, offset);
2645         } else {
2646           stream->print("reg%d:%d??", (int)(intptr_t)fst, (int)(intptr_t)snd);
2647         }
2648         stream->print(" ");
2649         stream->move_to(tab2);
2650         stream->print("= ");
2651         if (at_this) {
2652           m->method_holder()->print_value_on(stream);
2653         } else {
2654           bool did_name = false;
2655           if (!at_this && ss.is_object()) {
2656             Symbol* name = ss.as_symbol_or_null();
2657             if (name != NULL) {
2658               name->print_value_on(stream);
2659               did_name = true;
2660             }
2661           }
2662           if (!did_name)
2663             stream->print("%s", type2name(t));
2664         }
2665         if (m->has_scalarized_args()) {
2666           while (!SigEntry::skip_value_delimiters(sig_cc, sig_index_cc)) {
2667             sig_index_cc++;
2668           }
2669           if (SigEntry::is_reserved_entry(sig_cc, sig_index_cc)) {
2670             stream->print(" [RESERVED]");
2671           }
2672           sig_index_cc += type2size[t];
2673         }
2674         if (at_old_sp) {
2675           stream->print("  (%s of caller)", spname);
2676           did_old_sp = true;
2677         }
2678         stream->cr();
2679         sig_index += type2size[t];
2680         arg_index += 1;
2681         if (!at_this)  ss.next();
2682       }
2683       if (!did_old_sp) {
2684         stream->print("  # ");
2685         stream->move_to(tab1);
2686         stream->print("[%s+0x%x]", spname, stack_slot_offset);
2687         stream->print("  (%s of caller)", spname);
2688         stream->cr();
2689       }
2690     }
2691   }
2692 
2693   if (block_begin == entry_point())             stream->print_cr("[Entry Point]");
2694   if (block_begin == verified_entry_point())    stream->print_cr("[Verified Entry Point]");
2695   if (block_begin == verified_value_entry_point()) stream->print_cr("[Verified Value Entry Point]");
2696   if (block_begin == verified_value_ro_entry_point()) stream->print_cr("[Verified Value Entry Point (RO)]");
2697   if (JVMCI_ONLY(_exception_offset >= 0 &&) block_begin == exception_begin())         stream->print_cr("[Exception Handler]");
2698   if (block_begin == stub_begin())              stream->print_cr("[Stub Code]");
2699   if (JVMCI_ONLY(_deopt_handler_begin != NULL &&) block_begin == deopt_handler_begin())     stream->print_cr("[Deopt Handler Code]");
2700 
2701   if (has_method_handle_invokes())
2702     if (block_begin == deopt_mh_handler_begin())  stream->print_cr("[Deopt MH Handler Code]");
2703 
2704   if (block_begin == consts_begin() && consts_begin() != low) stream->print_cr("[Constants]");
2705 }
2706 
2707 void nmethod::print_code_comment_on(outputStream* st, int column, u_char* begin, u_char* end) {
2708   // First, find an oopmap in (begin, end].
2709   // We use the odd half-closed interval so that oop maps and scope descs
2710   // which are tied to the byte after a call are printed with the call itself.
2711   address base = code_begin();
2712   ImmutableOopMapSet* oms = oop_maps();
2713   if (oms != NULL) {
2714     for (int i = 0, imax = oms->count(); i < imax; i++) {
2715       const ImmutableOopMapPair* pair = oms->pair_at(i);
2716       const ImmutableOopMap* om = pair->get_from(oms);
2717       address pc = base + pair->pc_offset();
2718       if (pc > begin) {
2719         if (pc <= end) {
2720           st->move_to(column);
2721           st->print("; ");
2722           om->print_on(st);
2723         }
2724         break;


2763             else
2764               st->print("<UNKNOWN>");
2765             break;
2766           }
2767         case Bytecodes::_getfield:
2768         case Bytecodes::_putfield:
2769         case Bytecodes::_getstatic:
2770         case Bytecodes::_putstatic:
2771           {
2772             Bytecode_field field(sd->method(), sd->bci());
2773             st->print(" ");
2774             if (field.name() != NULL)
2775               field.name()->print_symbol_on(st);
2776             else
2777               st->print("<UNKNOWN>");
2778           }
2779         default:
2780           break;
2781         }
2782       }
2783       st->print(" {reexecute=%d rethrow=%d return_oop=%d return_vt=%d}", sd->should_reexecute(), sd->rethrow_exception(), sd->return_oop(), sd->return_vt());
2784     }
2785 
2786     // Print all scopes
2787     for (;sd != NULL; sd = sd->sender()) {
2788       st->move_to(column);
2789       st->print("; -");
2790       if (sd->method() == NULL) {
2791         st->print("method is NULL");
2792       } else {
2793         sd->method()->print_short_name(st);
2794       }
2795       int lineno = sd->method()->line_number_from_bci(sd->bci());
2796       if (lineno != -1) {
2797         st->print("@%d (line %d)", sd->bci(), lineno);
2798       } else {
2799         st->print("@%d", sd->bci());
2800       }
2801       st->cr();
2802     }
2803   }


< prev index next >