Index: src/compiler/js-builtin-reducer.cc |
diff --git a/src/compiler/js-builtin-reducer.cc b/src/compiler/js-builtin-reducer.cc |
index 66c212dfcb71a3d3f45ba6411736558a378fb6e7..40aaef91f9b5ace09b21913ae398b18cc0428753 100644 |
--- a/src/compiler/js-builtin-reducer.cc |
+++ b/src/compiler/js-builtin-reducer.cc |
@@ -1513,6 +1513,11 @@ Reduction JSBuiltinReducer::ReduceNumberIsInteger(Node* node) { |
// ES6 section 20.1.2.4 Number.isNaN ( number ) |
Reduction JSBuiltinReducer::ReduceNumberIsNaN(Node* node) { |
JSCallReduction r(node); |
+ if (r.InputsMatchZero()) { |
+ // Number.isNaN() -> #false |
+ Node* value = jsgraph()->FalseConstant(); |
+ return Replace(value); |
+ } |
// Number.isNaN(a:number) -> ObjectIsNaN(a) |
Node* input = r.GetJSCallInput(0); |
Node* value = graph()->NewNode(simplified()->ObjectIsNaN(), input); |