diff -r dca9294d9f59 -r a530dbabe64f hotspot/src/share/vm/code/relocInfo.hpp --- a/hotspot/src/share/vm/code/relocInfo.hpp Thu Sep 22 18:29:15 2016 +0200 +++ b/hotspot/src/share/vm/code/relocInfo.hpp Wed Oct 05 15:20:35 2016 +0200 @@ -270,7 +270,7 @@ poll_return_type = 11, // polling instruction for safepoints at return metadata_type = 12, // metadata that used to be oops trampoline_stub_type = 13, // stub-entry for trampoline - yet_unused_type_1 = 14, // Still unused + runtime_call_w_cp_type = 14, // Runtime call which may load its target from the constant pool data_prefix_tag = 15, // tag for a prefix (carries data arguments) type_mask = 15 // A mask which selects only the above values }; @@ -305,6 +305,7 @@ visitor(static_call) \ visitor(static_stub) \ visitor(runtime_call) \ + visitor(runtime_call_w_cp) \ visitor(external_word) \ visitor(internal_word) \ visitor(poll) \ @@ -827,8 +828,6 @@ // ic_call_type is not always posisition dependent (depending on the state of the cache)). However, this is // probably a reasonable assumption, since empty caches simplifies code reloacation. virtual void fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest) { } - - void print(); }; @@ -1175,6 +1174,36 @@ public: }; + +class runtime_call_w_cp_Relocation : public CallRelocation { + relocInfo::relocType type() { return relocInfo::runtime_call_w_cp_type; } + + public: + static RelocationHolder spec() { + RelocationHolder rh = newHolder(); + new(rh) runtime_call_w_cp_Relocation(); + return rh; + } + + private: + friend class RelocIterator; + runtime_call_w_cp_Relocation() { _offset = -4; /* <0 = invalid */ } + // On z/Architecture, runtime calls are either a sequence + // of two instructions (load destination of call from constant pool + do call) + // or a pc-relative call. The pc-relative call is faster, but it can only + // be used if the destination of the call is not too far away. + // In order to be able to patch a pc-relative call back into one using + // the constant pool, we have to remember the location of the call's destination + // in the constant pool. + int _offset; + + public: + void set_constant_pool_offset(int offset) { _offset = offset; } + int get_constant_pool_offset() { return _offset; } + void pack_data_to(CodeSection * dest); + void unpack_data(); +}; + // Trampoline Relocations. // A trampoline allows to encode a small branch in the code, even if there // is the chance that this branch can not reach all possible code locations.