| 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 17 matching lines...) Expand all Loading... |
| 28 #include "v8.h" | 28 #include "v8.h" |
| 29 | 29 |
| 30 #include "mips/lithium-gap-resolver-mips.h" | 30 #include "mips/lithium-gap-resolver-mips.h" |
| 31 #include "mips/lithium-codegen-mips.h" | 31 #include "mips/lithium-codegen-mips.h" |
| 32 | 32 |
| 33 namespace v8 { | 33 namespace v8 { |
| 34 namespace internal { | 34 namespace internal { |
| 35 | 35 |
| 36 LGapResolver::LGapResolver(LCodeGen* owner) | 36 LGapResolver::LGapResolver(LCodeGen* owner) |
| 37 : cgen_(owner), | 37 : cgen_(owner), |
| 38 moves_(32), | 38 moves_(32, owner->zone()), |
| 39 root_index_(0), | 39 root_index_(0), |
| 40 in_cycle_(false), | 40 in_cycle_(false), |
| 41 saved_destination_(NULL) {} | 41 saved_destination_(NULL) {} |
| 42 | 42 |
| 43 | 43 |
| 44 void LGapResolver::Resolve(LParallelMove* parallel_move) { | 44 void LGapResolver::Resolve(LParallelMove* parallel_move) { |
| 45 ASSERT(moves_.is_empty()); | 45 ASSERT(moves_.is_empty()); |
| 46 // Build up a worklist of moves. | 46 // Build up a worklist of moves. |
| 47 BuildInitialMoveList(parallel_move); | 47 BuildInitialMoveList(parallel_move); |
| 48 | 48 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 73 | 73 |
| 74 | 74 |
| 75 void LGapResolver::BuildInitialMoveList(LParallelMove* parallel_move) { | 75 void LGapResolver::BuildInitialMoveList(LParallelMove* parallel_move) { |
| 76 // Perform a linear sweep of the moves to add them to the initial list of | 76 // Perform a linear sweep of the moves to add them to the initial list of |
| 77 // moves to perform, ignoring any move that is redundant (the source is | 77 // moves to perform, ignoring any move that is redundant (the source is |
| 78 // the same as the destination, the destination is ignored and | 78 // the same as the destination, the destination is ignored and |
| 79 // unallocated, or the move was already eliminated). | 79 // unallocated, or the move was already eliminated). |
| 80 const ZoneList<LMoveOperands>* moves = parallel_move->move_operands(); | 80 const ZoneList<LMoveOperands>* moves = parallel_move->move_operands(); |
| 81 for (int i = 0; i < moves->length(); ++i) { | 81 for (int i = 0; i < moves->length(); ++i) { |
| 82 LMoveOperands move = moves->at(i); | 82 LMoveOperands move = moves->at(i); |
| 83 if (!move.IsRedundant()) moves_.Add(move); | 83 if (!move.IsRedundant()) moves_.Add(move, cgen_->zone()); |
| 84 } | 84 } |
| 85 Verify(); | 85 Verify(); |
| 86 } | 86 } |
| 87 | 87 |
| 88 | 88 |
| 89 void LGapResolver::PerformMove(int index) { | 89 void LGapResolver::PerformMove(int index) { |
| 90 // Each call to this function performs a move and deletes it from the move | 90 // Each call to this function performs a move and deletes it from the move |
| 91 // graph. We first recursively perform any move blocking this one. We | 91 // graph. We first recursively perform any move blocking this one. We |
| 92 // mark a move as "pending" on entry to PerformMove in order to detect | 92 // mark a move as "pending" on entry to PerformMove in order to detect |
| 93 // cycles in the move graph. | 93 // cycles in the move graph. |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 UNREACHABLE(); | 307 UNREACHABLE(); |
| 308 } | 308 } |
| 309 | 309 |
| 310 moves_[index].Eliminate(); | 310 moves_[index].Eliminate(); |
| 311 } | 311 } |
| 312 | 312 |
| 313 | 313 |
| 314 #undef __ | 314 #undef __ |
| 315 | 315 |
| 316 } } // namespace v8::internal | 316 } } // namespace v8::internal |
| OLD | NEW |