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

Side by Side Diff: test/unittests/compiler/js-builtin-reducer-unittest.cc

Issue 2722483003: [turbofan] Introduce dedicated ObjectIsNaN operator. (Closed)
Patch Set: Use GetUpperBound. Add test cases. Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « test/mjsunit/number-isnan-opt.js ('k') | test/unittests/compiler/node-test-utils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/js-builtin-reducer.h" 5 #include "src/compiler/js-builtin-reducer.h"
6 #include "src/compiler/js-graph.h" 6 #include "src/compiler/js-graph.h"
7 #include "src/compiler/node-properties.h" 7 #include "src/compiler/node-properties.h"
8 #include "src/compiler/simplified-operator.h" 8 #include "src/compiler/simplified-operator.h"
9 #include "src/compiler/typer.h" 9 #include "src/compiler/typer.h"
10 #include "src/isolate-inl.h" 10 #include "src/isolate-inl.h"
(...skipping 1457 matching lines...) Expand 10 before | Expand all | Expand 10 after
1468 Node* context = UndefinedConstant(); 1468 Node* context = UndefinedConstant();
1469 Node* frame_state = graph()->start(); 1469 Node* frame_state = graph()->start();
1470 TRACED_FOREACH(Type*, t0, kNumberTypes) { 1470 TRACED_FOREACH(Type*, t0, kNumberTypes) {
1471 Node* p0 = Parameter(t0, 0); 1471 Node* p0 = Parameter(t0, 0);
1472 Node* call = 1472 Node* call =
1473 graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(), 1473 graph()->NewNode(javascript()->Call(3), function, UndefinedConstant(),
1474 p0, context, frame_state, effect, control); 1474 p0, context, frame_state, effect, control);
1475 Reduction r = Reduce(call); 1475 Reduction r = Reduce(call);
1476 1476
1477 ASSERT_TRUE(r.Changed()); 1477 ASSERT_TRUE(r.Changed());
1478 EXPECT_THAT(r.replacement(), IsBooleanNot(IsNumberEqual(p0, p0))); 1478 EXPECT_THAT(r.replacement(), IsObjectIsNaN(p0));
1479 } 1479 }
1480 } 1480 }
1481 1481
1482 // ----------------------------------------------------------------------------- 1482 // -----------------------------------------------------------------------------
1483 // Number.isSafeInteger 1483 // Number.isSafeInteger
1484 1484
1485 TEST_F(JSBuiltinReducerTest, NumberIsSafeIntegerWithIntegral32) { 1485 TEST_F(JSBuiltinReducerTest, NumberIsSafeIntegerWithIntegral32) {
1486 Node* function = NumberFunction("isSafeInteger"); 1486 Node* function = NumberFunction("isSafeInteger");
1487 1487
1488 Node* effect = graph()->start(); 1488 Node* effect = graph()->start();
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
1579 Reduction r = Reduce(call); 1579 Reduction r = Reduce(call);
1580 1580
1581 ASSERT_TRUE(r.Changed()); 1581 ASSERT_TRUE(r.Changed());
1582 EXPECT_THAT(r.replacement(), 1582 EXPECT_THAT(r.replacement(),
1583 IsStringFromCharCode(IsPlainPrimitiveToNumber(p0))); 1583 IsStringFromCharCode(IsPlainPrimitiveToNumber(p0)));
1584 } 1584 }
1585 1585
1586 } // namespace compiler 1586 } // namespace compiler
1587 } // namespace internal 1587 } // namespace internal
1588 } // namespace v8 1588 } // namespace v8
OLDNEW
« no previous file with comments | « test/mjsunit/number-isnan-opt.js ('k') | test/unittests/compiler/node-test-utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698