hotspot/src/share/vm/asm/assembler.hpp
changeset 11434 c50976508b6b
parent 11190 d561d41f241a
child 13391 30245956af37
equal deleted inserted replaced
11433:2a2e375199de 11434:c50976508b6b
   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