OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 __ ldr(ip, source_operand); | 241 __ ldr(ip, source_operand); |
242 __ str(ip, destination_operand); | 242 __ str(ip, destination_operand); |
243 } | 243 } |
244 } else { | 244 } else { |
245 __ ldr(kSavedValueRegister, source_operand); | 245 __ ldr(kSavedValueRegister, source_operand); |
246 __ str(kSavedValueRegister, destination_operand); | 246 __ str(kSavedValueRegister, destination_operand); |
247 } | 247 } |
248 } | 248 } |
249 | 249 |
250 } else if (source->IsConstantOperand()) { | 250 } else if (source->IsConstantOperand()) { |
251 Operand source_operand = cgen_->ToOperand(source); | 251 LConstantOperand* constant_source = LConstantOperand::cast(source); |
252 if (destination->IsRegister()) { | 252 if (destination->IsRegister()) { |
253 __ mov(cgen_->ToRegister(destination), source_operand); | 253 Register dst = cgen_->ToRegister(destination); |
| 254 if (cgen_->IsInteger32(constant_source)) { |
| 255 __ mov(dst, Operand(cgen_->ToInteger32(constant_source))); |
| 256 } else { |
| 257 __ LoadObject(dst, cgen_->ToHandle(constant_source)); |
| 258 } |
254 } else { | 259 } else { |
255 ASSERT(destination->IsStackSlot()); | 260 ASSERT(destination->IsStackSlot()); |
256 ASSERT(!in_cycle_); // Constant moves happen after all cycles are gone. | 261 ASSERT(!in_cycle_); // Constant moves happen after all cycles are gone. |
257 __ mov(kSavedValueRegister, source_operand); | 262 if (cgen_->IsInteger32(constant_source)) { |
| 263 __ mov(kSavedValueRegister, |
| 264 Operand(cgen_->ToInteger32(constant_source))); |
| 265 } else { |
| 266 __ LoadObject(kSavedValueRegister, |
| 267 cgen_->ToHandle(constant_source)); |
| 268 } |
258 __ str(kSavedValueRegister, cgen_->ToMemOperand(destination)); | 269 __ str(kSavedValueRegister, cgen_->ToMemOperand(destination)); |
259 } | 270 } |
260 | 271 |
261 } else if (source->IsDoubleRegister()) { | 272 } else if (source->IsDoubleRegister()) { |
262 DoubleRegister source_register = cgen_->ToDoubleRegister(source); | 273 DoubleRegister source_register = cgen_->ToDoubleRegister(source); |
263 if (destination->IsDoubleRegister()) { | 274 if (destination->IsDoubleRegister()) { |
264 __ vmov(cgen_->ToDoubleRegister(destination), source_register); | 275 __ vmov(cgen_->ToDoubleRegister(destination), source_register); |
265 } else { | 276 } else { |
266 ASSERT(destination->IsDoubleStackSlot()); | 277 ASSERT(destination->IsDoubleStackSlot()); |
267 __ vstr(source_register, cgen_->ToMemOperand(destination)); | 278 __ vstr(source_register, cgen_->ToMemOperand(destination)); |
(...skipping 26 matching lines...) Expand all Loading... |
294 UNREACHABLE(); | 305 UNREACHABLE(); |
295 } | 306 } |
296 | 307 |
297 moves_[index].Eliminate(); | 308 moves_[index].Eliminate(); |
298 } | 309 } |
299 | 310 |
300 | 311 |
301 #undef __ | 312 #undef __ |
302 | 313 |
303 } } // namespace v8::internal | 314 } } // namespace v8::internal |
OLD | NEW |