| 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 CpuFeatures::Scope scope(VFP2); | 174 CpuFeatureScope scope(cgen_->masm(), VFP2); |
| 175 __ vmov(kScratchDoubleReg, cgen_->ToDoubleRegister(source)); | 175 __ vmov(kScratchDoubleReg, cgen_->ToDoubleRegister(source)); |
| 176 } else if (source->IsDoubleStackSlot()) { | 176 } else if (source->IsDoubleStackSlot()) { |
| 177 CpuFeatures::Scope scope(VFP2); | 177 CpuFeatureScope scope(cgen_->masm(), VFP2); |
| 178 __ vldr(kScratchDoubleReg, cgen_->ToMemOperand(source)); | 178 __ vldr(kScratchDoubleReg, cgen_->ToMemOperand(source)); |
| 179 } else { | 179 } else { |
| 180 UNREACHABLE(); | 180 UNREACHABLE(); |
| 181 } | 181 } |
| 182 // This move will be done by restoring the saved value to the destination. | 182 // This move will be done by restoring the saved value to the destination. |
| 183 moves_[index].Eliminate(); | 183 moves_[index].Eliminate(); |
| 184 } | 184 } |
| 185 | 185 |
| 186 | 186 |
| 187 void LGapResolver::RestoreValue() { | 187 void LGapResolver::RestoreValue() { |
| 188 ASSERT(in_cycle_); | 188 ASSERT(in_cycle_); |
| 189 ASSERT(saved_destination_ != NULL); | 189 ASSERT(saved_destination_ != NULL); |
| 190 | 190 |
| 191 // Spilled value is in kSavedValueRegister or kSavedDoubleValueRegister. | 191 // Spilled value is in kSavedValueRegister or kSavedDoubleValueRegister. |
| 192 if (saved_destination_->IsRegister()) { | 192 if (saved_destination_->IsRegister()) { |
| 193 __ mov(cgen_->ToRegister(saved_destination_), kSavedValueRegister); | 193 __ mov(cgen_->ToRegister(saved_destination_), kSavedValueRegister); |
| 194 } else if (saved_destination_->IsStackSlot()) { | 194 } else if (saved_destination_->IsStackSlot()) { |
| 195 __ str(kSavedValueRegister, cgen_->ToMemOperand(saved_destination_)); | 195 __ str(kSavedValueRegister, cgen_->ToMemOperand(saved_destination_)); |
| 196 } else if (saved_destination_->IsDoubleRegister()) { | 196 } else if (saved_destination_->IsDoubleRegister()) { |
| 197 CpuFeatures::Scope scope(VFP2); | 197 CpuFeatureScope scope(cgen_->masm(), VFP2); |
| 198 __ vmov(cgen_->ToDoubleRegister(saved_destination_), kScratchDoubleReg); | 198 __ vmov(cgen_->ToDoubleRegister(saved_destination_), kScratchDoubleReg); |
| 199 } else if (saved_destination_->IsDoubleStackSlot()) { | 199 } else if (saved_destination_->IsDoubleStackSlot()) { |
| 200 CpuFeatures::Scope scope(VFP2); | 200 CpuFeatureScope scope(cgen_->masm(), VFP2); |
| 201 __ vstr(kScratchDoubleReg, cgen_->ToMemOperand(saved_destination_)); | 201 __ vstr(kScratchDoubleReg, cgen_->ToMemOperand(saved_destination_)); |
| 202 } else { | 202 } else { |
| 203 UNREACHABLE(); | 203 UNREACHABLE(); |
| 204 } | 204 } |
| 205 | 205 |
| 206 in_cycle_ = false; | 206 in_cycle_ = false; |
| 207 saved_destination_ = NULL; | 207 saved_destination_ = NULL; |
| 208 } | 208 } |
| 209 | 209 |
| 210 | 210 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 226 | 226 |
| 227 } else if (source->IsStackSlot()) { | 227 } else if (source->IsStackSlot()) { |
| 228 MemOperand source_operand = cgen_->ToMemOperand(source); | 228 MemOperand source_operand = cgen_->ToMemOperand(source); |
| 229 if (destination->IsRegister()) { | 229 if (destination->IsRegister()) { |
| 230 __ ldr(cgen_->ToRegister(destination), source_operand); | 230 __ ldr(cgen_->ToRegister(destination), source_operand); |
| 231 } else { | 231 } else { |
| 232 ASSERT(destination->IsStackSlot()); | 232 ASSERT(destination->IsStackSlot()); |
| 233 MemOperand destination_operand = cgen_->ToMemOperand(destination); | 233 MemOperand destination_operand = cgen_->ToMemOperand(destination); |
| 234 if (in_cycle_) { | 234 if (in_cycle_) { |
| 235 if (!destination_operand.OffsetIsUint12Encodable()) { | 235 if (!destination_operand.OffsetIsUint12Encodable()) { |
| 236 CpuFeatures::Scope scope(VFP2); | 236 CpuFeatureScope scope(cgen_->masm(), VFP2); |
| 237 // ip is overwritten while saving the value to the destination. | 237 // ip is overwritten while saving the value to the destination. |
| 238 // Therefore we can't use ip. It is OK if the read from the source | 238 // Therefore we can't use ip. It is OK if the read from the source |
| 239 // destroys ip, since that happens before the value is read. | 239 // destroys ip, since that happens before the value is read. |
| 240 __ vldr(kScratchDoubleReg.low(), source_operand); | 240 __ vldr(kScratchDoubleReg.low(), source_operand); |
| 241 __ vstr(kScratchDoubleReg.low(), destination_operand); | 241 __ vstr(kScratchDoubleReg.low(), destination_operand); |
| 242 } else { | 242 } else { |
| 243 __ ldr(ip, source_operand); | 243 __ ldr(ip, source_operand); |
| 244 __ str(ip, destination_operand); | 244 __ str(ip, destination_operand); |
| 245 } | 245 } |
| 246 } else { | 246 } else { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 265 __ mov(kSavedValueRegister, | 265 __ mov(kSavedValueRegister, |
| 266 Operand(cgen_->ToInteger32(constant_source))); | 266 Operand(cgen_->ToInteger32(constant_source))); |
| 267 } else { | 267 } else { |
| 268 __ LoadObject(kSavedValueRegister, | 268 __ LoadObject(kSavedValueRegister, |
| 269 cgen_->ToHandle(constant_source)); | 269 cgen_->ToHandle(constant_source)); |
| 270 } | 270 } |
| 271 __ str(kSavedValueRegister, cgen_->ToMemOperand(destination)); | 271 __ str(kSavedValueRegister, cgen_->ToMemOperand(destination)); |
| 272 } | 272 } |
| 273 | 273 |
| 274 } else if (source->IsDoubleRegister()) { | 274 } else if (source->IsDoubleRegister()) { |
| 275 CpuFeatures::Scope scope(VFP2); | 275 CpuFeatureScope scope(cgen_->masm(), VFP2); |
| 276 DwVfpRegister source_register = cgen_->ToDoubleRegister(source); | 276 DwVfpRegister source_register = cgen_->ToDoubleRegister(source); |
| 277 if (destination->IsDoubleRegister()) { | 277 if (destination->IsDoubleRegister()) { |
| 278 __ vmov(cgen_->ToDoubleRegister(destination), source_register); | 278 __ vmov(cgen_->ToDoubleRegister(destination), source_register); |
| 279 } else { | 279 } else { |
| 280 ASSERT(destination->IsDoubleStackSlot()); | 280 ASSERT(destination->IsDoubleStackSlot()); |
| 281 __ vstr(source_register, cgen_->ToMemOperand(destination)); | 281 __ vstr(source_register, cgen_->ToMemOperand(destination)); |
| 282 } | 282 } |
| 283 | 283 |
| 284 } else if (source->IsDoubleStackSlot()) { | 284 } else if (source->IsDoubleStackSlot()) { |
| 285 CpuFeatures::Scope scope(VFP2); | 285 CpuFeatureScope scope(cgen_->masm(), VFP2); |
| 286 MemOperand source_operand = cgen_->ToMemOperand(source); | 286 MemOperand source_operand = cgen_->ToMemOperand(source); |
| 287 if (destination->IsDoubleRegister()) { | 287 if (destination->IsDoubleRegister()) { |
| 288 __ vldr(cgen_->ToDoubleRegister(destination), source_operand); | 288 __ vldr(cgen_->ToDoubleRegister(destination), source_operand); |
| 289 } else { | 289 } else { |
| 290 ASSERT(destination->IsDoubleStackSlot()); | 290 ASSERT(destination->IsDoubleStackSlot()); |
| 291 MemOperand destination_operand = cgen_->ToMemOperand(destination); | 291 MemOperand destination_operand = cgen_->ToMemOperand(destination); |
| 292 if (in_cycle_) { | 292 if (in_cycle_) { |
| 293 // kSavedDoubleValueRegister was used to break the cycle, | 293 // kSavedDoubleValueRegister was used to break the cycle, |
| 294 // but kSavedValueRegister is free. | 294 // but kSavedValueRegister is free. |
| 295 MemOperand source_high_operand = | 295 MemOperand source_high_operand = |
| (...skipping 13 matching lines...) Expand all Loading... |
| 309 UNREACHABLE(); | 309 UNREACHABLE(); |
| 310 } | 310 } |
| 311 | 311 |
| 312 moves_[index].Eliminate(); | 312 moves_[index].Eliminate(); |
| 313 } | 313 } |
| 314 | 314 |
| 315 | 315 |
| 316 #undef __ | 316 #undef __ |
| 317 | 317 |
| 318 } } // namespace v8::internal | 318 } } // namespace v8::internal |
| OLD | NEW |