Mercurial > hg > truffle
comparison src/share/vm/code/relocInfo.hpp @ 2468:6c97c830fb6f
Merge
author | jrose |
---|---|
date | Sat, 09 Apr 2011 21:16:12 -0700 |
parents | 1d1603768966 479b4b4b6950 |
children | da91efe96a93 |
comparison
equal
deleted
inserted
replaced
2439:0930dc920c18 | 2468:6c97c830fb6f |
---|---|
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; |