< prev index next >

src/hotspot/share/code/relocInfo.cpp


659 }                                                                                                                                    
660 
661 void opt_virtual_call_Relocation::unpack_data() {                                                                                    
662   _method_index = unpack_1_int();                                                                                                    
663 }                                                                                                                                    
664 
665 Method* opt_virtual_call_Relocation::method_value() {                                                                                
666   CompiledMethod* cm = code();                                                                                                       
667   if (cm == NULL) return (Method*)NULL;                                                                                              
668   Metadata* m = cm->metadata_at(_method_index);                                                                                      
669   assert(m != NULL || _method_index == 0, "should be non-null for non-zero index");                                                  
670   assert(m == NULL || m->is_method(), "not a method");                                                                               
671   return (Method*)m;                                                                                                                 
672 }                                                                                                                                    
673 
674 bool opt_virtual_call_Relocation::clear_inline_cache() {                                                                             
675   // No stubs for ICs                                                                                                                
676   // Clean IC                                                                                                                        
677   ResourceMark rm;                                                                                                                   
678   CompiledIC* icache = CompiledIC_at(this);                                                                                          
679   guarantee(icache->set_to_clean(), "opt_virtual_call cleaning should never fail");                                                  
                                                                                                                                     
680   return true;                                                                                                                       
681 }                                                                                                                                    
682 
683 
684 address opt_virtual_call_Relocation::static_stub(bool is_aot) {                                                                      
685   // search for the static stub who points back to this static call                                                                  
686   address static_call_addr = addr();                                                                                                 
687   RelocIterator iter(code());                                                                                                        
688   while (iter.next()) {                                                                                                              
689     if (iter.type() == relocInfo::static_stub_type) {                                                                                
690       static_stub_Relocation* stub_reloc = iter.static_stub_reloc();                                                                 
691       if (stub_reloc->static_call() == static_call_addr && stub_reloc->is_aot() == is_aot) {                                         
692         return iter.addr();                                                                                                          
693       }                                                                                                                              
694     }                                                                                                                                
695   }                                                                                                                                  
696   return NULL;                                                                                                                       
697 }                                                                                                                                    
698 

659 }
660 
661 void opt_virtual_call_Relocation::unpack_data() {
662   _method_index = unpack_1_int();
663 }
664 
665 Method* opt_virtual_call_Relocation::method_value() {
666   CompiledMethod* cm = code();
667   if (cm == NULL) return (Method*)NULL;
668   Metadata* m = cm->metadata_at(_method_index);
669   assert(m != NULL || _method_index == 0, "should be non-null for non-zero index");
670   assert(m == NULL || m->is_method(), "not a method");
671   return (Method*)m;
672 }
673 
674 bool opt_virtual_call_Relocation::clear_inline_cache() {
675   // No stubs for ICs
676   // Clean IC
677   ResourceMark rm;
678   CompiledIC* icache = CompiledIC_at(this);
679   guarantee(icache->set_to_clean(),
680             "Should not need transition stubs");
681   return true;
682 }
683 
684 
685 address opt_virtual_call_Relocation::static_stub(bool is_aot) {
686   // search for the static stub who points back to this static call
687   address static_call_addr = addr();
688   RelocIterator iter(code());
689   while (iter.next()) {
690     if (iter.type() == relocInfo::static_stub_type) {
691       static_stub_Relocation* stub_reloc = iter.static_stub_reloc();
692       if (stub_reloc->static_call() == static_call_addr && stub_reloc->is_aot() == is_aot) {
693         return iter.addr();
694       }
695     }
696   }
697   return NULL;
698 }
699 

701   if (cm == NULL) return (Method*)NULL;                                                                                              
702   Metadata* m = cm->metadata_at(_method_index);                                                                                      
703   assert(m != NULL || _method_index == 0, "should be non-null for non-zero index");                                                  
704   assert(m == NULL || m->is_method(), "not a method");                                                                               
705   return (Method*)m;                                                                                                                 
706 }                                                                                                                                    
707 
708 void static_call_Relocation::pack_data_to(CodeSection* dest) {                                                                       
709   short* p = (short*) dest->locs_end();                                                                                              
710   p = pack_1_int_to(p, _method_index);                                                                                               
711   dest->set_locs_end((relocInfo*) p);                                                                                                
712 }                                                                                                                                    
713 
714 void static_call_Relocation::unpack_data() {                                                                                         
715   _method_index = unpack_1_int();                                                                                                    
716 }                                                                                                                                    
717 
718 bool static_call_Relocation::clear_inline_cache() {                                                                                  
719   // Safe call site info                                                                                                             
720   CompiledStaticCall* handler = this->code()->compiledStaticCall_at(this);                                                           
721   guarantee(handler->set_to_clean(), "CompiledStaticCall cleaning should not fail");                                                 
                                                                                                                                     
722   return true;                                                                                                                       
723 }                                                                                                                                    
724 
725 
726 address static_call_Relocation::static_stub(bool is_aot) {                                                                           
727   // search for the static stub who points back to this static call                                                                  
728   address static_call_addr = addr();                                                                                                 
729   RelocIterator iter(code());                                                                                                        
730   while (iter.next()) {                                                                                                              
731     if (iter.type() == relocInfo::static_stub_type) {                                                                                
732       static_stub_Relocation* stub_reloc = iter.static_stub_reloc();                                                                 
733       if (stub_reloc->static_call() == static_call_addr && stub_reloc->is_aot() == is_aot) {                                         
734         return iter.addr();                                                                                                          
735       }                                                                                                                              
736     }                                                                                                                                
737   }                                                                                                                                  
738   return NULL;                                                                                                                       
739 }                                                                                                                                    
740 

702   if (cm == NULL) return (Method*)NULL;
703   Metadata* m = cm->metadata_at(_method_index);
704   assert(m != NULL || _method_index == 0, "should be non-null for non-zero index");
705   assert(m == NULL || m->is_method(), "not a method");
706   return (Method*)m;
707 }
708 
709 void static_call_Relocation::pack_data_to(CodeSection* dest) {
710   short* p = (short*) dest->locs_end();
711   p = pack_1_int_to(p, _method_index);
712   dest->set_locs_end((relocInfo*) p);
713 }
714 
715 void static_call_Relocation::unpack_data() {
716   _method_index = unpack_1_int();
717 }
718 
719 bool static_call_Relocation::clear_inline_cache() {
720   // Safe call site info
721   CompiledStaticCall* handler = this->code()->compiledStaticCall_at(this);
722   guarantee(handler->set_to_clean(),
723             "Should not need transition stubs");
724   return true;
725 }
726 
727 
728 address static_call_Relocation::static_stub(bool is_aot) {
729   // search for the static stub who points back to this static call
730   address static_call_addr = addr();
731   RelocIterator iter(code());
732   while (iter.next()) {
733     if (iter.type() == relocInfo::static_stub_type) {
734       static_stub_Relocation* stub_reloc = iter.static_stub_reloc();
735       if (stub_reloc->static_call() == static_call_addr && stub_reloc->is_aot() == is_aot) {
736         return iter.addr();
737       }
738     }
739   }
740   return NULL;
741 }
742 
< prev index next >