| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 BreakCycle(index); | 146 BreakCycle(index); |
| 147 return; | 147 return; |
| 148 } | 148 } |
| 149 | 149 |
| 150 // This move is no longer blocked. | 150 // This move is no longer blocked. |
| 151 EmitMove(index); | 151 EmitMove(index); |
| 152 } | 152 } |
| 153 | 153 |
| 154 | 154 |
| 155 void LGapResolver::Verify() { | 155 void LGapResolver::Verify() { |
| 156 TODO_UNIMPLEMENTED("LGapResolver::Verify"); | 156 #ifdef ENABLE_SLOW_ASSERTS |
| 157 // No operand should be the destination for more than one move. |
| 158 for (int i = 0; i < moves_.length(); ++i) { |
| 159 LOperand* destination = moves_[i].destination(); |
| 160 for (int j = i + 1; j < moves_.length(); ++j) { |
| 161 SLOW_ASSERT(!destination->Equals(moves_[j].destination())); |
| 162 } |
| 163 } |
| 164 #endif |
| 157 } | 165 } |
| 158 | 166 |
| 159 | 167 |
| 160 void LGapResolver::BreakCycle(int index) { | 168 void LGapResolver::BreakCycle(int index) { |
| 161 ASSERT(moves_[index].destination()->Equals(moves_[root_index_].source())); | 169 ASSERT(moves_[index].destination()->Equals(moves_[root_index_].source())); |
| 162 ASSERT(!in_cycle_); | 170 ASSERT(!in_cycle_); |
| 163 | 171 |
| 164 // We use a register which is not allocatable by crankshaft to break the cycle | 172 // We use a register which is not allocatable by crankshaft to break the cycle |
| 165 // to be sure it doesn't interfere with the moves we are resolving. | 173 // to be sure it doesn't interfere with the moves we are resolving. |
| 166 ASSERT(!kSavedValue.IsAllocatable()); | 174 ASSERT(!kSavedValue.IsAllocatable()); |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 LOperand* src = moves_[index].source(); | 317 LOperand* src = moves_[index].source(); |
| 310 LOperand* dst = moves_[index].destination(); | 318 LOperand* dst = moves_[index].destination(); |
| 311 | 319 |
| 312 ASSERT(src->IsStackSlot()); | 320 ASSERT(src->IsStackSlot()); |
| 313 ASSERT(dst->IsStackSlot()); | 321 ASSERT(dst->IsStackSlot()); |
| 314 __ Ldr(temp, cgen_->ToMemOperand(src)); | 322 __ Ldr(temp, cgen_->ToMemOperand(src)); |
| 315 __ Str(temp, cgen_->ToMemOperand(dst)); | 323 __ Str(temp, cgen_->ToMemOperand(dst)); |
| 316 } | 324 } |
| 317 | 325 |
| 318 } } // namespace v8::internal | 326 } } // namespace v8::internal |
| OLD | NEW |