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

Unified Diff: src/compiler/js-typed-lowering.cc

Issue 2722483003: [turbofan] Introduce dedicated ObjectIsNaN operator. (Closed)
Patch Set: Use GetUpperBound. Add test cases. Created 3 years, 10 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 | « src/compiler/js-builtin-reducer.cc ('k') | src/compiler/opcodes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-typed-lowering.cc
diff --git a/src/compiler/js-typed-lowering.cc b/src/compiler/js-typed-lowering.cc
index e857edeeb825dcf64d506ba520e86572a7738bd4..6578a7e07b47c9872d1985207012358eb1d2e889 100644
--- a/src/compiler/js-typed-lowering.cc
+++ b/src/compiler/js-typed-lowering.cc
@@ -993,11 +993,12 @@ Reduction JSTypedLowering::ReduceJSStrictEqual(Node* node, bool invert) {
JSBinopReduction r(this, node);
if (r.left() == r.right()) {
// x === x is always true if x != NaN
- if (!r.left_type()->Maybe(Type::NaN())) {
- Node* replacement = jsgraph()->BooleanConstant(!invert);
- ReplaceWithValue(node, replacement);
- return Replace(replacement);
+ Node* replacement = graph()->NewNode(simplified()->ObjectIsNaN(), r.left());
+ if (!invert) {
+ replacement = graph()->NewNode(simplified()->BooleanNot(), replacement);
}
+ ReplaceWithValue(node, replacement);
+ return Replace(replacement);
}
if (r.OneInputCannotBe(Type::NumberOrString())) {
// For values with canonical representation (i.e. neither String, nor
« no previous file with comments | « src/compiler/js-builtin-reducer.cc ('k') | src/compiler/opcodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698