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

Side by Side Diff: test/unittests/compiler/js-typed-lowering-unittest.cc

Issue 852763002: [turbofan] Use PlainPrimitiveToNumber whenever possible. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 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
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/access-builder.h" 5 #include "src/compiler/access-builder.h"
6 #include "src/compiler/js-graph.h" 6 #include "src/compiler/js-graph.h"
7 #include "src/compiler/js-operator.h" 7 #include "src/compiler/js-operator.h"
8 #include "src/compiler/js-typed-lowering.h" 8 #include "src/compiler/js-typed-lowering.h"
9 #include "src/compiler/machine-operator.h" 9 #include "src/compiler/machine-operator.h"
10 #include "src/compiler/node-properties-inl.h" 10 #include "src/compiler/node-properties-inl.h"
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 365
366 366
367 TEST_F(JSTypedLoweringTest, JSToNumberWithPlainPrimitive) { 367 TEST_F(JSTypedLoweringTest, JSToNumberWithPlainPrimitive) {
368 Node* const input = Parameter(Type::PlainPrimitive(), 0); 368 Node* const input = Parameter(Type::PlainPrimitive(), 0);
369 Node* const context = Parameter(Type::Any(), 1); 369 Node* const context = Parameter(Type::Any(), 1);
370 Node* const effect = graph()->start(); 370 Node* const effect = graph()->start();
371 Node* const control = graph()->start(); 371 Node* const control = graph()->start();
372 Reduction r = Reduce(graph()->NewNode(javascript()->ToNumber(), input, 372 Reduction r = Reduce(graph()->NewNode(javascript()->ToNumber(), input,
373 context, effect, control)); 373 context, effect, control));
374 ASSERT_TRUE(r.Changed()); 374 ASSERT_TRUE(r.Changed());
375 EXPECT_THAT(r.replacement(), IsToNumber(input, IsNumberConstant(BitEq(0.0)), 375 EXPECT_THAT(r.replacement(), IsPlainPrimitiveToNumber(input));
376 graph()->start(), control));
377 } 376 }
378 377
379 378
380 // ----------------------------------------------------------------------------- 379 // -----------------------------------------------------------------------------
381 // JSStrictEqual 380 // JSStrictEqual
382 381
383 382
384 TEST_F(JSTypedLoweringTest, JSStrictEqualWithTheHole) { 383 TEST_F(JSTypedLoweringTest, JSStrictEqualWithTheHole) {
385 Node* const the_hole = HeapConstant(factory()->the_hole_value()); 384 Node* const the_hole = HeapConstant(factory()->the_hole_value());
386 Node* const context = UndefinedConstant(); 385 Node* const context = UndefinedConstant();
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 IsStoreElement( 798 IsStoreElement(
800 access, IsIntPtrConstant(bit_cast<intptr_t>(&backing_store[0])), 799 access, IsIntPtrConstant(bit_cast<intptr_t>(&backing_store[0])),
801 key, value, effect, control)); 800 key, value, effect, control));
802 } 801 }
803 } 802 }
804 } 803 }
805 804
806 } // namespace compiler 805 } // namespace compiler
807 } // namespace internal 806 } // namespace internal
808 } // namespace v8 807 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/compiler/test-js-typed-lowering.cc ('k') | test/unittests/compiler/node-test-utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698