Mercurial > hg > graal-compiler
comparison src/share/vm/code/relocInfo.hpp @ 14909:4ca6dc0799b6
Backout jdk9 merge
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Tue, 01 Apr 2014 13:57:07 +0200 |
parents | d8041d695d19 |
children | 52b4284cb496 |
comparison
equal
deleted
inserted
replaced
14908:8db6e76cb658 | 14909:4ca6dc0799b6 |
---|---|
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 trampoline_stub_type = 13, // stub-entry for trampoline | 268 yet_unused_type_1 = 13, // Still unused |
269 yet_unused_type_1 = 14, // Still unused | 269 yet_unused_type_2 = 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) \ | |
310 | 309 |
311 | 310 |
312 public: | 311 public: |
313 enum { | 312 enum { |
314 value_width = sizeof(unsigned short) * BitsPerByte, | 313 value_width = sizeof(unsigned short) * BitsPerByte, |
463 | 462 |
464 inline relocInfo filler_relocInfo() { | 463 inline relocInfo filler_relocInfo() { |
465 return relocInfo(relocInfo::none, relocInfo::offset_limit() - relocInfo::offset_unit); | 464 return relocInfo(relocInfo::none, relocInfo::offset_limit() - relocInfo::offset_unit); |
466 } | 465 } |
467 | 466 |
468 inline relocInfo prefix_relocInfo(int datalen = 0) { | 467 inline relocInfo prefix_relocInfo(int datalen) { |
469 assert(relocInfo::fits_into_immediate(datalen), "datalen in limits"); | 468 assert(relocInfo::fits_into_immediate(datalen), "datalen in limits"); |
470 return relocInfo(relocInfo::data_prefix_tag, relocInfo::RAW_BITS, relocInfo::datalen_tag | datalen); | 469 return relocInfo(relocInfo::data_prefix_tag, relocInfo::RAW_BITS, relocInfo::datalen_tag | datalen); |
471 } | 470 } |
472 | 471 |
473 | 472 |
1154 runtime_call_Relocation() { } | 1153 runtime_call_Relocation() { } |
1155 | 1154 |
1156 public: | 1155 public: |
1157 }; | 1156 }; |
1158 | 1157 |
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 | |
1196 class external_word_Relocation : public DataRelocation { | 1158 class external_word_Relocation : public DataRelocation { |
1197 relocInfo::relocType type() { return relocInfo::external_word_type; } | 1159 relocInfo::relocType type() { return relocInfo::external_word_type; } |
1198 | 1160 |
1199 public: | 1161 public: |
1200 static RelocationHolder spec(address target) { | 1162 static RelocationHolder spec(address target) { |