| 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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 ASSERT(destination->IsStackSlot()); | 188 ASSERT(destination->IsStackSlot()); |
| 189 Operand dst = cgen_->ToOperand(destination); | 189 Operand dst = cgen_->ToOperand(destination); |
| 190 __ movq(kScratchRegister, src); | 190 __ movq(kScratchRegister, src); |
| 191 __ movq(dst, kScratchRegister); | 191 __ movq(dst, kScratchRegister); |
| 192 } | 192 } |
| 193 | 193 |
| 194 } else if (source->IsConstantOperand()) { | 194 } else if (source->IsConstantOperand()) { |
| 195 LConstantOperand* constant_source = LConstantOperand::cast(source); | 195 LConstantOperand* constant_source = LConstantOperand::cast(source); |
| 196 if (destination->IsRegister()) { | 196 if (destination->IsRegister()) { |
| 197 Register dst = cgen_->ToRegister(destination); | 197 Register dst = cgen_->ToRegister(destination); |
| 198 if (cgen_->IsInteger32Constant(constant_source)) { | 198 if (cgen_->IsSmiConstant(constant_source)) { |
| 199 __ Move(dst, cgen_->ToSmi(constant_source)); |
| 200 } else if (cgen_->IsInteger32Constant(constant_source)) { |
| 199 __ movl(dst, Immediate(cgen_->ToInteger32(constant_source))); | 201 __ movl(dst, Immediate(cgen_->ToInteger32(constant_source))); |
| 200 } else { | 202 } else { |
| 201 __ LoadObject(dst, cgen_->ToHandle(constant_source)); | 203 __ LoadObject(dst, cgen_->ToHandle(constant_source)); |
| 202 } | 204 } |
| 203 } else { | 205 } else { |
| 204 ASSERT(destination->IsStackSlot()); | 206 ASSERT(destination->IsStackSlot()); |
| 205 Operand dst = cgen_->ToOperand(destination); | 207 Operand dst = cgen_->ToOperand(destination); |
| 206 if (cgen_->IsInteger32Constant(constant_source)) { | 208 if (cgen_->IsSmiConstant(constant_source)) { |
| 209 __ Move(dst, cgen_->ToSmi(constant_source)); |
| 210 } else if (cgen_->IsInteger32Constant(constant_source)) { |
| 207 // Zero top 32 bits of a 64 bit spill slot that holds a 32 bit untagged | 211 // Zero top 32 bits of a 64 bit spill slot that holds a 32 bit untagged |
| 208 // value. | 212 // value. |
| 209 __ movq(dst, Immediate(cgen_->ToInteger32(constant_source))); | 213 __ movq(dst, Immediate(cgen_->ToInteger32(constant_source))); |
| 210 } else { | 214 } else { |
| 211 __ LoadObject(kScratchRegister, cgen_->ToHandle(constant_source)); | 215 __ LoadObject(kScratchRegister, cgen_->ToHandle(constant_source)); |
| 212 __ movq(dst, kScratchRegister); | 216 __ movq(dst, kScratchRegister); |
| 213 } | 217 } |
| 214 } | 218 } |
| 215 | 219 |
| 216 } else if (source->IsDoubleRegister()) { | 220 } else if (source->IsDoubleRegister()) { |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 moves_[i].set_source(source); | 317 moves_[i].set_source(source); |
| 314 } | 318 } |
| 315 } | 319 } |
| 316 } | 320 } |
| 317 | 321 |
| 318 #undef __ | 322 #undef __ |
| 319 | 323 |
| 320 } } // namespace v8::internal | 324 } } // namespace v8::internal |
| 321 | 325 |
| 322 #endif // V8_TARGET_ARCH_X64 | 326 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |