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/instruction.h" | 5 #include "src/compiler/instruction.h" |
6 #include "src/compiler/instruction-codes.h" | 6 #include "src/compiler/instruction-codes.h" |
7 #include "src/compiler/jump-threading.h" | 7 #include "src/compiler/jump-threading.h" |
8 #include "test/cctest/cctest.h" | 8 #include "test/cctest/cctest.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 sequence_.InstructionAt(index) | 101 sequence_.InstructionAt(index) |
102 ->GetOrCreateParallelMove(Instruction::START, main_zone()) | 102 ->GetOrCreateParallelMove(Instruction::START, main_zone()) |
103 ->AddMove(from, to); | 103 ->AddMove(from, to); |
104 } | 104 } |
105 }; | 105 }; |
106 | 106 |
107 | 107 |
108 void VerifyForwarding(TestCode& code, int count, int* expected) { | 108 void VerifyForwarding(TestCode& code, int count, int* expected) { |
109 Zone local_zone; | 109 Zone local_zone; |
110 ZoneVector<RpoNumber> result(&local_zone); | 110 ZoneVector<RpoNumber> result(&local_zone); |
111 JumpThreading::ComputeForwarding(&local_zone, result, &code.sequence_); | 111 JumpThreading::ComputeForwarding(&local_zone, result, &code.sequence_, true); |
112 | 112 |
113 CHECK(count == static_cast<int>(result.size())); | 113 CHECK(count == static_cast<int>(result.size())); |
114 for (int i = 0; i < count; i++) { | 114 for (int i = 0; i < count; i++) { |
115 CHECK(expected[i] == result[i].ToInt()); | 115 CHECK(expected[i] == result[i].ToInt()); |
116 } | 116 } |
117 } | 117 } |
118 | 118 |
119 | 119 |
120 TEST(FwEmpty1) { | 120 TEST(FwEmpty1) { |
121 TestCode code; | 121 TestCode code; |
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
759 for (int k = 4; k < 5; k++) assembly[k]--; | 759 for (int k = 4; k < 5; k++) assembly[k]--; |
760 } | 760 } |
761 CheckAssemblyOrder(code, 5, assembly); | 761 CheckAssemblyOrder(code, 5, assembly); |
762 } | 762 } |
763 } | 763 } |
764 } | 764 } |
765 | 765 |
766 } // namespace compiler | 766 } // namespace compiler |
767 } // namespace internal | 767 } // namespace internal |
768 } // namespace v8 | 768 } // namespace v8 |
OLD | NEW |