1.1 --- a/src/share/vm/code/relocInfo.hpp Fri Jun 21 00:59:12 2013 -0700 1.2 +++ b/src/share/vm/code/relocInfo.hpp Mon Jun 24 11:53:54 2013 -0700 1.3 @@ -49,9 +49,6 @@ 1.4 // RelocIterator 1.5 // A StackObj which iterates over the relocations associated with 1.6 // a range of code addresses. Can be used to operate a copy of code. 1.7 -// PatchingRelocIterator 1.8 -// Specialized subtype of RelocIterator which removes breakpoints 1.9 -// temporarily during iteration, then restores them. 1.10 // BoundRelocation 1.11 // An _internal_ type shared by packers and unpackers of relocations. 1.12 // It pastes together a RelocationHolder with some pointers into 1.13 @@ -204,15 +201,6 @@ 1.14 // immediate field must not straddle a unit of memory coherence. 1.15 // //%note reloc_3 1.16 // 1.17 -// relocInfo::breakpoint_type -- a conditional breakpoint in the code 1.18 -// Value: none 1.19 -// Instruction types: any whatsoever 1.20 -// Data: [b [T]t i...] 1.21 -// The b is a bit-packed word representing the breakpoint's attributes. 1.22 -// The t is a target address which the breakpoint calls (when it is enabled). 1.23 -// The i... is a place to store one or two instruction words overwritten 1.24 -// by a trap, so that the breakpoint may be subsequently removed. 1.25 -// 1.26 // relocInfo::static_stub_type -- an extra stub for each static_call_type 1.27 // Value: none 1.28 // Instruction types: a virtual call: { set_oop; jump; } 1.29 @@ -271,8 +259,8 @@ 1.30 section_word_type = 9, // internal, but a cross-section reference 1.31 poll_type = 10, // polling instruction for safepoints 1.32 poll_return_type = 11, // polling instruction for safepoints at return 1.33 - breakpoint_type = 12, // an initialization barrier or safepoint 1.34 - metadata_type = 13, // metadata that used to be oops 1.35 + metadata_type = 12, // metadata that used to be oops 1.36 + yet_unused_type_1 = 13, // Still unused 1.37 yet_unused_type_2 = 14, // Still unused 1.38 data_prefix_tag = 15, // tag for a prefix (carries data arguments) 1.39 type_mask = 15 // A mask which selects only the above values 1.40 @@ -312,7 +300,6 @@ 1.41 visitor(internal_word) \ 1.42 visitor(poll) \ 1.43 visitor(poll_return) \ 1.44 - visitor(breakpoint) \ 1.45 visitor(section_word) \ 1.46 1.47 1.48 @@ -454,7 +441,7 @@ 1.49 public: 1.50 enum { 1.51 // Conservatively large estimate of maximum length (in shorts) 1.52 - // of any relocation record (probably breakpoints are largest). 1.53 + // of any relocation record. 1.54 // Extended format is length prefix, data words, and tag/offset suffix. 1.55 length_limit = 1 + 1 + (3*BytesPerWord/BytesPerShort) + 1, 1.56 have_format = format_width > 0 1.57 @@ -571,8 +558,6 @@ 1.58 1.59 void initialize(nmethod* nm, address begin, address limit); 1.60 1.61 - friend class PatchingRelocIterator; 1.62 - // make an uninitialized one, for PatchingRelocIterator: 1.63 RelocIterator() { initialize_misc(); } 1.64 1.65 public: 1.66 @@ -779,9 +764,6 @@ 1.67 void pd_verify_data_value (address x, intptr_t off) { pd_set_data_value(x, off, true); } 1.68 address pd_call_destination (address orig_addr = NULL); 1.69 void pd_set_call_destination (address x); 1.70 - void pd_swap_in_breakpoint (address x, short* instrs, int instrlen); 1.71 - void pd_swap_out_breakpoint (address x, short* instrs, int instrlen); 1.72 - static int pd_breakpoint_size (); 1.73 1.74 // this extracts the address of an address in the code stream instead of the reloc data 1.75 address* pd_address_in_code (); 1.76 @@ -1302,87 +1284,6 @@ 1.77 void fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest); 1.78 }; 1.79 1.80 - 1.81 -class breakpoint_Relocation : public Relocation { 1.82 - relocInfo::relocType type() { return relocInfo::breakpoint_type; } 1.83 - 1.84 - enum { 1.85 - // attributes which affect the interpretation of the data: 1.86 - removable_attr = 0x0010, // buffer [i...] allows for undoing the trap 1.87 - internal_attr = 0x0020, // the target is an internal addr (local stub) 1.88 - settable_attr = 0x0040, // the target is settable 1.89 - 1.90 - // states which can change over time: 1.91 - enabled_state = 0x0100, // breakpoint must be active in running code 1.92 - active_state = 0x0200, // breakpoint instruction actually in code 1.93 - 1.94 - kind_mask = 0x000F, // mask for extracting kind 1.95 - high_bit = 0x4000 // extra bit which is always set 1.96 - }; 1.97 - 1.98 - public: 1.99 - enum { 1.100 - // kinds: 1.101 - initialization = 1, 1.102 - safepoint = 2 1.103 - }; 1.104 - 1.105 - // If target is NULL, 32 bits are reserved for a later set_target(). 1.106 - static RelocationHolder spec(int kind, address target = NULL, bool internal_target = false) { 1.107 - RelocationHolder rh = newHolder(); 1.108 - new(rh) breakpoint_Relocation(kind, target, internal_target); 1.109 - return rh; 1.110 - } 1.111 - 1.112 - private: 1.113 - // We require every bits value to NOT to fit into relocInfo::datalen_width, 1.114 - // because we are going to actually store state in the reloc, and so 1.115 - // cannot allow it to be compressed (and hence copied by the iterator). 1.116 - 1.117 - short _bits; // bit-encoded kind, attrs, & state 1.118 - address _target; 1.119 - 1.120 - breakpoint_Relocation(int kind, address target, bool internal_target); 1.121 - 1.122 - friend class RelocIterator; 1.123 - breakpoint_Relocation() { } 1.124 - 1.125 - short bits() const { return _bits; } 1.126 - short& live_bits() const { return data()[0]; } 1.127 - short* instrs() const { return data() + datalen() - instrlen(); } 1.128 - int instrlen() const { return removable() ? pd_breakpoint_size() : 0; } 1.129 - 1.130 - void set_bits(short x) { 1.131 - assert(live_bits() == _bits, "must be the only mutator of reloc info"); 1.132 - live_bits() = _bits = x; 1.133 - } 1.134 - 1.135 - public: 1.136 - address target() const; 1.137 - void set_target(address x); 1.138 - 1.139 - int kind() const { return bits() & kind_mask; } 1.140 - bool enabled() const { return (bits() & enabled_state) != 0; } 1.141 - bool active() const { return (bits() & active_state) != 0; } 1.142 - bool internal() const { return (bits() & internal_attr) != 0; } 1.143 - bool removable() const { return (bits() & removable_attr) != 0; } 1.144 - bool settable() const { return (bits() & settable_attr) != 0; } 1.145 - 1.146 - void set_enabled(bool b); // to activate, you must also say set_active 1.147 - void set_active(bool b); // actually inserts bpt (must be enabled 1st) 1.148 - 1.149 - // data is packed as 16 bits, followed by the target (1 or 2 words), followed 1.150 - // if necessary by empty storage for saving away original instruction bytes. 1.151 - void pack_data_to(CodeSection* dest); 1.152 - void unpack_data(); 1.153 - 1.154 - // during certain operations, breakpoints must be out of the way: 1.155 - void fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest) { 1.156 - assert(!active(), "cannot perform relocation on enabled breakpoints"); 1.157 - } 1.158 -}; 1.159 - 1.160 - 1.161 // We know all the xxx_Relocation classes, so now we can define these: 1.162 #define EACH_CASE(name) \ 1.163 inline name##_Relocation* RelocIterator::name##_reloc() { \ 1.164 @@ -1401,25 +1302,4 @@ 1.165 initialize(nm, begin, limit); 1.166 } 1.167 1.168 -// if you are going to patch code, you should use this subclass of 1.169 -// RelocIterator 1.170 -class PatchingRelocIterator : public RelocIterator { 1.171 - private: 1.172 - RelocIterator _init_state; 1.173 - 1.174 - void prepass(); // deactivates all breakpoints 1.175 - void postpass(); // reactivates all enabled breakpoints 1.176 - 1.177 - // do not copy these puppies; it would have unpredictable side effects 1.178 - // these are private and have no bodies defined because they should not be called 1.179 - PatchingRelocIterator(const RelocIterator&); 1.180 - void operator=(const RelocIterator&); 1.181 - 1.182 - public: 1.183 - PatchingRelocIterator(nmethod* nm, address begin = NULL, address limit = NULL) 1.184 - : RelocIterator(nm, begin, limit) { prepass(); } 1.185 - 1.186 - ~PatchingRelocIterator() { postpass(); } 1.187 -}; 1.188 - 1.189 #endif // SHARE_VM_CODE_RELOCINFO_HPP