| 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/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.h" | 10 #include "src/compiler/node-properties.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 TEST_F(JSTypedLoweringTest, JSUnaryNotWithBoolean) { | 112 TEST_F(JSTypedLoweringTest, JSUnaryNotWithBoolean) { |
| 113 Node* input = Parameter(Type::Boolean(), 0); | 113 Node* input = Parameter(Type::Boolean(), 0); |
| 114 Node* context = Parameter(Type::Any(), 1); | 114 Node* context = Parameter(Type::Any(), 1); |
| 115 Reduction r = | 115 Reduction r = |
| 116 Reduce(graph()->NewNode(javascript()->UnaryNot(), input, context)); | 116 Reduce(graph()->NewNode(javascript()->UnaryNot(), input, context)); |
| 117 ASSERT_TRUE(r.Changed()); | 117 ASSERT_TRUE(r.Changed()); |
| 118 EXPECT_THAT(r.replacement(), IsBooleanNot(input)); | 118 EXPECT_THAT(r.replacement(), IsBooleanNot(input)); |
| 119 } | 119 } |
| 120 | 120 |
| 121 | 121 |
| 122 TEST_F(JSTypedLoweringTest, JSUnaryNotWithOrderedNumber) { |
| 123 Node* input = Parameter(Type::OrderedNumber(), 0); |
| 124 Node* context = Parameter(Type::Any(), 1); |
| 125 Reduction r = |
| 126 Reduce(graph()->NewNode(javascript()->UnaryNot(), input, context)); |
| 127 ASSERT_TRUE(r.Changed()); |
| 128 EXPECT_THAT(r.replacement(), IsNumberEqual(input, IsNumberConstant(0))); |
| 129 } |
| 130 |
| 131 |
| 122 TEST_F(JSTypedLoweringTest, JSUnaryNotWithFalsish) { | 132 TEST_F(JSTypedLoweringTest, JSUnaryNotWithFalsish) { |
| 123 Node* input = Parameter( | 133 Node* input = Parameter( |
| 124 Type::Union( | 134 Type::Union( |
| 125 Type::MinusZero(), | 135 Type::MinusZero(), |
| 126 Type::Union( | 136 Type::Union( |
| 127 Type::NaN(), | 137 Type::NaN(), |
| 128 Type::Union( | 138 Type::Union( |
| 129 Type::Null(), | 139 Type::Null(), |
| 130 Type::Union( | 140 Type::Union( |
| 131 Type::Undefined(), | 141 Type::Undefined(), |
| (...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 797 IsStoreElement( | 807 IsStoreElement( |
| 798 access, IsIntPtrConstant(bit_cast<intptr_t>(&backing_store[0])), | 808 access, IsIntPtrConstant(bit_cast<intptr_t>(&backing_store[0])), |
| 799 key, value, effect, control)); | 809 key, value, effect, control)); |
| 800 } | 810 } |
| 801 } | 811 } |
| 802 } | 812 } |
| 803 | 813 |
| 804 } // namespace compiler | 814 } // namespace compiler |
| 805 } // namespace internal | 815 } // namespace internal |
| 806 } // namespace v8 | 816 } // namespace v8 |
| OLD | NEW |