diff a/src/hotspot/share/code/relocInfo.hpp b/src/hotspot/share/code/relocInfo.hpp --- a/src/hotspot/share/code/relocInfo.hpp +++ b/src/hotspot/share/code/relocInfo.hpp @@ -267,10 +267,11 @@ 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) post_call_nop_type = 16, // A tag for post call nop relocations entry_guard_type = 17, // A tag for an nmethod entry barrier guard value barrier_type = 18, // GC barrier data + patchable_barrier_type = 19, // Patchable GC barrier type_mask = 31 // A mask which selects only the above values }; private: unsigned short _value; @@ -309,10 +310,11 @@ visitor(section_word) \ visitor(trampoline_stub) \ visitor(post_call_nop) \ visitor(entry_guard) \ visitor(barrier) \ + visitor(patchable_barrier) \ public: enum : unsigned short{ value_width = sizeof(unsigned short) * BitsPerByte, @@ -1069,10 +1071,37 @@ friend class RelocIterator; friend class RelocationHolder; barrier_Relocation() : Relocation(relocInfo::barrier_type) { } }; +class patchable_barrier_Relocation : public Relocation { +public: + jint _metadata; + jint _target_offset; + + static RelocationHolder spec(int metadata) { + return RelocationHolder::construct(metadata); + } + + patchable_barrier_Relocation(int metadata) : Relocation(relocInfo::patchable_barrier_type), + _metadata(metadata), _target_offset(0) { } + + void pack_data_to(CodeSection* dest) override; + void unpack_data() override; + + void copy_into(RelocationHolder& holder) const override; + + jint metadata() const { return _metadata; } + jint target_offset() const { return _target_offset; } + + void set_target_offset(jint target_offset); + +private: + friend class RelocIterator; + friend class RelocationHolder; + patchable_barrier_Relocation() : Relocation(relocInfo::patchable_barrier_type) { } +}; class virtual_call_Relocation : public CallRelocation { public: // "cached_value" points to the first associated set-oop.