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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
247 } else if (source->IsConstantOperand()) { | 247 } else if (source->IsConstantOperand()) { |
248 LConstantOperand* constant_source = LConstantOperand::cast(source); | 248 LConstantOperand* constant_source = LConstantOperand::cast(source); |
249 if (destination->IsRegister()) { | 249 if (destination->IsRegister()) { |
250 Register dst = cgen_->ToRegister(destination); | 250 Register dst = cgen_->ToRegister(destination); |
251 if (cgen_->IsInteger32(constant_source)) { | 251 if (cgen_->IsSmi(constant_source)) { |
| 252 __ mov(dst, Operand(cgen_->ToSmi(constant_source))); |
| 253 } else if (cgen_->IsInteger32(constant_source)) { |
252 __ mov(dst, Operand(cgen_->ToInteger32(constant_source))); | 254 __ mov(dst, Operand(cgen_->ToInteger32(constant_source))); |
253 } else { | 255 } else { |
254 __ LoadObject(dst, cgen_->ToHandle(constant_source)); | 256 __ LoadObject(dst, cgen_->ToHandle(constant_source)); |
255 } | 257 } |
256 } else { | 258 } else { |
257 ASSERT(destination->IsStackSlot()); | 259 ASSERT(destination->IsStackSlot()); |
258 ASSERT(!in_cycle_); // Constant moves happen after all cycles are gone. | 260 ASSERT(!in_cycle_); // Constant moves happen after all cycles are gone. |
259 if (cgen_->IsInteger32(constant_source)) { | 261 if (cgen_->IsSmi(constant_source)) { |
| 262 __ mov(kSavedValueRegister, Operand(cgen_->ToSmi(constant_source))); |
| 263 } else if (cgen_->IsInteger32(constant_source)) { |
260 __ mov(kSavedValueRegister, | 264 __ mov(kSavedValueRegister, |
261 Operand(cgen_->ToInteger32(constant_source))); | 265 Operand(cgen_->ToInteger32(constant_source))); |
262 } else { | 266 } else { |
263 __ LoadObject(kSavedValueRegister, | 267 __ LoadObject(kSavedValueRegister, |
264 cgen_->ToHandle(constant_source)); | 268 cgen_->ToHandle(constant_source)); |
265 } | 269 } |
266 __ str(kSavedValueRegister, cgen_->ToMemOperand(destination)); | 270 __ str(kSavedValueRegister, cgen_->ToMemOperand(destination)); |
267 } | 271 } |
268 | 272 |
269 } else if (source->IsDoubleRegister()) { | 273 } else if (source->IsDoubleRegister()) { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 UNREACHABLE(); | 306 UNREACHABLE(); |
303 } | 307 } |
304 | 308 |
305 moves_[index].Eliminate(); | 309 moves_[index].Eliminate(); |
306 } | 310 } |
307 | 311 |
308 | 312 |
309 #undef __ | 313 #undef __ |
310 | 314 |
311 } } // namespace v8::internal | 315 } } // namespace v8::internal |
OLD | NEW |