< prev index next >

src/hotspot/share/code/nmethod.cpp

Print this page

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



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

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






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

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

3872           if (m != nullptr) {
3873             assert(m->is_method(), "");
3874             m->print_short_name(&st);
3875           }
3876           return st.as_string();
3877         }
3878         case relocInfo::static_stub_type:      return "static_stub";
3879         case relocInfo::external_word_type:    return "external_word";
3880         case relocInfo::internal_word_type:    return "internal_word";
3881         case relocInfo::section_word_type:     return "section_word";
3882         case relocInfo::poll_type:             return "poll";
3883         case relocInfo::poll_return_type:      return "poll_return";
3884         case relocInfo::trampoline_stub_type:  return "trampoline_stub";
3885         case relocInfo::post_call_nop_type:    return "post_call_nop";
3886         case relocInfo::barrier_type: {
3887           barrier_Relocation* const reloc = iter.barrier_reloc();
3888           stringStream st;
3889           st.print("barrier format=%d", reloc->format());
3890           return st.as_string();
3891         }
3892         case relocInfo::patchable_barrier_type: {
3893           patchable_barrier_Relocation* const reloc = iter.patchable_barrier_reloc();
3894           stringStream st;
3895           st.print("patchable_barrier metadata=%d", reloc->metadata());
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 >