< prev index next >

src/hotspot/share/code/nmethod.cpp

Print this page

2021       virtual_call_Relocation* r = iter.virtual_call_reloc();
2022       NativeMovConstReg* value = nativeMovConstReg_at(r->cached_value());
2023       virtual_call_data.append(value);
2024     } else if (iter.type() == relocInfo::post_call_nop_type) {
2025       post_call_nop_Relocation* const reloc = iter.post_call_nop_reloc();
2026       address pc = reloc->addr();
2027       install_post_call_nop_displacement(this, pc);
2028     }
2029   }
2030 
2031   if (virtual_call_data.length() > 0) {
2032     // We allocate a block of CompiledICData per nmethod so the GC can purge this faster.
2033     _compiled_ic_data = new CompiledICData[virtual_call_data.length()];
2034     CompiledICData* next_data = _compiled_ic_data;
2035 
2036     for (NativeMovConstReg* value : virtual_call_data) {
2037       value->set_data((intptr_t)next_data);
2038       next_data++;
2039     }
2040   }



2041 }
2042 
2043 void nmethod::make_deoptimized() {
2044   if (!Continuations::enabled()) {
2045     // Don't deopt this again.
2046     set_deoptimized_done();
2047     return;
2048   }
2049 
2050   assert(method() == nullptr || can_be_deoptimized(), "");
2051 
2052   CompiledICLocker ml(this);
2053   assert(CompiledICLocker::is_safe(this), "mt unsafe call");
2054 
2055   // If post call nops have been already patched, we can just bail-out.
2056   if (has_been_deoptimized()) {
2057     return;
2058   }
2059 
2060   ResourceMark rm;

3868           if (m != nullptr) {
3869             assert(m->is_method(), "");
3870             m->print_short_name(&st);
3871           }
3872           return st.as_string();
3873         }
3874         case relocInfo::static_stub_type:      return "static_stub";
3875         case relocInfo::external_word_type:    return "external_word";
3876         case relocInfo::internal_word_type:    return "internal_word";
3877         case relocInfo::section_word_type:     return "section_word";
3878         case relocInfo::poll_type:             return "poll";
3879         case relocInfo::poll_return_type:      return "poll_return";
3880         case relocInfo::trampoline_stub_type:  return "trampoline_stub";
3881         case relocInfo::post_call_nop_type:    return "post_call_nop";
3882         case relocInfo::barrier_type: {
3883           barrier_Relocation* const reloc = iter.barrier_reloc();
3884           stringStream st;
3885           st.print("barrier format=%d", reloc->format());
3886           return st.as_string();
3887         }







3888 
3889         case relocInfo::type_mask:             return "type_bit_mask";
3890 
3891         default: {
3892           stringStream st;
3893           st.print("unknown relocInfo=%d", (int) iter.type());
3894           return st.as_string();
3895         }
3896     }
3897   }
3898   return have_one ? "other" : nullptr;
3899 }
3900 
3901 // Return the last scope in (begin..end]
3902 ScopeDesc* nmethod::scope_desc_in(address begin, address end) {
3903   PcDesc* p = pc_desc_near(begin+1);
3904   if (p != nullptr && p->real_pc(this) <= end) {
3905     return new ScopeDesc(this, p);
3906   }
3907   return nullptr;

2021       virtual_call_Relocation* r = iter.virtual_call_reloc();
2022       NativeMovConstReg* value = nativeMovConstReg_at(r->cached_value());
2023       virtual_call_data.append(value);
2024     } else if (iter.type() == relocInfo::post_call_nop_type) {
2025       post_call_nop_Relocation* const reloc = iter.post_call_nop_reloc();
2026       address pc = reloc->addr();
2027       install_post_call_nop_displacement(this, pc);
2028     }
2029   }
2030 
2031   if (virtual_call_data.length() > 0) {
2032     // We allocate a block of CompiledICData per nmethod so the GC can purge this faster.
2033     _compiled_ic_data = new CompiledICData[virtual_call_data.length()];
2034     CompiledICData* next_data = _compiled_ic_data;
2035 
2036     for (NativeMovConstReg* value : virtual_call_data) {
2037       value->set_data((intptr_t)next_data);
2038       next_data++;
2039     }
2040   }
2041 
2042   BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod();
2043   bs_nm->finalize_relocations(this);
2044 }
2045 
2046 void nmethod::make_deoptimized() {
2047   if (!Continuations::enabled()) {
2048     // Don't deopt this again.
2049     set_deoptimized_done();
2050     return;
2051   }
2052 
2053   assert(method() == nullptr || can_be_deoptimized(), "");
2054 
2055   CompiledICLocker ml(this);
2056   assert(CompiledICLocker::is_safe(this), "mt unsafe call");
2057 
2058   // If post call nops have been already patched, we can just bail-out.
2059   if (has_been_deoptimized()) {
2060     return;
2061   }
2062 
2063   ResourceMark rm;

3871           if (m != nullptr) {
3872             assert(m->is_method(), "");
3873             m->print_short_name(&st);
3874           }
3875           return st.as_string();
3876         }
3877         case relocInfo::static_stub_type:      return "static_stub";
3878         case relocInfo::external_word_type:    return "external_word";
3879         case relocInfo::internal_word_type:    return "internal_word";
3880         case relocInfo::section_word_type:     return "section_word";
3881         case relocInfo::poll_type:             return "poll";
3882         case relocInfo::poll_return_type:      return "poll_return";
3883         case relocInfo::trampoline_stub_type:  return "trampoline_stub";
3884         case relocInfo::post_call_nop_type:    return "post_call_nop";
3885         case relocInfo::barrier_type: {
3886           barrier_Relocation* const reloc = iter.barrier_reloc();
3887           stringStream st;
3888           st.print("barrier format=%d", reloc->format());
3889           return st.as_string();
3890         }
3891         case relocInfo::patchable_barrier_type: {
3892           patchable_barrier_Relocation* const reloc = iter.patchable_barrier_reloc();
3893           stringStream st;
3894           st.print("patchable_barrier metadata=0x%x target=" PTR_FORMAT,
3895                    reloc->metadata(), (intptr_t)code_begin() + reloc->target_offset());
3896           return st.as_string();
3897         }
3898 
3899         case relocInfo::type_mask:             return "type_bit_mask";
3900 
3901         default: {
3902           stringStream st;
3903           st.print("unknown relocInfo=%d", (int) iter.type());
3904           return st.as_string();
3905         }
3906     }
3907   }
3908   return have_one ? "other" : nullptr;
3909 }
3910 
3911 // Return the last scope in (begin..end]
3912 ScopeDesc* nmethod::scope_desc_in(address begin, address end) {
3913   PcDesc* p = pc_desc_near(begin+1);
3914   if (p != nullptr && p->real_pc(this) <= end) {
3915     return new ScopeDesc(this, p);
3916   }
3917   return nullptr;
< prev index next >