| 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 ASSERT(moves_[index].destination()->Equals(moves_[root_index_].source())); | 164 ASSERT(moves_[index].destination()->Equals(moves_[root_index_].source())); |
| 165 ASSERT(!in_cycle_); | 165 ASSERT(!in_cycle_); |
| 166 in_cycle_ = true; | 166 in_cycle_ = true; |
| 167 LOperand* source = moves_[index].source(); | 167 LOperand* source = moves_[index].source(); |
| 168 saved_destination_ = moves_[index].destination(); | 168 saved_destination_ = moves_[index].destination(); |
| 169 if (source->IsRegister()) { | 169 if (source->IsRegister()) { |
| 170 __ mov(kSavedValueRegister, cgen_->ToRegister(source)); | 170 __ mov(kSavedValueRegister, cgen_->ToRegister(source)); |
| 171 } else if (source->IsStackSlot()) { | 171 } else if (source->IsStackSlot()) { |
| 172 __ ldr(kSavedValueRegister, cgen_->ToMemOperand(source)); | 172 __ ldr(kSavedValueRegister, cgen_->ToMemOperand(source)); |
| 173 } else if (source->IsDoubleRegister()) { | 173 } else if (source->IsDoubleRegister()) { |
| 174 __ vmov(kScratchDoubleReg, cgen_->ToDoubleRegister(source)); | 174 __ vmov(DwVfpRegister::ScratchReg(), cgen_->ToDoubleRegister(source)); |
| 175 } else if (source->IsDoubleStackSlot()) { | 175 } else if (source->IsDoubleStackSlot()) { |
| 176 __ vldr(kScratchDoubleReg, cgen_->ToMemOperand(source)); | 176 __ vldr(DwVfpRegister::ScratchReg(), cgen_->ToMemOperand(source)); |
| 177 } else { | 177 } else { |
| 178 UNREACHABLE(); | 178 UNREACHABLE(); |
| 179 } | 179 } |
| 180 // This move will be done by restoring the saved value to the destination. | 180 // This move will be done by restoring the saved value to the destination. |
| 181 moves_[index].Eliminate(); | 181 moves_[index].Eliminate(); |
| 182 } | 182 } |
| 183 | 183 |
| 184 | 184 |
| 185 void LGapResolver::RestoreValue() { | 185 void LGapResolver::RestoreValue() { |
| 186 ASSERT(in_cycle_); | 186 ASSERT(in_cycle_); |
| 187 ASSERT(saved_destination_ != NULL); | 187 ASSERT(saved_destination_ != NULL); |
| 188 | 188 |
| 189 // Spilled value is in kSavedValueRegister or kSavedDoubleValueRegister. | 189 // Spilled value is in kSavedValueRegister or kSavedDoubleValueRegister. |
| 190 if (saved_destination_->IsRegister()) { | 190 if (saved_destination_->IsRegister()) { |
| 191 __ mov(cgen_->ToRegister(saved_destination_), kSavedValueRegister); | 191 __ mov(cgen_->ToRegister(saved_destination_), kSavedValueRegister); |
| 192 } else if (saved_destination_->IsStackSlot()) { | 192 } else if (saved_destination_->IsStackSlot()) { |
| 193 __ str(kSavedValueRegister, cgen_->ToMemOperand(saved_destination_)); | 193 __ str(kSavedValueRegister, cgen_->ToMemOperand(saved_destination_)); |
| 194 } else if (saved_destination_->IsDoubleRegister()) { | 194 } else if (saved_destination_->IsDoubleRegister()) { |
| 195 __ vmov(cgen_->ToDoubleRegister(saved_destination_), kScratchDoubleReg); | 195 __ vmov(cgen_->ToDoubleRegister(saved_destination_), DwVfpRegister::ScratchR
eg()); |
| 196 } else if (saved_destination_->IsDoubleStackSlot()) { | 196 } else if (saved_destination_->IsDoubleStackSlot()) { |
| 197 __ vstr(kScratchDoubleReg, cgen_->ToMemOperand(saved_destination_)); | 197 __ vstr(DwVfpRegister::ScratchReg(), cgen_->ToMemOperand(saved_destination_)
); |
| 198 } else { | 198 } else { |
| 199 UNREACHABLE(); | 199 UNREACHABLE(); |
| 200 } | 200 } |
| 201 | 201 |
| 202 in_cycle_ = false; | 202 in_cycle_ = false; |
| 203 saved_destination_ = NULL; | 203 saved_destination_ = NULL; |
| 204 } | 204 } |
| 205 | 205 |
| 206 | 206 |
| 207 void LGapResolver::EmitMove(int index) { | 207 void LGapResolver::EmitMove(int index) { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 225 if (destination->IsRegister()) { | 225 if (destination->IsRegister()) { |
| 226 __ ldr(cgen_->ToRegister(destination), source_operand); | 226 __ ldr(cgen_->ToRegister(destination), source_operand); |
| 227 } else { | 227 } else { |
| 228 ASSERT(destination->IsStackSlot()); | 228 ASSERT(destination->IsStackSlot()); |
| 229 MemOperand destination_operand = cgen_->ToMemOperand(destination); | 229 MemOperand destination_operand = cgen_->ToMemOperand(destination); |
| 230 if (in_cycle_) { | 230 if (in_cycle_) { |
| 231 if (!destination_operand.OffsetIsUint12Encodable()) { | 231 if (!destination_operand.OffsetIsUint12Encodable()) { |
| 232 // ip is overwritten while saving the value to the destination. | 232 // ip is overwritten while saving the value to the destination. |
| 233 // Therefore we can't use ip. It is OK if the read from the source | 233 // Therefore we can't use ip. It is OK if the read from the source |
| 234 // destroys ip, since that happens before the value is read. | 234 // destroys ip, since that happens before the value is read. |
| 235 __ vldr(kScratchDoubleReg.low(), source_operand); | 235 __ vldr(DwVfpRegister::ScratchReg().low(), source_operand); |
| 236 __ vstr(kScratchDoubleReg.low(), destination_operand); | 236 __ vstr(DwVfpRegister::ScratchReg().low(), destination_operand); |
| 237 } else { | 237 } else { |
| 238 __ ldr(ip, source_operand); | 238 __ ldr(ip, source_operand); |
| 239 __ str(ip, destination_operand); | 239 __ str(ip, destination_operand); |
| 240 } | 240 } |
| 241 } else { | 241 } else { |
| 242 __ ldr(kSavedValueRegister, source_operand); | 242 __ ldr(kSavedValueRegister, source_operand); |
| 243 __ str(kSavedValueRegister, destination_operand); | 243 __ str(kSavedValueRegister, destination_operand); |
| 244 } | 244 } |
| 245 } | 245 } |
| 246 | 246 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 // but kSavedValueRegister is free. | 287 // but kSavedValueRegister is free. |
| 288 MemOperand source_high_operand = | 288 MemOperand source_high_operand = |
| 289 cgen_->ToHighMemOperand(source); | 289 cgen_->ToHighMemOperand(source); |
| 290 MemOperand destination_high_operand = | 290 MemOperand destination_high_operand = |
| 291 cgen_->ToHighMemOperand(destination); | 291 cgen_->ToHighMemOperand(destination); |
| 292 __ ldr(kSavedValueRegister, source_operand); | 292 __ ldr(kSavedValueRegister, source_operand); |
| 293 __ str(kSavedValueRegister, destination_operand); | 293 __ str(kSavedValueRegister, destination_operand); |
| 294 __ ldr(kSavedValueRegister, source_high_operand); | 294 __ ldr(kSavedValueRegister, source_high_operand); |
| 295 __ str(kSavedValueRegister, destination_high_operand); | 295 __ str(kSavedValueRegister, destination_high_operand); |
| 296 } else { | 296 } else { |
| 297 __ vldr(kScratchDoubleReg, source_operand); | 297 __ vldr(DwVfpRegister::ScratchReg(), source_operand); |
| 298 __ vstr(kScratchDoubleReg, destination_operand); | 298 __ vstr(DwVfpRegister::ScratchReg(), destination_operand); |
| 299 } | 299 } |
| 300 } | 300 } |
| 301 } else { | 301 } else { |
| 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 |