src/hotspot/share/code/relocInfo.cpp
changeset 52857 7e268f863ff0
parent 52070 e4d72440d60e
child 53686 3047cf8c3bc2
equal deleted inserted replaced
52856:5f3b9b633731 52857:7e268f863ff0
   642   assert(m != NULL || _method_index == 0, "should be non-null for non-zero index");
   642   assert(m != NULL || _method_index == 0, "should be non-null for non-zero index");
   643   assert(m == NULL || m->is_method(), "not a method");
   643   assert(m == NULL || m->is_method(), "not a method");
   644   return (Method*)m;
   644   return (Method*)m;
   645 }
   645 }
   646 
   646 
   647 void virtual_call_Relocation::clear_inline_cache() {
   647 bool virtual_call_Relocation::clear_inline_cache() {
   648   // No stubs for ICs
   648   // No stubs for ICs
   649   // Clean IC
   649   // Clean IC
   650   ResourceMark rm;
   650   ResourceMark rm;
   651   CompiledIC* icache = CompiledIC_at(this);
   651   CompiledIC* icache = CompiledIC_at(this);
   652   icache->set_to_clean();
   652   return icache->set_to_clean();
   653 }
   653 }
   654 
   654 
   655 
   655 
   656 void opt_virtual_call_Relocation::pack_data_to(CodeSection* dest) {
   656 void opt_virtual_call_Relocation::pack_data_to(CodeSection* dest) {
   657   short* p = (short*) dest->locs_end();
   657   short* p = (short*) dest->locs_end();
   670   assert(m != NULL || _method_index == 0, "should be non-null for non-zero index");
   670   assert(m != NULL || _method_index == 0, "should be non-null for non-zero index");
   671   assert(m == NULL || m->is_method(), "not a method");
   671   assert(m == NULL || m->is_method(), "not a method");
   672   return (Method*)m;
   672   return (Method*)m;
   673 }
   673 }
   674 
   674 
   675 void opt_virtual_call_Relocation::clear_inline_cache() {
   675 template<typename CompiledICorStaticCall>
       
   676 static bool set_to_clean_no_ic_refill(CompiledICorStaticCall* ic) {
       
   677   guarantee(ic->set_to_clean(), "Should not need transition stubs");
       
   678   return true;
       
   679 }
       
   680 
       
   681 bool opt_virtual_call_Relocation::clear_inline_cache() {
   676   // No stubs for ICs
   682   // No stubs for ICs
   677   // Clean IC
   683   // Clean IC
   678   ResourceMark rm;
   684   ResourceMark rm;
   679   CompiledIC* icache = CompiledIC_at(this);
   685   CompiledIC* icache = CompiledIC_at(this);
   680   icache->set_to_clean();
   686   return set_to_clean_no_ic_refill(icache);
   681 }
   687 }
   682 
       
   683 
   688 
   684 address opt_virtual_call_Relocation::static_stub(bool is_aot) {
   689 address opt_virtual_call_Relocation::static_stub(bool is_aot) {
   685   // search for the static stub who points back to this static call
   690   // search for the static stub who points back to this static call
   686   address static_call_addr = addr();
   691   address static_call_addr = addr();
   687   RelocIterator iter(code());
   692   RelocIterator iter(code());
   713 
   718 
   714 void static_call_Relocation::unpack_data() {
   719 void static_call_Relocation::unpack_data() {
   715   _method_index = unpack_1_int();
   720   _method_index = unpack_1_int();
   716 }
   721 }
   717 
   722 
   718 void static_call_Relocation::clear_inline_cache() {
   723 bool static_call_Relocation::clear_inline_cache() {
   719   // Safe call site info
   724   // Safe call site info
   720   CompiledStaticCall* handler = this->code()->compiledStaticCall_at(this);
   725   CompiledStaticCall* handler = this->code()->compiledStaticCall_at(this);
   721   handler->set_to_clean();
   726   return set_to_clean_no_ic_refill(handler);
   722 }
   727 }
   723 
   728 
   724 
   729 
   725 address static_call_Relocation::static_stub(bool is_aot) {
   730 address static_call_Relocation::static_stub(bool is_aot) {
   726   // search for the static stub who points back to this static call
   731   // search for the static stub who points back to this static call
   755   }
   760   }
   756 
   761 
   757   return NULL;
   762   return NULL;
   758 }
   763 }
   759 
   764 
   760 void static_stub_Relocation::clear_inline_cache() {
   765 bool static_stub_Relocation::clear_inline_cache() {
   761   // Call stub is only used when calling the interpreted code.
   766   // Call stub is only used when calling the interpreted code.
   762   // It does not really need to be cleared, except that we want to clean out the methodoop.
   767   // It does not really need to be cleared, except that we want to clean out the methodoop.
   763   CompiledDirectStaticCall::set_stub_to_clean(this);
   768   CompiledDirectStaticCall::set_stub_to_clean(this);
       
   769   return true;
   764 }
   770 }
   765 
   771 
   766 
   772 
   767 void external_word_Relocation::fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest) {
   773 void external_word_Relocation::fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest) {
   768   address target = _target;
   774   address target = _target;