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

Unified Diff: src/compiler/js-builtin-reducer.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/effect-control-linearizer.cc ('k') | src/compiler/js-typed-lowering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-builtin-reducer.cc
diff --git a/src/compiler/js-builtin-reducer.cc b/src/compiler/js-builtin-reducer.cc
index e3bafadaef0ef1304680fa9553d4617000e3a57c..66c212dfcb71a3d3f45ba6411736558a378fb6e7 100644
--- a/src/compiler/js-builtin-reducer.cc
+++ b/src/compiler/js-builtin-reducer.cc
@@ -1513,14 +1513,10 @@ Reduction JSBuiltinReducer::ReduceNumberIsInteger(Node* node) {
// ES6 section 20.1.2.4 Number.isNaN ( number )
Reduction JSBuiltinReducer::ReduceNumberIsNaN(Node* node) {
JSCallReduction r(node);
- if (r.InputsMatchOne(Type::Number())) {
- // Number.isNaN(a:number) -> BooleanNot(NumberEqual(a, a))
- Node* input = r.GetJSCallInput(0);
- Node* check = graph()->NewNode(simplified()->NumberEqual(), input, input);
- Node* value = graph()->NewNode(simplified()->BooleanNot(), check);
- return Replace(value);
- }
- return NoChange();
+ // Number.isNaN(a:number) -> ObjectIsNaN(a)
+ Node* input = r.GetJSCallInput(0);
+ Node* value = graph()->NewNode(simplified()->ObjectIsNaN(), input);
+ return Replace(value);
}
// ES6 section 20.1.2.5 Number.isSafeInteger ( number )
« no previous file with comments | « src/compiler/effect-control-linearizer.cc ('k') | src/compiler/js-typed-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698