| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 19 matching lines...) Expand all Loading... |
| 30 #if defined(V8_TARGET_ARCH_IA32) | 30 #if defined(V8_TARGET_ARCH_IA32) |
| 31 | 31 |
| 32 #include "ia32/lithium-gap-resolver-ia32.h" | 32 #include "ia32/lithium-gap-resolver-ia32.h" |
| 33 #include "ia32/lithium-codegen-ia32.h" | 33 #include "ia32/lithium-codegen-ia32.h" |
| 34 | 34 |
| 35 namespace v8 { | 35 namespace v8 { |
| 36 namespace internal { | 36 namespace internal { |
| 37 | 37 |
| 38 LGapResolver::LGapResolver(LCodeGen* owner) | 38 LGapResolver::LGapResolver(LCodeGen* owner) |
| 39 : cgen_(owner), | 39 : cgen_(owner), |
| 40 moves_(32), | 40 moves_(32, owner->zone()), |
| 41 source_uses_(), | 41 source_uses_(), |
| 42 destination_uses_(), | 42 destination_uses_(), |
| 43 spilled_register_(-1) {} | 43 spilled_register_(-1) {} |
| 44 | 44 |
| 45 | 45 |
| 46 void LGapResolver::Resolve(LParallelMove* parallel_move) { | 46 void LGapResolver::Resolve(LParallelMove* parallel_move) { |
| 47 ASSERT(HasBeenReset()); | 47 ASSERT(HasBeenReset()); |
| 48 // Build up a worklist of moves. | 48 // Build up a worklist of moves. |
| 49 BuildInitialMoveList(parallel_move); | 49 BuildInitialMoveList(parallel_move); |
| 50 | 50 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 } | 150 } |
| 151 | 151 |
| 152 | 152 |
| 153 void LGapResolver::AddMove(LMoveOperands move) { | 153 void LGapResolver::AddMove(LMoveOperands move) { |
| 154 LOperand* source = move.source(); | 154 LOperand* source = move.source(); |
| 155 if (source->IsRegister()) ++source_uses_[source->index()]; | 155 if (source->IsRegister()) ++source_uses_[source->index()]; |
| 156 | 156 |
| 157 LOperand* destination = move.destination(); | 157 LOperand* destination = move.destination(); |
| 158 if (destination->IsRegister()) ++destination_uses_[destination->index()]; | 158 if (destination->IsRegister()) ++destination_uses_[destination->index()]; |
| 159 | 159 |
| 160 moves_.Add(move); | 160 moves_.Add(move, cgen_->zone()); |
| 161 } | 161 } |
| 162 | 162 |
| 163 | 163 |
| 164 void LGapResolver::RemoveMove(int index) { | 164 void LGapResolver::RemoveMove(int index) { |
| 165 LOperand* source = moves_[index].source(); | 165 LOperand* source = moves_[index].source(); |
| 166 if (source->IsRegister()) { | 166 if (source->IsRegister()) { |
| 167 --source_uses_[source->index()]; | 167 --source_uses_[source->index()]; |
| 168 ASSERT(source_uses_[source->index()] >= 0); | 168 ASSERT(source_uses_[source->index()] >= 0); |
| 169 } | 169 } |
| 170 | 170 |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 } else if (destination->IsRegister()) { | 481 } else if (destination->IsRegister()) { |
| 482 source_uses_[destination->index()] = CountSourceUses(destination); | 482 source_uses_[destination->index()] = CountSourceUses(destination); |
| 483 } | 483 } |
| 484 } | 484 } |
| 485 | 485 |
| 486 #undef __ | 486 #undef __ |
| 487 | 487 |
| 488 } } // namespace v8::internal | 488 } } // namespace v8::internal |
| 489 | 489 |
| 490 #endif // V8_TARGET_ARCH_IA32 | 490 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |