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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 } else { | 245 } else { |
246 __ lw(kLithiumScratchReg, source_operand); | 246 __ lw(kLithiumScratchReg, source_operand); |
247 __ sw(kLithiumScratchReg, destination_operand); | 247 __ sw(kLithiumScratchReg, destination_operand); |
248 } | 248 } |
249 } | 249 } |
250 | 250 |
251 } else if (source->IsConstantOperand()) { | 251 } else if (source->IsConstantOperand()) { |
252 LConstantOperand* constant_source = LConstantOperand::cast(source); | 252 LConstantOperand* constant_source = LConstantOperand::cast(source); |
253 if (destination->IsRegister()) { | 253 if (destination->IsRegister()) { |
254 Register dst = cgen_->ToRegister(destination); | 254 Register dst = cgen_->ToRegister(destination); |
255 if (cgen_->IsInteger32(constant_source)) { | 255 if (cgen_->IsSmi(constant_source)) { |
| 256 __ li(dst, Operand(cgen_->ToSmi(constant_source))); |
| 257 } else if (cgen_->IsInteger32(constant_source)) { |
256 __ li(dst, Operand(cgen_->ToInteger32(constant_source))); | 258 __ li(dst, Operand(cgen_->ToInteger32(constant_source))); |
257 } else { | 259 } else { |
258 __ LoadObject(dst, cgen_->ToHandle(constant_source)); | 260 __ LoadObject(dst, cgen_->ToHandle(constant_source)); |
259 } | 261 } |
260 } else { | 262 } else { |
261 ASSERT(destination->IsStackSlot()); | 263 ASSERT(destination->IsStackSlot()); |
262 ASSERT(!in_cycle_); // Constant moves happen after all cycles are gone. | 264 ASSERT(!in_cycle_); // Constant moves happen after all cycles are gone. |
263 if (cgen_->IsInteger32(constant_source)) { | 265 if (cgen_->IsSmi(constant_source)) { |
| 266 __ li(kLithiumScratchReg, Operand(cgen_->ToSmi(constant_source))); |
| 267 } else if (cgen_->IsInteger32(constant_source)) { |
264 __ li(kLithiumScratchReg, | 268 __ li(kLithiumScratchReg, |
265 Operand(cgen_->ToInteger32(constant_source))); | 269 Operand(cgen_->ToInteger32(constant_source))); |
266 } else { | 270 } else { |
267 __ LoadObject(kLithiumScratchReg, | 271 __ LoadObject(kLithiumScratchReg, |
268 cgen_->ToHandle(constant_source)); | 272 cgen_->ToHandle(constant_source)); |
269 } | 273 } |
270 __ sw(kLithiumScratchReg, cgen_->ToMemOperand(destination)); | 274 __ sw(kLithiumScratchReg, cgen_->ToMemOperand(destination)); |
271 } | 275 } |
272 | 276 |
273 } else if (source->IsDoubleRegister()) { | 277 } else if (source->IsDoubleRegister()) { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 UNREACHABLE(); | 311 UNREACHABLE(); |
308 } | 312 } |
309 | 313 |
310 moves_[index].Eliminate(); | 314 moves_[index].Eliminate(); |
311 } | 315 } |
312 | 316 |
313 | 317 |
314 #undef __ | 318 #undef __ |
315 | 319 |
316 } } // namespace v8::internal | 320 } } // namespace v8::internal |
OLD | NEW |