1988 virtual_call_Relocation* r = iter.virtual_call_reloc();
1989 NativeMovConstReg* value = nativeMovConstReg_at(r->cached_value());
1990 virtual_call_data.append(value);
1991 } else if (iter.type() == relocInfo::post_call_nop_type) {
1992 post_call_nop_Relocation* const reloc = iter.post_call_nop_reloc();
1993 address pc = reloc->addr();
1994 install_post_call_nop_displacement(this, pc);
1995 }
1996 }
1997
1998 if (virtual_call_data.length() > 0) {
1999 // We allocate a block of CompiledICData per nmethod so the GC can purge this faster.
2000 _compiled_ic_data = new CompiledICData[virtual_call_data.length()];
2001 CompiledICData* next_data = _compiled_ic_data;
2002
2003 for (NativeMovConstReg* value : virtual_call_data) {
2004 value->set_data((intptr_t)next_data);
2005 next_data++;
2006 }
2007 }
2008 }
2009
2010 void nmethod::make_deoptimized() {
2011 if (!Continuations::enabled()) {
2012 // Don't deopt this again.
2013 set_deoptimized_done();
2014 return;
2015 }
2016
2017 assert(method() == nullptr || can_be_deoptimized(), "");
2018
2019 CompiledICLocker ml(this);
2020 assert(CompiledICLocker::is_safe(this), "mt unsafe call");
2021
2022 // If post call nops have been already patched, we can just bail-out.
2023 if (has_been_deoptimized()) {
2024 return;
2025 }
2026
2027 ResourceMark rm;
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;
|
1988 virtual_call_Relocation* r = iter.virtual_call_reloc();
1989 NativeMovConstReg* value = nativeMovConstReg_at(r->cached_value());
1990 virtual_call_data.append(value);
1991 } else if (iter.type() == relocInfo::post_call_nop_type) {
1992 post_call_nop_Relocation* const reloc = iter.post_call_nop_reloc();
1993 address pc = reloc->addr();
1994 install_post_call_nop_displacement(this, pc);
1995 }
1996 }
1997
1998 if (virtual_call_data.length() > 0) {
1999 // We allocate a block of CompiledICData per nmethod so the GC can purge this faster.
2000 _compiled_ic_data = new CompiledICData[virtual_call_data.length()];
2001 CompiledICData* next_data = _compiled_ic_data;
2002
2003 for (NativeMovConstReg* value : virtual_call_data) {
2004 value->set_data((intptr_t)next_data);
2005 next_data++;
2006 }
2007 }
2008
2009 BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod();
2010 bs_nm->finalize_relocations(this);
2011 }
2012
2013 void nmethod::make_deoptimized() {
2014 if (!Continuations::enabled()) {
2015 // Don't deopt this again.
2016 set_deoptimized_done();
2017 return;
2018 }
2019
2020 assert(method() == nullptr || can_be_deoptimized(), "");
2021
2022 CompiledICLocker ml(this);
2023 assert(CompiledICLocker::is_safe(this), "mt unsafe call");
2024
2025 // If post call nops have been already patched, we can just bail-out.
2026 if (has_been_deoptimized()) {
2027 return;
2028 }
2029
2030 ResourceMark rm;
3839 assert(m->is_method(), "");
3840 m->print_short_name(&st);
3841 }
3842 return st.as_string();
3843 }
3844 case relocInfo::static_stub_type: return "static_stub";
3845 case relocInfo::external_word_type: return "external_word";
3846 case relocInfo::internal_word_type: return "internal_word";
3847 case relocInfo::section_word_type: return "section_word";
3848 case relocInfo::poll_type: return "poll";
3849 case relocInfo::poll_return_type: return "poll_return";
3850 case relocInfo::trampoline_stub_type: return "trampoline_stub";
3851 case relocInfo::entry_guard_type: return "entry_guard";
3852 case relocInfo::post_call_nop_type: return "post_call_nop";
3853 case relocInfo::barrier_type: {
3854 barrier_Relocation* const reloc = iter.barrier_reloc();
3855 stringStream st;
3856 st.print("barrier format=%d", reloc->format());
3857 return st.as_string();
3858 }
3859 case relocInfo::patchable_barrier_type: {
3860 patchable_barrier_Relocation* const reloc = iter.patchable_barrier_reloc();
3861 stringStream st;
3862 st.print("patchable_barrier metadata=%d", reloc->metadata());
3863 return st.as_string();
3864 }
3865
3866 case relocInfo::type_mask: return "type_bit_mask";
3867
3868 default: {
3869 stringStream st;
3870 st.print("unknown relocInfo=%d", (int) iter.type());
3871 return st.as_string();
3872 }
3873 }
3874 }
3875 return have_one ? "other" : nullptr;
3876 }
3877
3878 // Return the last scope in (begin..end]
3879 ScopeDesc* nmethod::scope_desc_in(address begin, address end) {
3880 PcDesc* p = pc_desc_near(begin+1);
3881 if (p != nullptr && p->real_pc(this) <= end) {
3882 return new ScopeDesc(this, p);
3883 }
3884 return nullptr;
|