Mercurial > hg > truffle
comparison src/share/vm/c1/c1_Instruction.hpp @ 1899:42a10fc37986
6991577: add IfOp optimization to C1
Summary: Ifop optimization for c1
Reviewed-by: never, phh, iveresov
author | roland |
---|---|
date | Fri, 15 Oct 2010 09:38:20 +0200 |
parents | 80c9354976b0 |
children | f95d63e2154a |
comparison
equal
deleted
inserted
replaced
1852:94d77a279225 | 1899:42a10fc37986 |
---|---|
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: |