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 |