| 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/change-lowering.h" | 5 #include "src/compiler/change-lowering.h" |
| 6 #include "src/compiler/compiler-test-utils.h" | 6 #include "src/compiler/compiler-test-utils.h" |
| 7 #include "src/compiler/graph-unittest.h" | 7 #include "src/compiler/graph-unittest.h" |
| 8 #include "src/compiler/js-graph.h" | 8 #include "src/compiler/js-graph.h" |
| 9 #include "src/compiler/node-properties-inl.h" | 9 #include "src/compiler/node-properties-inl.h" |
| 10 #include "src/compiler/simplified-operator.h" | 10 #include "src/compiler/simplified-operator.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 | 123 |
| 124 TARGET_TEST_P(ChangeLoweringCommonTest, ChangeBitToBool) { | 124 TARGET_TEST_P(ChangeLoweringCommonTest, ChangeBitToBool) { |
| 125 Node* val = Parameter(0); | 125 Node* val = Parameter(0); |
| 126 Node* node = graph()->NewNode(simplified()->ChangeBitToBool(), val); | 126 Node* node = graph()->NewNode(simplified()->ChangeBitToBool(), val); |
| 127 Reduction reduction = Reduce(node); | 127 Reduction reduction = Reduce(node); |
| 128 ASSERT_TRUE(reduction.Changed()); | 128 ASSERT_TRUE(reduction.Changed()); |
| 129 | 129 |
| 130 Node* phi = reduction.replacement(); | 130 Node* phi = reduction.replacement(); |
| 131 Capture<Node*> branch; | 131 Capture<Node*> branch; |
| 132 EXPECT_THAT(phi, | 132 EXPECT_THAT(phi, |
| 133 IsPhi(kMachAnyTagged, IsTrueConstant(), IsFalseConstant(), | 133 IsPhi(static_cast<MachineType>(kTypeBool | kRepTagged), |
| 134 IsTrueConstant(), IsFalseConstant(), |
| 134 IsMerge(IsIfTrue(AllOf(CaptureEq(&branch), | 135 IsMerge(IsIfTrue(AllOf(CaptureEq(&branch), |
| 135 IsBranch(val, graph()->start()))), | 136 IsBranch(val, graph()->start()))), |
| 136 IsIfFalse(CaptureEq(&branch))))); | 137 IsIfFalse(CaptureEq(&branch))))); |
| 137 } | 138 } |
| 138 | 139 |
| 139 | 140 |
| 140 TARGET_TEST_P(ChangeLoweringCommonTest, ChangeBoolToBit) { | 141 TARGET_TEST_P(ChangeLoweringCommonTest, ChangeBoolToBit) { |
| 141 Node* val = Parameter(0); | 142 Node* val = Parameter(0); |
| 142 Node* node = graph()->NewNode(simplified()->ChangeBoolToBit(), val); | 143 Node* node = graph()->NewNode(simplified()->ChangeBoolToBit(), val); |
| 143 Reduction reduction = Reduce(node); | 144 Reduction reduction = Reduce(node); |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 IsIfTrue(AllOf(CaptureEq(&branch), | 466 IsIfTrue(AllOf(CaptureEq(&branch), |
| 466 IsBranch(IsUint32LessThanOrEqual( | 467 IsBranch(IsUint32LessThanOrEqual( |
| 467 val, IsInt32Constant(SmiMaxValue())), | 468 val, IsInt32Constant(SmiMaxValue())), |
| 468 graph()->start()))), | 469 graph()->start()))), |
| 469 AllOf(CaptureEq(&if_false), IsIfFalse(CaptureEq(&branch)))))); | 470 AllOf(CaptureEq(&if_false), IsIfFalse(CaptureEq(&branch)))))); |
| 470 } | 471 } |
| 471 | 472 |
| 472 } // namespace compiler | 473 } // namespace compiler |
| 473 } // namespace internal | 474 } // namespace internal |
| 474 } // namespace v8 | 475 } // namespace v8 |
| OLD | NEW |