| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 #include "arm/lithium-gap-resolver-arm.h" | 30 #include "arm/lithium-gap-resolver-arm.h" |
| 31 #include "arm/lithium-codegen-arm.h" | 31 #include "arm/lithium-codegen-arm.h" |
| 32 | 32 |
| 33 namespace v8 { | 33 namespace v8 { |
| 34 namespace internal { | 34 namespace internal { |
| 35 | 35 |
| 36 static const Register kSavedValueRegister = { 9 }; | 36 static const Register kSavedValueRegister = { 9 }; |
| 37 | 37 |
| 38 LGapResolver::LGapResolver(LCodeGen* owner) | 38 LGapResolver::LGapResolver(LCodeGen* owner) |
| 39 : cgen_(owner), moves_(32), root_index_(0), in_cycle_(false), | 39 : cgen_(owner), moves_(32, owner->zone()), root_index_(0), in_cycle_(false), |
| 40 saved_destination_(NULL) { } | 40 saved_destination_(NULL) { } |
| 41 | 41 |
| 42 | 42 |
| 43 void LGapResolver::Resolve(LParallelMove* parallel_move) { | 43 void LGapResolver::Resolve(LParallelMove* parallel_move) { |
| 44 ASSERT(moves_.is_empty()); | 44 ASSERT(moves_.is_empty()); |
| 45 // Build up a worklist of moves. | 45 // Build up a worklist of moves. |
| 46 BuildInitialMoveList(parallel_move); | 46 BuildInitialMoveList(parallel_move); |
| 47 | 47 |
| 48 for (int i = 0; i < moves_.length(); ++i) { | 48 for (int i = 0; i < moves_.length(); ++i) { |
| 49 LMoveOperands move = moves_[i]; | 49 LMoveOperands move = moves_[i]; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 72 | 72 |
| 73 | 73 |
| 74 void LGapResolver::BuildInitialMoveList(LParallelMove* parallel_move) { | 74 void LGapResolver::BuildInitialMoveList(LParallelMove* parallel_move) { |
| 75 // Perform a linear sweep of the moves to add them to the initial list of | 75 // Perform a linear sweep of the moves to add them to the initial list of |
| 76 // moves to perform, ignoring any move that is redundant (the source is | 76 // moves to perform, ignoring any move that is redundant (the source is |
| 77 // the same as the destination, the destination is ignored and | 77 // the same as the destination, the destination is ignored and |
| 78 // unallocated, or the move was already eliminated). | 78 // unallocated, or the move was already eliminated). |
| 79 const ZoneList<LMoveOperands>* moves = parallel_move->move_operands(); | 79 const ZoneList<LMoveOperands>* moves = parallel_move->move_operands(); |
| 80 for (int i = 0; i < moves->length(); ++i) { | 80 for (int i = 0; i < moves->length(); ++i) { |
| 81 LMoveOperands move = moves->at(i); | 81 LMoveOperands move = moves->at(i); |
| 82 if (!move.IsRedundant()) moves_.Add(move); | 82 if (!move.IsRedundant()) moves_.Add(move, cgen_->zone()); |
| 83 } | 83 } |
| 84 Verify(); | 84 Verify(); |
| 85 } | 85 } |
| 86 | 86 |
| 87 | 87 |
| 88 void LGapResolver::PerformMove(int index) { | 88 void LGapResolver::PerformMove(int index) { |
| 89 // Each call to this function performs a move and deletes it from the move | 89 // Each call to this function performs a move and deletes it from the move |
| 90 // graph. We first recursively perform any move blocking this one. We | 90 // graph. We first recursively perform any move blocking this one. We |
| 91 // mark a move as "pending" on entry to PerformMove in order to detect | 91 // mark a move as "pending" on entry to PerformMove in order to detect |
| 92 // cycles in the move graph. | 92 // cycles in the move graph. |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 UNREACHABLE(); | 302 UNREACHABLE(); |
| 303 } | 303 } |
| 304 | 304 |
| 305 moves_[index].Eliminate(); | 305 moves_[index].Eliminate(); |
| 306 } | 306 } |
| 307 | 307 |
| 308 | 308 |
| 309 #undef __ | 309 #undef __ |
| 310 | 310 |
| 311 } } // namespace v8::internal | 311 } } // namespace v8::internal |
| OLD | NEW |