comparison src/share/vm/code/relocInfo.hpp @ 14521:29ccc4cbabca

Merge
author Gilles Duboscq <duboscq@ssw.jku.at>
date Wed, 12 Mar 2014 13:30:08 +0100
parents d8041d695d19
children 4ca6dc0799b6
comparison
equal deleted inserted replaced
14520:f84115370178 14521:29ccc4cbabca
263 internal_word_type = 8, // reference within the current code blob 263 internal_word_type = 8, // reference within the current code blob
264 section_word_type = 9, // internal, but a cross-section reference 264 section_word_type = 9, // internal, but a cross-section reference
265 poll_type = 10, // polling instruction for safepoints 265 poll_type = 10, // polling instruction for safepoints
266 poll_return_type = 11, // polling instruction for safepoints at return 266 poll_return_type = 11, // polling instruction for safepoints at return
267 metadata_type = 12, // metadata that used to be oops 267 metadata_type = 12, // metadata that used to be oops
268 yet_unused_type_1 = 13, // Still unused 268 trampoline_stub_type = 13, // stub-entry for trampoline
269 yet_unused_type_2 = 14, // Still unused 269 yet_unused_type_1 = 14, // Still unused
270 data_prefix_tag = 15, // tag for a prefix (carries data arguments) 270 data_prefix_tag = 15, // tag for a prefix (carries data arguments)
271 type_mask = 15 // A mask which selects only the above values 271 type_mask = 15 // A mask which selects only the above values
272 }; 272 };
273 273
274 protected: 274 protected:
304 visitor(external_word) \ 304 visitor(external_word) \
305 visitor(internal_word) \ 305 visitor(internal_word) \
306 visitor(poll) \ 306 visitor(poll) \
307 visitor(poll_return) \ 307 visitor(poll_return) \
308 visitor(section_word) \ 308 visitor(section_word) \
309 visitor(trampoline_stub) \
309 310
310 311
311 public: 312 public:
312 enum { 313 enum {
313 value_width = sizeof(unsigned short) * BitsPerByte, 314 value_width = sizeof(unsigned short) * BitsPerByte,
462 463
463 inline relocInfo filler_relocInfo() { 464 inline relocInfo filler_relocInfo() {
464 return relocInfo(relocInfo::none, relocInfo::offset_limit() - relocInfo::offset_unit); 465 return relocInfo(relocInfo::none, relocInfo::offset_limit() - relocInfo::offset_unit);
465 } 466 }
466 467
467 inline relocInfo prefix_relocInfo(int datalen) { 468 inline relocInfo prefix_relocInfo(int datalen = 0) {
468 assert(relocInfo::fits_into_immediate(datalen), "datalen in limits"); 469 assert(relocInfo::fits_into_immediate(datalen), "datalen in limits");
469 return relocInfo(relocInfo::data_prefix_tag, relocInfo::RAW_BITS, relocInfo::datalen_tag | datalen); 470 return relocInfo(relocInfo::data_prefix_tag, relocInfo::RAW_BITS, relocInfo::datalen_tag | datalen);
470 } 471 }
471 472
472 473
1153 runtime_call_Relocation() { } 1154 runtime_call_Relocation() { }
1154 1155
1155 public: 1156 public:
1156 }; 1157 };
1157 1158
1159 // Trampoline Relocations.
1160 // A trampoline allows to encode a small branch in the code, even if there
1161 // is the chance that this branch can not reach all possible code locations.
1162 // If the relocation finds that a branch is too far for the instruction
1163 // in the code, it can patch it to jump to the trampoline where is
1164 // sufficient space for a far branch. Needed on PPC.
1165 class trampoline_stub_Relocation : public Relocation {
1166 relocInfo::relocType type() { return relocInfo::trampoline_stub_type; }
1167
1168 public:
1169 static RelocationHolder spec(address static_call) {
1170 RelocationHolder rh = newHolder();
1171 return (new (rh) trampoline_stub_Relocation(static_call));
1172 }
1173
1174 private:
1175 address _owner; // Address of the NativeCall that owns the trampoline.
1176
1177 trampoline_stub_Relocation(address owner) {
1178 _owner = owner;
1179 }
1180
1181 friend class RelocIterator;
1182 trampoline_stub_Relocation() { }
1183
1184 public:
1185
1186 // Return the address of the NativeCall that owns the trampoline.
1187 address owner() { return _owner; }
1188
1189 void pack_data_to(CodeSection * dest);
1190 void unpack_data();
1191
1192 // Find the trampoline stub for a call.
1193 static address get_trampoline_for(address call, nmethod* code);
1194 };
1195
1158 class external_word_Relocation : public DataRelocation { 1196 class external_word_Relocation : public DataRelocation {
1159 relocInfo::relocType type() { return relocInfo::external_word_type; } 1197 relocInfo::relocType type() { return relocInfo::external_word_type; }
1160 1198
1161 public: 1199 public:
1162 static RelocationHolder spec(address target) { 1200 static RelocationHolder spec(address target) {