hotspot/src/share/vm/c1/c1_LIRGenerator.hpp
changeset 1374 4c24294029a9
parent 1 489c9b5090e2
child 5547 f4b087cbb361
equal deleted inserted replaced
615:570062d730b2 1374:4c24294029a9
   143 };
   143 };
   144 
   144 
   145 
   145 
   146 // only the classes below belong in the same file
   146 // only the classes below belong in the same file
   147 class LIRGenerator: public InstructionVisitor, public BlockClosure {
   147 class LIRGenerator: public InstructionVisitor, public BlockClosure {
       
   148 
   148  private:
   149  private:
   149   Compilation*  _compilation;
   150   Compilation*  _compilation;
   150   ciMethod*     _method;    // method that we are compiling
   151   ciMethod*     _method;    // method that we are compiling
   151   PhiResolverState  _resolver_state;
   152   PhiResolverState  _resolver_state;
   152   BlockBegin*   _block;
   153   BlockBegin*   _block;
   153   int           _virtual_register_number;
   154   int           _virtual_register_number;
   154   Values        _instruction_for_operand;
   155   Values        _instruction_for_operand;
   155   BitMap2D      _vreg_flags; // flags which can be set on a per-vreg basis
   156   BitMap2D      _vreg_flags; // flags which can be set on a per-vreg basis
   156   LIR_List*     _lir;
   157   LIR_List*     _lir;
       
   158   BarrierSet*   _bs;
   157 
   159 
   158   LIRGenerator* gen() {
   160   LIRGenerator* gen() {
   159     return this;
   161     return this;
   160   }
   162   }
   161 
   163 
   171 
   173 
   172   // a simple cache of constants used within a block
   174   // a simple cache of constants used within a block
   173   GrowableArray<LIR_Const*>       _constants;
   175   GrowableArray<LIR_Const*>       _constants;
   174   LIR_OprList                     _reg_for_constants;
   176   LIR_OprList                     _reg_for_constants;
   175   Values                          _unpinned_constants;
   177   Values                          _unpinned_constants;
   176 
       
   177   LIR_Const*                      _card_table_base;
       
   178 
   178 
   179   friend class PhiResolver;
   179   friend class PhiResolver;
   180 
   180 
   181   // unified bailout support
   181   // unified bailout support
   182   void bailout(const char* msg) const            { compilation()->bailout(msg); }
   182   void bailout(const char* msg) const            { compilation()->bailout(msg); }
   193   LIR_Opr rlock_callee_saved(BasicType type);
   193   LIR_Opr rlock_callee_saved(BasicType type);
   194 
   194 
   195   // get a constant into a register and get track of what register was used
   195   // get a constant into a register and get track of what register was used
   196   LIR_Opr load_constant(Constant* x);
   196   LIR_Opr load_constant(Constant* x);
   197   LIR_Opr load_constant(LIR_Const* constant);
   197   LIR_Opr load_constant(LIR_Const* constant);
   198 
       
   199   LIR_Const* card_table_base() const { return _card_table_base; }
       
   200 
   198 
   201   void  set_result(Value x, LIR_Opr opr)           {
   199   void  set_result(Value x, LIR_Opr opr)           {
   202     assert(opr->is_valid(), "must set to valid value");
   200     assert(opr->is_valid(), "must set to valid value");
   203     assert(x->operand()->is_illegal(), "operand should never change");
   201     assert(x->operand()->is_illegal(), "operand should never change");
   204     assert(!opr->is_register() || opr->is_virtual(), "should never set result to a physical register");
   202     assert(!opr->is_register() || opr->is_virtual(), "should never set result to a physical register");
   251 
   249 
   252   // GC Barriers
   250   // GC Barriers
   253 
   251 
   254   // generic interface
   252   // generic interface
   255 
   253 
       
   254   void pre_barrier(LIR_Opr addr_opr, bool patch,  CodeEmitInfo* info);
   256   void post_barrier(LIR_OprDesc* addr, LIR_OprDesc* new_val);
   255   void post_barrier(LIR_OprDesc* addr, LIR_OprDesc* new_val);
   257 
   256 
   258   // specific implementations
   257   // specific implementations
       
   258   // pre barriers
       
   259 
       
   260   void G1SATBCardTableModRef_pre_barrier(LIR_Opr addr_opr, bool patch,  CodeEmitInfo* info);
   259 
   261 
   260   // post barriers
   262   // post barriers
   261 
   263 
       
   264   void G1SATBCardTableModRef_post_barrier(LIR_OprDesc* addr, LIR_OprDesc* new_val);
   262   void CardTableModRef_post_barrier(LIR_OprDesc* addr, LIR_OprDesc* new_val);
   265   void CardTableModRef_post_barrier(LIR_OprDesc* addr, LIR_OprDesc* new_val);
   263 
   266 
   264 
   267 
   265   static LIR_Opr result_register_for(ValueType* type, bool callee = false);
   268   static LIR_Opr result_register_for(ValueType* type, bool callee = false);
   266 
   269