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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
191 __ movp(dst, kScratchRegister); | 191 __ movp(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_->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 __ Set(dst, static_cast<uint32_t>(cgen_->ToInteger32(constant_source))); | 201 int32_t constant = cgen_->ToInteger32(constant_source); |
202 if (cgen_->IsDehoistedKeyConstant(constant_source)) { | |
203 __ Set(dst, constant); | |
204 } else { | |
205 __ Set(dst, static_cast<uint32_t>(constant)); | |
206 } | |
202 } else { | 207 } else { |
203 __ Move(dst, cgen_->ToHandle(constant_source)); | 208 __ Move(dst, cgen_->ToHandle(constant_source)); |
204 } | 209 } |
205 } else if (destination->IsDoubleRegister()) { | 210 } else if (destination->IsDoubleRegister()) { |
206 double v = cgen_->ToDouble(constant_source); | 211 double v = cgen_->ToDouble(constant_source); |
207 uint64_t int_val = BitCast<uint64_t, double>(v); | 212 uint64_t int_val = BitCast<uint64_t, double>(v); |
208 XMMRegister dst = cgen_->ToDoubleRegister(destination); | 213 XMMRegister dst = cgen_->ToDoubleRegister(destination); |
209 if (int_val == 0) { | 214 if (int_val == 0) { |
210 __ xorps(dst, dst); | 215 __ xorps(dst, dst); |
211 } else { | 216 } else { |
212 __ Set(kScratchRegister, int_val); | 217 __ Set(kScratchRegister, int_val); |
213 __ movq(dst, kScratchRegister); | 218 __ movq(dst, kScratchRegister); |
214 } | 219 } |
215 } else { | 220 } else { |
216 ASSERT(destination->IsStackSlot()); | 221 ASSERT(destination->IsStackSlot()); |
217 Operand dst = cgen_->ToOperand(destination); | 222 Operand dst = cgen_->ToOperand(destination); |
218 if (cgen_->IsSmiConstant(constant_source)) { | 223 if (cgen_->IsSmiConstant(constant_source)) { |
danno
2014/03/21 12:36:36
Just like you added stack slot support elsewhere,
Weiliang
2014/03/23 12:15:42
Yes, that is possible. Actually the "movp" has alr
Weiliang
2014/03/23 12:15:42
Done.
| |
219 __ Move(dst, cgen_->ToSmi(constant_source)); | 224 __ Move(dst, cgen_->ToSmi(constant_source)); |
220 } else if (cgen_->IsInteger32Constant(constant_source)) { | 225 } else if (cgen_->IsInteger32Constant(constant_source)) { |
221 // Zero top 32 bits of a 64 bit spill slot that holds a 32 bit untagged | 226 // Zero top 32 bits of a 64 bit spill slot that holds a 32 bit untagged |
222 // value. | 227 // value. |
223 __ movp(dst, Immediate(cgen_->ToInteger32(constant_source))); | 228 __ movp(dst, Immediate(cgen_->ToInteger32(constant_source))); |
224 } else { | 229 } else { |
225 __ Move(kScratchRegister, cgen_->ToHandle(constant_source)); | 230 __ Move(kScratchRegister, cgen_->ToHandle(constant_source)); |
226 __ movp(dst, kScratchRegister); | 231 __ movp(dst, kScratchRegister); |
227 } | 232 } |
228 } | 233 } |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
327 moves_[i].set_source(source); | 332 moves_[i].set_source(source); |
328 } | 333 } |
329 } | 334 } |
330 } | 335 } |
331 | 336 |
332 #undef __ | 337 #undef __ |
333 | 338 |
334 } } // namespace v8::internal | 339 } } // namespace v8::internal |
335 | 340 |
336 #endif // V8_TARGET_ARCH_X64 | 341 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |