Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(444)

Unified Diff: src/hydrogen.cc

Issue 1071473003: Fix maybe_string_add for adds that have no type feedback where --always-opt is on. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Merge status file. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/compiler/generic-add.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « no previous file | test/mjsunit/compiler/generic-add.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698