diff --git a/src/hydrogen.cc b/src/hydrogen.cc index c2b9adc0df..c109133c8f 100644 --- a/src/hydrogen.cc +++ b/src/hydrogen.cc @@ -5093,10 +5093,13 @@ void HGraphBuilder::VisitBinaryOperation(BinaryOperation* expr) { ASSERT(current_block() != NULL); ASSERT(current_block()->HasPredecessor()); switch (expr->op()) { - case Token::COMMA: return VisitComma(expr); - case Token::OR: return VisitAndOr(expr, false); - case Token::AND: return VisitAndOr(expr, true); - default: return VisitCommon(expr); + case Token::COMMA: + return VisitComma(expr); + case Token::OR: + case Token::AND: + return VisitLogicalExpression(expr); + default: + return VisitArithmeticExpression(expr); } } @@ -5109,7 +5112,8 @@ void HGraphBuilder::VisitComma(BinaryOperation* expr) { } -void HGraphBuilder::VisitAndOr(BinaryOperation* expr, bool is_logical_and) { +void HGraphBuilder::VisitLogicalExpression(BinaryOperation* expr) { + bool is_logical_and = expr->op() == Token::AND; if (ast_context()->IsTest()) { TestContext* context = TestContext::cast(ast_context()); // Translate left subexpression. @@ -5196,7 +5200,7 @@ void HGraphBuilder::VisitAndOr(BinaryOperation* expr, bool is_logical_and) { } -void HGraphBuilder::VisitCommon(BinaryOperation* expr) { +void HGraphBuilder::VisitArithmeticExpression(BinaryOperation* expr) { CHECK_ALIVE(VisitForValue(expr->left())); CHECK_ALIVE(VisitForValue(expr->right())); HValue* right = Pop(); diff --git a/src/hydrogen.h b/src/hydrogen.h index e07afbce5a..603480130b 100644 --- a/src/hydrogen.h +++ b/src/hydrogen.h @@ -753,8 +753,8 @@ class HGraphBuilder: public AstVisitor { void VisitNot(UnaryOperation* expr); void VisitComma(BinaryOperation* expr); - void VisitAndOr(BinaryOperation* expr, bool is_logical_and); - void VisitCommon(BinaryOperation* expr); + void VisitLogicalExpression(BinaryOperation* expr); + void VisitArithmeticExpression(BinaryOperation* expr); void PreProcessOsrEntry(IterationStatement* statement); // True iff. we are compiling for OSR and the statement is the entry.