1.1 --- a/src/share/vm/c1/c1_Instruction.hpp Wed Oct 13 15:38:14 2010 -0700 1.2 +++ b/src/share/vm/c1/c1_Instruction.hpp Fri Oct 15 09:38:20 2010 +0200 1.3 @@ -443,7 +443,7 @@ 1.4 1.5 // generic 1.6 virtual Instruction* as_Instruction() { return this; } // to satisfy HASHING1 macro 1.7 - virtual Phi* as_Phi() { return NULL; } 1.8 + virtual Phi* as_Phi() { return NULL; } 1.9 virtual Local* as_Local() { return NULL; } 1.10 virtual Constant* as_Constant() { return NULL; } 1.11 virtual AccessField* as_AccessField() { return NULL; } 1.12 @@ -650,8 +650,24 @@ 1.13 virtual intx hash() const; 1.14 virtual bool is_equal(Value v) const; 1.15 1.16 - virtual BlockBegin* compare(Instruction::Condition condition, Value right, 1.17 - BlockBegin* true_sux, BlockBegin* false_sux); 1.18 + 1.19 + enum CompareResult { not_comparable = -1, cond_false, cond_true }; 1.20 + 1.21 + virtual CompareResult compare(Instruction::Condition condition, Value right) const; 1.22 + BlockBegin* compare(Instruction::Condition cond, Value right, 1.23 + BlockBegin* true_sux, BlockBegin* false_sux) const { 1.24 + switch (compare(cond, right)) { 1.25 + case not_comparable: 1.26 + return NULL; 1.27 + case cond_false: 1.28 + return false_sux; 1.29 + case cond_true: 1.30 + return true_sux; 1.31 + default: 1.32 + ShouldNotReachHere(); 1.33 + return NULL; 1.34 + } 1.35 + } 1.36 }; 1.37 1.38