comparison src/share/vm/asm/assembler.hpp @ 4766:40c2484c09e1

7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM Summary: Distance is too large for one short branch in string_indexofC8(). Reviewed-by: iveresov
author kvn
date Fri, 23 Dec 2011 15:24:36 -0800
parents 6729bbc1fcd6
children 1d7922586cf6
comparison
equal deleted inserted replaced
4765:b642b49f9738 4766: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