| Index: src/arm/codegen-arm.cc
|
| ===================================================================
|
| --- src/arm/codegen-arm.cc (revision 4288)
|
| +++ src/arm/codegen-arm.cc (working copy)
|
| @@ -3996,14 +3996,7 @@
|
| }
|
|
|
|
|
| -void CodeGenerator::VisitBinaryOperation(BinaryOperation* node) {
|
| -#ifdef DEBUG
|
| - int original_height = frame_->height();
|
| -#endif
|
| - VirtualFrame::SpilledScope spilled_scope;
|
| - Comment cmnt(masm_, "[ BinaryOperation");
|
| - Token::Value op = node->op();
|
| -
|
| +void CodeGenerator::GenerateLogicalBooleanOperation(BinaryOperation* node) {
|
| // According to ECMA-262 section 11.11, page 58, the binary logical
|
| // operators must yield the result of one of the two expressions
|
| // before any ToBoolean() conversions. This means that the value
|
| @@ -4015,8 +4008,7 @@
|
| // after evaluating the left hand side (due to the shortcut
|
| // semantics), but the compiler must (statically) know if the result
|
| // of compiling the binary operation is materialized or not.
|
| -
|
| - if (op == Token::AND) {
|
| + if (node->op() == Token::AND) {
|
| JumpTarget is_true;
|
| LoadConditionAndSpill(node->left(),
|
| &is_true,
|
| @@ -4062,7 +4054,8 @@
|
| ASSERT(!has_valid_frame() && !has_cc() && !is_true.is_linked());
|
| }
|
|
|
| - } else if (op == Token::OR) {
|
| + } else {
|
| + ASSERT(node->op() == Token::OR);
|
| JumpTarget is_false;
|
| LoadConditionAndSpill(node->left(),
|
| true_target(),
|
| @@ -4107,7 +4100,19 @@
|
| // Nothing to do.
|
| ASSERT(!has_valid_frame() && !has_cc() && !is_false.is_linked());
|
| }
|
| + }
|
| +}
|
|
|
| +
|
| +void CodeGenerator::VisitBinaryOperation(BinaryOperation* node) {
|
| +#ifdef DEBUG
|
| + int original_height = frame_->height();
|
| +#endif
|
| + VirtualFrame::SpilledScope spilled_scope;
|
| + Comment cmnt(masm_, "[ BinaryOperation");
|
| +
|
| + if (node->op() == Token::AND || node->op() == Token::OR) {
|
| + GenerateLogicalBooleanOperation(node);
|
| } else {
|
| // Optimize for the case where (at least) one of the expressions
|
| // is a literal small integer.
|
|
|