OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/x64/lithium-codegen-x64.h" | 7 #include "src/x64/lithium-codegen-x64.h" |
8 #include "src/x64/lithium-gap-resolver-x64.h" | 8 #include "src/x64/lithium-gap-resolver-x64.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 __ Move(dst, cgen_->ToHandle(constant_source)); | 185 __ Move(dst, cgen_->ToHandle(constant_source)); |
186 } | 186 } |
187 } else if (destination->IsDoubleRegister()) { | 187 } else if (destination->IsDoubleRegister()) { |
188 double v = cgen_->ToDouble(constant_source); | 188 double v = cgen_->ToDouble(constant_source); |
189 uint64_t int_val = bit_cast<uint64_t, double>(v); | 189 uint64_t int_val = bit_cast<uint64_t, double>(v); |
190 XMMRegister dst = cgen_->ToDoubleRegister(destination); | 190 XMMRegister dst = cgen_->ToDoubleRegister(destination); |
191 if (int_val == 0) { | 191 if (int_val == 0) { |
192 __ xorps(dst, dst); | 192 __ xorps(dst, dst); |
193 } else { | 193 } else { |
194 __ Set(kScratchRegister, int_val); | 194 __ Set(kScratchRegister, int_val); |
195 __ movq(dst, kScratchRegister); | 195 __ Movq(dst, kScratchRegister); |
196 } | 196 } |
197 } else { | 197 } else { |
198 DCHECK(destination->IsStackSlot()); | 198 DCHECK(destination->IsStackSlot()); |
199 Operand dst = cgen_->ToOperand(destination); | 199 Operand dst = cgen_->ToOperand(destination); |
200 if (cgen_->IsSmiConstant(constant_source)) { | 200 if (cgen_->IsSmiConstant(constant_source)) { |
201 __ Move(dst, cgen_->ToSmi(constant_source)); | 201 __ Move(dst, cgen_->ToSmi(constant_source)); |
202 } else if (cgen_->IsInteger32Constant(constant_source)) { | 202 } else if (cgen_->IsInteger32Constant(constant_source)) { |
203 // Do sign extension to 64 bits when stored into stack slot. | 203 // Do sign extension to 64 bits when stored into stack slot. |
204 __ movp(dst, Immediate(cgen_->ToInteger32(constant_source))); | 204 __ movp(dst, Immediate(cgen_->ToInteger32(constant_source))); |
205 } else { | 205 } else { |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 } | 309 } |
310 } | 310 } |
311 } | 311 } |
312 | 312 |
313 #undef __ | 313 #undef __ |
314 | 314 |
315 } // namespace internal | 315 } // namespace internal |
316 } // namespace v8 | 316 } // namespace v8 |
317 | 317 |
318 #endif // V8_TARGET_ARCH_X64 | 318 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |