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

Unified Diff: src/crankshaft/hydrogen-instructions.h

Issue 2048643002: [crankshaft] Fix invalid number truncation assumption on HAdd inputs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Refine the flag handling to not introduce deopt loops. Created 4 years, 6 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/regress-5074.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/hydrogen-instructions.h
diff --git a/src/crankshaft/hydrogen-instructions.h b/src/crankshaft/hydrogen-instructions.h
index 514882145f25caffde2ab63445e74542c8c66e6a..b10e3ab819c6fed211ddf983c4415285ebe9872b 100644
--- a/src/crankshaft/hydrogen-instructions.h
+++ b/src/crankshaft/hydrogen-instructions.h
@@ -4370,6 +4370,11 @@ class HAdd final : public HArithmeticBinaryOperation {
SetChangesFlag(kNewSpacePromotion);
ClearFlag(kAllowUndefinedAsNaN);
}
+ if (!right()->type().IsTaggedNumber() &&
+ !right()->representation().IsDouble() &&
+ !right()->representation().IsSmiOrInteger32()) {
+ ClearFlag(kAllowUndefinedAsNaN);
+ }
}
Representation RepresentationFromInputs() override;
« no previous file with comments | « no previous file | test/mjsunit/compiler/regress-5074.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698