| Index: src/hydrogen-instructions.h
|
| diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
|
| index c09f261c2e1772e7bfe6548c01f0c5946a4eb8f2..c0cc9cfaf6181344199c2a3685631800299fd2ce 100644
|
| --- a/src/hydrogen-instructions.h
|
| +++ b/src/hydrogen-instructions.h
|
| @@ -3394,13 +3394,21 @@ class HBinaryOperation: public HTemplateInstruction<3> {
|
|
|
| // TODO(kasperl): Move these helpers to the IA-32 Lithium
|
| // instruction sequence builder.
|
| - HValue* LeastConstantOperand() {
|
| - if (IsCommutative() && left()->IsConstant()) return right();
|
| + HValue* BetterCandidateForRegisterOperand() {
|
| + if (IsCommutative()) {
|
| + if (left()->IsConstant()) return right();
|
| + if (right()->IsConstant()) return left();
|
| + if (right()->UseCount() == 1) return right();
|
| + }
|
| return left();
|
| }
|
|
|
| - HValue* MostConstantOperand() {
|
| - if (IsCommutative() && left()->IsConstant()) return left();
|
| + HValue* WorseCandidateForRegisterOperand() {
|
| + if (IsCommutative()) {
|
| + if (left()->IsConstant()) return left();
|
| + if (right()->IsConstant()) return right();
|
| + if (right()->UseCount() == 1) return left();
|
| + }
|
| return right();
|
| }
|
|
|
|
|