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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 } else { | 250 } else { |
251 ASSERT(destination->IsStackSlot()); | 251 ASSERT(destination->IsStackSlot()); |
252 EmitStackSlotMove(index); | 252 EmitStackSlotMove(index); |
253 } | 253 } |
254 | 254 |
255 } else if (source->IsConstantOperand()) { | 255 } else if (source->IsConstantOperand()) { |
256 LConstantOperand* constant_source = LConstantOperand::cast(source); | 256 LConstantOperand* constant_source = LConstantOperand::cast(source); |
257 if (destination->IsRegister()) { | 257 if (destination->IsRegister()) { |
258 Register dst = cgen_->ToRegister(destination); | 258 Register dst = cgen_->ToRegister(destination); |
259 if (cgen_->IsSmi(constant_source)) { | 259 if (cgen_->IsSmi(constant_source)) { |
260 __ Mov(dst, Operand(cgen_->ToSmi(constant_source))); | 260 __ Mov(dst, cgen_->ToSmi(constant_source)); |
261 } else if (cgen_->IsInteger32Constant(constant_source)) { | 261 } else if (cgen_->IsInteger32Constant(constant_source)) { |
262 __ Mov(dst, cgen_->ToInteger32(constant_source)); | 262 __ Mov(dst, cgen_->ToInteger32(constant_source)); |
263 } else { | 263 } else { |
264 __ LoadObject(dst, cgen_->ToHandle(constant_source)); | 264 __ LoadObject(dst, cgen_->ToHandle(constant_source)); |
265 } | 265 } |
266 } else if (destination->IsDoubleRegister()) { | 266 } else if (destination->IsDoubleRegister()) { |
267 DoubleRegister result = cgen_->ToDoubleRegister(destination); | 267 DoubleRegister result = cgen_->ToDoubleRegister(destination); |
268 __ Fmov(result, cgen_->ToDouble(constant_source)); | 268 __ Fmov(result, cgen_->ToDouble(constant_source)); |
269 } else { | 269 } else { |
270 ASSERT(destination->IsStackSlot()); | 270 ASSERT(destination->IsStackSlot()); |
271 ASSERT(!in_cycle_); // Constant moves happen after all cycles are gone. | 271 ASSERT(!in_cycle_); // Constant moves happen after all cycles are gone. |
272 need_to_restore_root_ = true; | 272 need_to_restore_root_ = true; |
273 if (cgen_->IsSmi(constant_source)) { | 273 if (cgen_->IsSmi(constant_source)) { |
274 __ Mov(kSavedValue, Operand(cgen_->ToSmi(constant_source))); | 274 __ Mov(kSavedValue, cgen_->ToSmi(constant_source)); |
275 } else if (cgen_->IsInteger32Constant(constant_source)) { | 275 } else if (cgen_->IsInteger32Constant(constant_source)) { |
276 __ Mov(kSavedValue, cgen_->ToInteger32(constant_source)); | 276 __ Mov(kSavedValue, cgen_->ToInteger32(constant_source)); |
277 } else { | 277 } else { |
278 __ LoadObject(kSavedValue, cgen_->ToHandle(constant_source)); | 278 __ LoadObject(kSavedValue, cgen_->ToHandle(constant_source)); |
279 } | 279 } |
280 __ Str(kSavedValue, cgen_->ToMemOperand(destination)); | 280 __ Str(kSavedValue, cgen_->ToMemOperand(destination)); |
281 } | 281 } |
282 | 282 |
283 } else if (source->IsDoubleRegister()) { | 283 } else if (source->IsDoubleRegister()) { |
284 DoubleRegister src = cgen_->ToDoubleRegister(source); | 284 DoubleRegister src = cgen_->ToDoubleRegister(source); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 LOperand* src = moves_[index].source(); | 317 LOperand* src = moves_[index].source(); |
318 LOperand* dst = moves_[index].destination(); | 318 LOperand* dst = moves_[index].destination(); |
319 | 319 |
320 ASSERT(src->IsStackSlot()); | 320 ASSERT(src->IsStackSlot()); |
321 ASSERT(dst->IsStackSlot()); | 321 ASSERT(dst->IsStackSlot()); |
322 __ Ldr(temp, cgen_->ToMemOperand(src)); | 322 __ Ldr(temp, cgen_->ToMemOperand(src)); |
323 __ Str(temp, cgen_->ToMemOperand(dst)); | 323 __ Str(temp, cgen_->ToMemOperand(dst)); |
324 } | 324 } |
325 | 325 |
326 } } // namespace v8::internal | 326 } } // namespace v8::internal |
OLD | NEW |