hotspot/src/share/vm/c1/c1_Instruction.hpp
changeset 7100 6bcf9255d470
parent 6751 b399fd234e47
child 7397 5b173b4ca846
equal deleted inserted replaced
6778:e1b7673b2435 7100:6bcf9255d470
   441   void set_operand(LIR_Opr operand)              { assert(operand != LIR_OprFact::illegalOpr, "operand must exist"); _operand = operand; }
   441   void set_operand(LIR_Opr operand)              { assert(operand != LIR_OprFact::illegalOpr, "operand must exist"); _operand = operand; }
   442   void clear_operand()                           { _operand = LIR_OprFact::illegalOpr; }
   442   void clear_operand()                           { _operand = LIR_OprFact::illegalOpr; }
   443 
   443 
   444   // generic
   444   // generic
   445   virtual Instruction*      as_Instruction()     { return this; } // to satisfy HASHING1 macro
   445   virtual Instruction*      as_Instruction()     { return this; } // to satisfy HASHING1 macro
   446   virtual Phi*           as_Phi()          { return NULL; }
   446   virtual Phi*              as_Phi()             { return NULL; }
   447   virtual Local*            as_Local()           { return NULL; }
   447   virtual Local*            as_Local()           { return NULL; }
   448   virtual Constant*         as_Constant()        { return NULL; }
   448   virtual Constant*         as_Constant()        { return NULL; }
   449   virtual AccessField*      as_AccessField()     { return NULL; }
   449   virtual AccessField*      as_AccessField()     { return NULL; }
   450   virtual LoadField*        as_LoadField()       { return NULL; }
   450   virtual LoadField*        as_LoadField()       { return NULL; }
   451   virtual StoreField*       as_StoreField()      { return NULL; }
   451   virtual StoreField*       as_StoreField()      { return NULL; }
   648   virtual void input_values_do(ValueVisitor* f)   { /* no values */ }
   648   virtual void input_values_do(ValueVisitor* f)   { /* no values */ }
   649 
   649 
   650   virtual intx hash() const;
   650   virtual intx hash() const;
   651   virtual bool is_equal(Value v) const;
   651   virtual bool is_equal(Value v) const;
   652 
   652 
   653   virtual BlockBegin* compare(Instruction::Condition condition, Value right,
   653 
   654                               BlockBegin* true_sux, BlockBegin* false_sux);
   654   enum CompareResult { not_comparable = -1, cond_false, cond_true };
       
   655 
       
   656   virtual CompareResult compare(Instruction::Condition condition, Value right) const;
       
   657   BlockBegin* compare(Instruction::Condition cond, Value right,
       
   658                       BlockBegin* true_sux, BlockBegin* false_sux) const {
       
   659     switch (compare(cond, right)) {
       
   660     case not_comparable:
       
   661       return NULL;
       
   662     case cond_false:
       
   663       return false_sux;
       
   664     case cond_true:
       
   665       return true_sux;
       
   666     default:
       
   667       ShouldNotReachHere();
       
   668       return NULL;
       
   669     }
       
   670   }
   655 };
   671 };
   656 
   672 
   657 
   673 
   658 BASE(AccessField, Instruction)
   674 BASE(AccessField, Instruction)
   659  private:
   675  private: