src/share/vm/asm/assembler.hpp

changeset 3395
40c2484c09e1
parent 3310
6729bbc1fcd6
child 3969
1d7922586cf6
equal deleted inserted replaced
3394:b642b49f9738 3395:40c2484c09e1
239 friend class InstructionMark; 239 friend class InstructionMark;
240 #ifdef ASSERT 240 #ifdef ASSERT
241 // Make it return true on platforms which need to verify 241 // Make it return true on platforms which need to verify
242 // instruction boundaries for some operations. 242 // instruction boundaries for some operations.
243 inline static bool pd_check_instruction_mark(); 243 inline static bool pd_check_instruction_mark();
244
245 // Add delta to short branch distance to verify that it still fit into imm8.
246 int _short_branch_delta;
247
248 int short_branch_delta() const { return _short_branch_delta; }
249 void set_short_branch_delta() { _short_branch_delta = 32; }
250 void clear_short_branch_delta() { _short_branch_delta = 0; }
251
252 class ShortBranchVerifier: public StackObj {
253 private:
254 AbstractAssembler* _assm;
255
256 public:
257 ShortBranchVerifier(AbstractAssembler* assm) : _assm(assm) {
258 assert(assm->short_branch_delta() == 0, "overlapping instructions");
259 _assm->set_short_branch_delta();
260 }
261 ~ShortBranchVerifier() {
262 _assm->clear_short_branch_delta();
263 }
264 };
265 #else
266 // Dummy in product.
267 class ShortBranchVerifier: public StackObj {
268 public:
269 ShortBranchVerifier(AbstractAssembler* assm) {}
270 };
244 #endif 271 #endif
245 272
246 // Label functions 273 // Label functions
247 void print(Label& L); 274 void print(Label& L);
248 275

mercurial