src/share/vm/asm/assembler.hpp

changeset 3395
40c2484c09e1
parent 3310
6729bbc1fcd6
child 3969
1d7922586cf6
     1.1 --- a/src/share/vm/asm/assembler.hpp	Fri Dec 23 09:36:23 2011 +0100
     1.2 +++ b/src/share/vm/asm/assembler.hpp	Fri Dec 23 15:24:36 2011 -0800
     1.3 @@ -241,6 +241,33 @@
     1.4    // Make it return true on platforms which need to verify
     1.5    // instruction boundaries for some operations.
     1.6    inline static bool pd_check_instruction_mark();
     1.7 +
     1.8 +  // Add delta to short branch distance to verify that it still fit into imm8.
     1.9 +  int _short_branch_delta;
    1.10 +
    1.11 +  int  short_branch_delta() const { return _short_branch_delta; }
    1.12 +  void set_short_branch_delta()   { _short_branch_delta = 32; }
    1.13 +  void clear_short_branch_delta() { _short_branch_delta = 0; }
    1.14 +
    1.15 +  class ShortBranchVerifier: public StackObj {
    1.16 +   private:
    1.17 +    AbstractAssembler* _assm;
    1.18 +
    1.19 +   public:
    1.20 +    ShortBranchVerifier(AbstractAssembler* assm) : _assm(assm) {
    1.21 +      assert(assm->short_branch_delta() == 0, "overlapping instructions");
    1.22 +      _assm->set_short_branch_delta();
    1.23 +    }
    1.24 +    ~ShortBranchVerifier() {
    1.25 +      _assm->clear_short_branch_delta();
    1.26 +    }
    1.27 +  };
    1.28 +  #else
    1.29 +  // Dummy in product.
    1.30 +  class ShortBranchVerifier: public StackObj {
    1.31 +   public:
    1.32 +    ShortBranchVerifier(AbstractAssembler* assm) {}
    1.33 +  };
    1.34    #endif
    1.35  
    1.36    // Label functions

mercurial