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/move-optimizer.h" | 5 #include "src/compiler/move-optimizer.h" |
6 | 6 |
7 namespace v8 { | 7 namespace v8 { |
8 namespace internal { | 8 namespace internal { |
9 namespace compiler { | 9 namespace compiler { |
10 | 10 |
(...skipping 24 matching lines...) Expand all Loading... |
35 if (moves == nullptr) continue; | 35 if (moves == nullptr) continue; |
36 for (auto move : *moves) { | 36 for (auto move : *moves) { |
37 if (!move->IsRedundant()) return i; | 37 if (!move->IsRedundant()) return i; |
38 move->Eliminate(); | 38 move->Eliminate(); |
39 } | 39 } |
40 moves->clear(); // Clear this redundant move. | 40 moves->clear(); // Clear this redundant move. |
41 } | 41 } |
42 return i; | 42 return i; |
43 } | 43 } |
44 | 44 |
45 } // namepace | 45 } // namespace |
46 | 46 |
47 | 47 |
48 MoveOptimizer::MoveOptimizer(Zone* local_zone, InstructionSequence* code) | 48 MoveOptimizer::MoveOptimizer(Zone* local_zone, InstructionSequence* code) |
49 : local_zone_(local_zone), | 49 : local_zone_(local_zone), |
50 code_(code), | 50 code_(code), |
51 to_finalize_(local_zone), | 51 to_finalize_(local_zone), |
52 temp_vector_0_(local_zone), | 52 temp_vector_0_(local_zone), |
53 temp_vector_1_(local_zone) {} | 53 temp_vector_1_(local_zone) {} |
54 | 54 |
55 | 55 |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 static_cast<Instruction::GapPosition>(1), code_zone()); | 276 static_cast<Instruction::GapPosition>(1), code_zone()); |
277 slot_1->AddMove(group_begin->destination(), load->destination()); | 277 slot_1->AddMove(group_begin->destination(), load->destination()); |
278 load->Eliminate(); | 278 load->Eliminate(); |
279 } | 279 } |
280 loads.clear(); | 280 loads.clear(); |
281 } | 281 } |
282 | 282 |
283 } // namespace compiler | 283 } // namespace compiler |
284 } // namespace internal | 284 } // namespace internal |
285 } // namespace v8 | 285 } // namespace v8 |
OLD | NEW |