Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index 6cb2b240a95b61103609b49d4f2532282985591d..41d54865969a05e7a46f02e7f01bd17d82534084 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -4519,7 +4519,7 @@ void HGraphBuilder::VisitUnaryOperation(UnaryOperation* expr) { |
VisitForEffect(expr->expression()); |
} |
- } else if (op == Token::BIT_NOT || op == Token::SUB) { |
+ } else { |
VISIT_FOR_VALUE(expr->expression()); |
HValue* value = Pop(); |
HInstruction* instr = NULL; |
@@ -4528,19 +4528,19 @@ void HGraphBuilder::VisitUnaryOperation(UnaryOperation* expr) { |
instr = new HBitNot(value); |
break; |
case Token::SUB: |
- instr = new HMul(graph_->GetConstantMinus1(), value); |
+ instr = new HMul(value, graph_->GetConstantMinus1()); |
+ break; |
+ case Token::ADD: |
+ instr = new HMul(value, graph_->GetConstant1()); |
+ break; |
+ case Token::TYPEOF: |
+ instr = new HTypeof(value); |
break; |
default: |
- UNREACHABLE(); |
+ BAILOUT("Value: unsupported unary operation"); |
break; |
} |
ast_context()->ReturnInstruction(instr, expr->id()); |
- } else if (op == Token::TYPEOF) { |
- VISIT_FOR_VALUE(expr->expression()); |
- HValue* value = Pop(); |
- ast_context()->ReturnInstruction(new HTypeof(value), expr->id()); |
- } else { |
- BAILOUT("Value: unsupported unary operation"); |
} |
} |