Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index 3acf0e99c2b43c59e8a554a795346068055ed549..d6cbc1444ad52eac67ab0f98ecd35f3a8e3943ae 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -10398,12 +10398,9 @@ HValue* HGraphBuilder::BuildBinaryOperation( |
Add<HDeoptimize>( |
Deoptimizer::kInsufficientTypeFeedbackForLHSOfBinaryOperation, |
Deoptimizer::SOFT); |
- // TODO(rossberg): we should be able to get rid of non-continuous |
- // defaults. |
left_type = Type::Any(zone()); |
- } else { |
- if (!maybe_string_add) left = TruncateToNumber(left, &left_type); |
left_rep = Representation::FromType(left_type); |
+ maybe_string_add = op == Token::ADD; |
} |
if (!right_type->IsInhabited()) { |
@@ -10411,9 +10408,13 @@ HValue* HGraphBuilder::BuildBinaryOperation( |
Deoptimizer::kInsufficientTypeFeedbackForRHSOfBinaryOperation, |
Deoptimizer::SOFT); |
right_type = Type::Any(zone()); |
- } else { |
- if (!maybe_string_add) right = TruncateToNumber(right, &right_type); |
right_rep = Representation::FromType(right_type); |
+ maybe_string_add = op == Token::ADD; |
+ } |
+ |
+ if (!maybe_string_add) { |
+ left = TruncateToNumber(left, &left_type); |
+ right = TruncateToNumber(right, &right_type); |
} |
// Special case for string addition here. |