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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 LConstantOperand* constant_source = LConstantOperand::cast(source); | 251 LConstantOperand* constant_source = LConstantOperand::cast(source); |
252 if (destination->IsRegister()) { | 252 if (destination->IsRegister()) { |
253 Register dst = cgen_->ToRegister(destination); | 253 Register dst = cgen_->ToRegister(destination); |
254 Representation r = cgen_->IsSmi(constant_source) | 254 Representation r = cgen_->IsSmi(constant_source) |
255 ? Representation::Smi() : Representation::Integer32(); | 255 ? Representation::Smi() : Representation::Integer32(); |
256 if (cgen_->IsInteger32(constant_source)) { | 256 if (cgen_->IsInteger32(constant_source)) { |
257 __ li(dst, Operand(cgen_->ToRepresentation(constant_source, r))); | 257 __ li(dst, Operand(cgen_->ToRepresentation(constant_source, r))); |
258 } else { | 258 } else { |
259 __ LoadObject(dst, cgen_->ToHandle(constant_source)); | 259 __ LoadObject(dst, cgen_->ToHandle(constant_source)); |
260 } | 260 } |
261 } else if (destination->IsDoubleRegister()) { | 261 } else if (source->IsDoubleRegister()) { |
262 DoubleRegister result = cgen_->ToDoubleRegister(destination); | 262 DoubleRegister result = cgen_->ToDoubleRegister(destination); |
263 double v = cgen_->ToDouble(constant_source); | 263 double v = cgen_->ToDouble(constant_source); |
264 __ Move(result, v); | 264 __ Move(result, v); |
265 } else { | 265 } else { |
266 ASSERT(destination->IsStackSlot()); | 266 ASSERT(destination->IsStackSlot()); |
267 ASSERT(!in_cycle_); // Constant moves happen after all cycles are gone. | 267 ASSERT(!in_cycle_); // Constant moves happen after all cycles are gone. |
268 Representation r = cgen_->IsSmi(constant_source) | 268 Representation r = cgen_->IsSmi(constant_source) |
269 ? Representation::Smi() : Representation::Integer32(); | 269 ? Representation::Smi() : Representation::Integer32(); |
270 if (cgen_->IsInteger32(constant_source)) { | 270 if (cgen_->IsInteger32(constant_source)) { |
271 __ li(kLithiumScratchReg, | 271 __ li(kLithiumScratchReg, |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 UNREACHABLE(); | 314 UNREACHABLE(); |
315 } | 315 } |
316 | 316 |
317 moves_[index].Eliminate(); | 317 moves_[index].Eliminate(); |
318 } | 318 } |
319 | 319 |
320 | 320 |
321 #undef __ | 321 #undef __ |
322 | 322 |
323 } } // namespace v8::internal | 323 } } // namespace v8::internal |
OLD | NEW |