hotspot/src/share/vm/code/relocInfo.hpp
changeset 9124 f60dee480d49
parent 8921 14bfe81f2a9d
parent 9111 c100c09c66f2
child 13728 882756847a04
equal deleted inserted replaced
9093:62b8e328f8c8 9124:f60dee480d49
   701   // here is the type-specific hook which reads (unpacks) relocation data:
   701   // here is the type-specific hook which reads (unpacks) relocation data:
   702   virtual void unpack_data() {
   702   virtual void unpack_data() {
   703     assert(datalen()==0 || type()==relocInfo::none, "no data here");
   703     assert(datalen()==0 || type()==relocInfo::none, "no data here");
   704   }
   704   }
   705 
   705 
       
   706   static bool is_reloc_index(intptr_t index) {
       
   707     return 0 < index && index < os::vm_page_size();
       
   708   }
       
   709 
   706  protected:
   710  protected:
   707   // Helper functions for pack_data_to() and unpack_data().
   711   // Helper functions for pack_data_to() and unpack_data().
   708 
   712 
   709   // Most of the compression logic is confined here.
   713   // Most of the compression logic is confined here.
   710   // (The "immediate data" mechanism of relocInfo works independently
   714   // (The "immediate data" mechanism of relocInfo works independently
  1125     RelocationHolder rh = newHolder();
  1129     RelocationHolder rh = newHolder();
  1126     new(rh) external_word_Relocation(NULL);
  1130     new(rh) external_word_Relocation(NULL);
  1127     return rh;
  1131     return rh;
  1128   }
  1132   }
  1129 
  1133 
       
  1134   // Some address looking values aren't safe to treat as relocations
       
  1135   // and should just be treated as constants.
       
  1136   static bool can_be_relocated(address target) {
       
  1137     return target != NULL && !is_reloc_index((intptr_t)target);
       
  1138   }
       
  1139 
  1130  private:
  1140  private:
  1131   address _target;                  // address in runtime
  1141   address _target;                  // address in runtime
  1132 
  1142 
  1133   external_word_Relocation(address target) {
  1143   external_word_Relocation(address target) {
  1134     _target = target;
  1144     _target = target;