1.1 --- a/src/share/vm/code/relocInfo.hpp Mon Apr 04 22:17:15 2011 -0700 1.2 +++ b/src/share/vm/code/relocInfo.hpp Tue Apr 05 00:31:09 2011 -0700 1.3 @@ -703,6 +703,10 @@ 1.4 assert(datalen()==0 || type()==relocInfo::none, "no data here"); 1.5 } 1.6 1.7 + static bool is_reloc_index(intptr_t index) { 1.8 + return 0 < index && index < os::vm_page_size(); 1.9 + } 1.10 + 1.11 protected: 1.12 // Helper functions for pack_data_to() and unpack_data(). 1.13 1.14 @@ -1127,6 +1131,12 @@ 1.15 return rh; 1.16 } 1.17 1.18 + // Some address looking values aren't safe to treat as relocations 1.19 + // and should just be treated as constants. 1.20 + static bool can_be_relocated(address target) { 1.21 + return target != NULL && !is_reloc_index((intptr_t)target); 1.22 + } 1.23 + 1.24 private: 1.25 address _target; // address in runtime 1.26