| OLD | NEW |
| 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/code-factory.h" | 5 #include "src/code-factory.h" |
| 6 #include "src/compiler/access-builder.h" | 6 #include "src/compiler/access-builder.h" |
| 7 #include "src/compiler/js-graph.h" | 7 #include "src/compiler/js-graph.h" |
| 8 #include "src/compiler/js-operator.h" | 8 #include "src/compiler/js-operator.h" |
| 9 #include "src/compiler/js-typed-lowering.h" | 9 #include "src/compiler/js-typed-lowering.h" |
| 10 #include "src/compiler/machine-operator.h" | 10 #include "src/compiler/machine-operator.h" |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 | 377 |
| 378 // ----------------------------------------------------------------------------- | 378 // ----------------------------------------------------------------------------- |
| 379 // JSStrictEqual | 379 // JSStrictEqual |
| 380 | 380 |
| 381 | 381 |
| 382 TEST_F(JSTypedLoweringTest, JSStrictEqualWithTheHole) { | 382 TEST_F(JSTypedLoweringTest, JSStrictEqualWithTheHole) { |
| 383 Node* const the_hole = HeapConstant(factory()->the_hole_value()); | 383 Node* const the_hole = HeapConstant(factory()->the_hole_value()); |
| 384 Node* const context = UndefinedConstant(); | 384 Node* const context = UndefinedConstant(); |
| 385 TRACED_FOREACH(Type*, type, kJSTypes) { | 385 TRACED_FOREACH(Type*, type, kJSTypes) { |
| 386 Node* const lhs = Parameter(type); | 386 Node* const lhs = Parameter(type); |
| 387 Reduction r = Reduce( | 387 Reduction r = Reduce(graph()->NewNode( |
| 388 graph()->NewNode(javascript()->StrictEqual(), lhs, the_hole, context)); | 388 javascript()->StrictEqual(CompareOperationHints::Any()), lhs, the_hole, |
| 389 context)); |
| 389 ASSERT_TRUE(r.Changed()); | 390 ASSERT_TRUE(r.Changed()); |
| 390 EXPECT_THAT(r.replacement(), IsFalseConstant()); | 391 EXPECT_THAT(r.replacement(), IsFalseConstant()); |
| 391 } | 392 } |
| 392 } | 393 } |
| 393 | 394 |
| 394 | 395 |
| 395 TEST_F(JSTypedLoweringTest, JSStrictEqualWithUnique) { | 396 TEST_F(JSTypedLoweringTest, JSStrictEqualWithUnique) { |
| 396 Node* const lhs = Parameter(Type::Unique(), 0); | 397 Node* const lhs = Parameter(Type::Unique(), 0); |
| 397 Node* const rhs = Parameter(Type::Unique(), 1); | 398 Node* const rhs = Parameter(Type::Unique(), 1); |
| 398 Node* const context = Parameter(Type::Any(), 2); | 399 Node* const context = Parameter(Type::Any(), 2); |
| 399 Reduction r = | 400 Reduction r = Reduce( |
| 400 Reduce(graph()->NewNode(javascript()->StrictEqual(), lhs, rhs, context)); | 401 graph()->NewNode(javascript()->StrictEqual(CompareOperationHints::Any()), |
| 402 lhs, rhs, context)); |
| 401 ASSERT_TRUE(r.Changed()); | 403 ASSERT_TRUE(r.Changed()); |
| 402 EXPECT_THAT(r.replacement(), IsReferenceEqual(Type::Unique(), lhs, rhs)); | 404 EXPECT_THAT(r.replacement(), IsReferenceEqual(Type::Unique(), lhs, rhs)); |
| 403 } | 405 } |
| 404 | 406 |
| 405 | 407 |
| 406 // ----------------------------------------------------------------------------- | 408 // ----------------------------------------------------------------------------- |
| 407 // JSShiftLeft | 409 // JSShiftLeft |
| 408 | 410 |
| 409 | 411 |
| 410 TEST_F(JSTypedLoweringTest, JSShiftLeftWithSigned32AndConstant) { | 412 TEST_F(JSTypedLoweringTest, JSShiftLeftWithSigned32AndConstant) { |
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 945 Node* dummy = graph()->NewNode(javascript()->ToObject(), instanceOf, context, | 947 Node* dummy = graph()->NewNode(javascript()->ToObject(), instanceOf, context, |
| 946 frame_state, effect, control); | 948 frame_state, effect, control); |
| 947 Reduction r = Reduce(instanceOf); | 949 Reduction r = Reduce(instanceOf); |
| 948 ASSERT_FALSE(r.Changed()); | 950 ASSERT_FALSE(r.Changed()); |
| 949 ASSERT_EQ(instanceOf, dummy->InputAt(0)); | 951 ASSERT_EQ(instanceOf, dummy->InputAt(0)); |
| 950 } | 952 } |
| 951 | 953 |
| 952 } // namespace compiler | 954 } // namespace compiler |
| 953 } // namespace internal | 955 } // namespace internal |
| 954 } // namespace v8 | 956 } // namespace v8 |
| OLD | NEW |