| 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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 if (cgen_->IsSmiConstant(constant_source)) { | 198 if (cgen_->IsSmiConstant(constant_source)) { |
| 199 __ Move(dst, cgen_->ToSmi(constant_source)); | 199 __ Move(dst, cgen_->ToSmi(constant_source)); |
| 200 } else if (cgen_->IsInteger32Constant(constant_source)) { | 200 } else if (cgen_->IsInteger32Constant(constant_source)) { |
| 201 __ movl(dst, Immediate(cgen_->ToInteger32(constant_source))); | 201 __ movl(dst, Immediate(cgen_->ToInteger32(constant_source))); |
| 202 } else { | 202 } else { |
| 203 __ LoadObject(dst, cgen_->ToHandle(constant_source)); | 203 __ LoadObject(dst, cgen_->ToHandle(constant_source)); |
| 204 } | 204 } |
| 205 } else if (destination->IsDoubleRegister()) { | 205 } else if (destination->IsDoubleRegister()) { |
| 206 double v = cgen_->ToDouble(constant_source); | 206 double v = cgen_->ToDouble(constant_source); |
| 207 uint64_t int_val = BitCast<uint64_t, double>(v); | 207 uint64_t int_val = BitCast<uint64_t, double>(v); |
| 208 int32_t lower = static_cast<int32_t>(int_val); | |
| 209 int32_t upper = static_cast<int32_t>(int_val >> (kBitsPerInt)); | |
| 210 XMMRegister dst = cgen_->ToDoubleRegister(destination); | 208 XMMRegister dst = cgen_->ToDoubleRegister(destination); |
| 211 if (int_val == 0) { | 209 if (int_val == 0) { |
| 212 __ xorps(dst, dst); | 210 __ xorps(dst, dst); |
| 213 } else { | 211 } else { |
| 214 __ push(Immediate(upper)); | 212 __ movq(kScratchRegister, int_val, RelocInfo::NONE64); |
| 215 __ push(Immediate(lower)); | 213 __ movq(dst, kScratchRegister); |
| 216 __ movsd(dst, Operand(rsp, 0)); | |
| 217 __ addq(rsp, Immediate(kDoubleSize)); | |
| 218 } | 214 } |
| 219 } else { | 215 } else { |
| 220 ASSERT(destination->IsStackSlot()); | 216 ASSERT(destination->IsStackSlot()); |
| 221 Operand dst = cgen_->ToOperand(destination); | 217 Operand dst = cgen_->ToOperand(destination); |
| 222 if (cgen_->IsSmiConstant(constant_source)) { | 218 if (cgen_->IsSmiConstant(constant_source)) { |
| 223 __ Move(dst, cgen_->ToSmi(constant_source)); | 219 __ Move(dst, cgen_->ToSmi(constant_source)); |
| 224 } else if (cgen_->IsInteger32Constant(constant_source)) { | 220 } else if (cgen_->IsInteger32Constant(constant_source)) { |
| 225 // Zero top 32 bits of a 64 bit spill slot that holds a 32 bit untagged | 221 // Zero top 32 bits of a 64 bit spill slot that holds a 32 bit untagged |
| 226 // value. | 222 // value. |
| 227 __ movq(dst, Immediate(cgen_->ToInteger32(constant_source))); | 223 __ movq(dst, Immediate(cgen_->ToInteger32(constant_source))); |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 moves_[i].set_source(source); | 327 moves_[i].set_source(source); |
| 332 } | 328 } |
| 333 } | 329 } |
| 334 } | 330 } |
| 335 | 331 |
| 336 #undef __ | 332 #undef __ |
| 337 | 333 |
| 338 } } // namespace v8::internal | 334 } } // namespace v8::internal |
| 339 | 335 |
| 340 #endif // V8_TARGET_ARCH_X64 | 336 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |