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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 const InstructionOperand& to) { | 100 const InstructionOperand& to) { |
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 v8::internal::AccountingAllocator allocator; | 109 v8::internal::AccountingAllocator allocator; |
110 Zone local_zone(&allocator); | 110 Zone local_zone(&allocator, ZONE_NAME); |
111 ZoneVector<RpoNumber> result(&local_zone); | 111 ZoneVector<RpoNumber> result(&local_zone); |
112 JumpThreading::ComputeForwarding(&local_zone, result, &code.sequence_, true); | 112 JumpThreading::ComputeForwarding(&local_zone, result, &code.sequence_, true); |
113 | 113 |
114 CHECK(count == static_cast<int>(result.size())); | 114 CHECK(count == static_cast<int>(result.size())); |
115 for (int i = 0; i < count; i++) { | 115 for (int i = 0; i < count; i++) { |
116 CHECK(expected[i] == result[i].ToInt()); | 116 CHECK(expected[i] == result[i].ToInt()); |
117 } | 117 } |
118 } | 118 } |
119 | 119 |
120 | 120 |
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 for (int k = 4; k < 5; k++) assembly[k]--; | 760 for (int k = 4; k < 5; k++) assembly[k]--; |
761 } | 761 } |
762 CheckAssemblyOrder(code, 5, assembly); | 762 CheckAssemblyOrder(code, 5, assembly); |
763 } | 763 } |
764 } | 764 } |
765 } | 765 } |
766 | 766 |
767 } // namespace compiler | 767 } // namespace compiler |
768 } // namespace internal | 768 } // namespace internal |
769 } // namespace v8 | 769 } // namespace v8 |
OLD | NEW |