OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/int64-lowering.h" | 5 #include "src/compiler/int64-lowering.h" |
6 #include "src/compiler/common-operator.h" | 6 #include "src/compiler/common-operator.h" |
7 #include "src/compiler/linkage.h" | 7 #include "src/compiler/linkage.h" |
8 #include "src/compiler/machine-operator.h" | 8 #include "src/compiler/machine-operator.h" |
9 #include "src/compiler/node.h" | 9 #include "src/compiler/node.h" |
10 | 10 |
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
868 Node* store = | 868 Node* store = |
869 graph()->NewNode(machine()->Store(store_rep), Int64Constant(value(0)), | 869 graph()->NewNode(machine()->Store(store_rep), Int64Constant(value(0)), |
870 Int64Constant(value(1)), load, load, graph()->start()); | 870 Int64Constant(value(1)), load, load, graph()->start()); |
871 | 871 |
872 eff_phi->InsertInput(zone(), 1, store); | 872 eff_phi->InsertInput(zone(), 1, store); |
873 NodeProperties::ChangeOp(eff_phi, | 873 NodeProperties::ChangeOp(eff_phi, |
874 common()->ResizeMergeOrPhi(eff_phi->op(), 2)); | 874 common()->ResizeMergeOrPhi(eff_phi->op(), 2)); |
875 | 875 |
876 LowerGraph(load, MachineRepresentation::kWord64); | 876 LowerGraph(load, MachineRepresentation::kWord64); |
877 } | 877 } |
| 878 |
| 879 TEST_F(Int64LoweringTest, LoopCycle) { |
| 880 // New node with two placeholders. |
| 881 Node* compare = graph()->NewNode(machine()->Word64Equal(), Int64Constant(0), |
| 882 Int64Constant(value(0))); |
| 883 |
| 884 Node* load = graph()->NewNode( |
| 885 machine()->Load(MachineType::Int64()), Int64Constant(value(1)), |
| 886 Int64Constant(value(2)), graph()->start(), |
| 887 graph()->NewNode( |
| 888 common()->Loop(2), graph()->start(), |
| 889 graph()->NewNode(common()->IfFalse(), |
| 890 graph()->NewNode(common()->Branch(), compare, |
| 891 graph()->start())))); |
| 892 |
| 893 NodeProperties::ReplaceValueInput(compare, load, 0); |
| 894 |
| 895 LowerGraph(load, MachineRepresentation::kWord64); |
| 896 } |
878 } // namespace compiler | 897 } // namespace compiler |
879 } // namespace internal | 898 } // namespace internal |
880 } // namespace v8 | 899 } // namespace v8 |
OLD | NEW |