268 section_word_type = 9, // internal, but a cross-section reference |
268 section_word_type = 9, // internal, but a cross-section reference |
269 poll_type = 10, // polling instruction for safepoints |
269 poll_type = 10, // polling instruction for safepoints |
270 poll_return_type = 11, // polling instruction for safepoints at return |
270 poll_return_type = 11, // polling instruction for safepoints at return |
271 metadata_type = 12, // metadata that used to be oops |
271 metadata_type = 12, // metadata that used to be oops |
272 trampoline_stub_type = 13, // stub-entry for trampoline |
272 trampoline_stub_type = 13, // stub-entry for trampoline |
273 yet_unused_type_1 = 14, // Still unused |
273 runtime_call_w_cp_type = 14, // Runtime call which may load its target from the constant pool |
274 data_prefix_tag = 15, // tag for a prefix (carries data arguments) |
274 data_prefix_tag = 15, // tag for a prefix (carries data arguments) |
275 type_mask = 15 // A mask which selects only the above values |
275 type_mask = 15 // A mask which selects only the above values |
276 }; |
276 }; |
277 |
277 |
278 protected: |
278 protected: |
303 visitor(virtual_call) \ |
303 visitor(virtual_call) \ |
304 visitor(opt_virtual_call) \ |
304 visitor(opt_virtual_call) \ |
305 visitor(static_call) \ |
305 visitor(static_call) \ |
306 visitor(static_stub) \ |
306 visitor(static_stub) \ |
307 visitor(runtime_call) \ |
307 visitor(runtime_call) \ |
|
308 visitor(runtime_call_w_cp) \ |
308 visitor(external_word) \ |
309 visitor(external_word) \ |
309 visitor(internal_word) \ |
310 visitor(internal_word) \ |
310 visitor(poll) \ |
311 visitor(poll) \ |
311 visitor(poll_return) \ |
312 visitor(poll_return) \ |
312 visitor(section_word) \ |
313 visitor(section_word) \ |
825 |
826 |
826 // This method assumes that all virtual/static (inline) caches are cleared (since for static_call_type and |
827 // This method assumes that all virtual/static (inline) caches are cleared (since for static_call_type and |
827 // ic_call_type is not always posisition dependent (depending on the state of the cache)). However, this is |
828 // ic_call_type is not always posisition dependent (depending on the state of the cache)). However, this is |
828 // probably a reasonable assumption, since empty caches simplifies code reloacation. |
829 // probably a reasonable assumption, since empty caches simplifies code reloacation. |
829 virtual void fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest) { } |
830 virtual void fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest) { } |
830 |
|
831 void print(); |
|
832 }; |
831 }; |
833 |
832 |
834 |
833 |
835 // certain inlines must be deferred until class Relocation is defined: |
834 // certain inlines must be deferred until class Relocation is defined: |
836 |
835 |
1171 private: |
1170 private: |
1172 friend class RelocIterator; |
1171 friend class RelocIterator; |
1173 runtime_call_Relocation() { } |
1172 runtime_call_Relocation() { } |
1174 |
1173 |
1175 public: |
1174 public: |
|
1175 }; |
|
1176 |
|
1177 |
|
1178 class runtime_call_w_cp_Relocation : public CallRelocation { |
|
1179 relocInfo::relocType type() { return relocInfo::runtime_call_w_cp_type; } |
|
1180 |
|
1181 public: |
|
1182 static RelocationHolder spec() { |
|
1183 RelocationHolder rh = newHolder(); |
|
1184 new(rh) runtime_call_w_cp_Relocation(); |
|
1185 return rh; |
|
1186 } |
|
1187 |
|
1188 private: |
|
1189 friend class RelocIterator; |
|
1190 runtime_call_w_cp_Relocation() { _offset = -4; /* <0 = invalid */ } |
|
1191 // On z/Architecture, runtime calls are either a sequence |
|
1192 // of two instructions (load destination of call from constant pool + do call) |
|
1193 // or a pc-relative call. The pc-relative call is faster, but it can only |
|
1194 // be used if the destination of the call is not too far away. |
|
1195 // In order to be able to patch a pc-relative call back into one using |
|
1196 // the constant pool, we have to remember the location of the call's destination |
|
1197 // in the constant pool. |
|
1198 int _offset; |
|
1199 |
|
1200 public: |
|
1201 void set_constant_pool_offset(int offset) { _offset = offset; } |
|
1202 int get_constant_pool_offset() { return _offset; } |
|
1203 void pack_data_to(CodeSection * dest); |
|
1204 void unpack_data(); |
1176 }; |
1205 }; |
1177 |
1206 |
1178 // Trampoline Relocations. |
1207 // Trampoline Relocations. |
1179 // A trampoline allows to encode a small branch in the code, even if there |
1208 // A trampoline allows to encode a small branch in the code, even if there |
1180 // is the chance that this branch can not reach all possible code locations. |
1209 // is the chance that this branch can not reach all possible code locations. |