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 2265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2276 intptr_t smi = reinterpret_cast<intptr_t>(source); | 2276 intptr_t smi = reinterpret_cast<intptr_t>(source); |
2277 if (is_int32(smi)) { | 2277 if (is_int32(smi)) { |
2278 Push(Immediate(static_cast<int32_t>(smi))); | 2278 Push(Immediate(static_cast<int32_t>(smi))); |
2279 } else { | 2279 } else { |
2280 Register constant = GetSmiConstant(source); | 2280 Register constant = GetSmiConstant(source); |
2281 Push(constant); | 2281 Push(constant); |
2282 } | 2282 } |
2283 } | 2283 } |
2284 | 2284 |
2285 | 2285 |
2286 void MacroAssembler::PushInt64AsTwoSmis(Register src, Register scratch) { | 2286 void MacroAssembler::PushRegisterAsTwoSmis(Register src, Register scratch) { |
| 2287 ASSERT(!src.is(scratch)); |
2287 movp(scratch, src); | 2288 movp(scratch, src); |
2288 // High bits. | 2289 // High bits. |
2289 shrp(src, Immediate(64 - kSmiShift)); | 2290 shrp(src, Immediate(kPointerSize * kBitsPerByte - kSmiShift)); |
2290 shlp(src, Immediate(kSmiShift)); | 2291 shlp(src, Immediate(kSmiShift)); |
2291 Push(src); | 2292 Push(src); |
2292 // Low bits. | 2293 // Low bits. |
2293 shlp(scratch, Immediate(kSmiShift)); | 2294 shlp(scratch, Immediate(kSmiShift)); |
2294 Push(scratch); | 2295 Push(scratch); |
2295 } | 2296 } |
2296 | 2297 |
2297 | 2298 |
2298 void MacroAssembler::PopInt64AsTwoSmis(Register dst, Register scratch) { | 2299 void MacroAssembler::PopRegisterAsTwoSmis(Register dst, Register scratch) { |
| 2300 ASSERT(!dst.is(scratch)); |
2299 Pop(scratch); | 2301 Pop(scratch); |
2300 // Low bits. | 2302 // Low bits. |
2301 shrp(scratch, Immediate(kSmiShift)); | 2303 shrp(scratch, Immediate(kSmiShift)); |
2302 Pop(dst); | 2304 Pop(dst); |
2303 shrp(dst, Immediate(kSmiShift)); | 2305 shrp(dst, Immediate(kSmiShift)); |
2304 // High bits. | 2306 // High bits. |
2305 shlp(dst, Immediate(64 - kSmiShift)); | 2307 shlp(dst, Immediate(kPointerSize * kBitsPerByte - kSmiShift)); |
2306 orp(dst, scratch); | 2308 orp(dst, scratch); |
2307 } | 2309 } |
2308 | 2310 |
2309 | 2311 |
2310 void MacroAssembler::Test(const Operand& src, Smi* source) { | 2312 void MacroAssembler::Test(const Operand& src, Smi* source) { |
2311 testl(Operand(src, kIntSize), Immediate(source->value())); | 2313 testl(Operand(src, kIntSize), Immediate(source->value())); |
2312 } | 2314 } |
2313 | 2315 |
2314 | 2316 |
2315 // ---------------------------------------------------------------------------- | 2317 // ---------------------------------------------------------------------------- |
(...skipping 2833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5149 if (ms.shift() > 0) sarl(rdx, Immediate(ms.shift())); | 5151 if (ms.shift() > 0) sarl(rdx, Immediate(ms.shift())); |
5150 movl(rax, dividend); | 5152 movl(rax, dividend); |
5151 shrl(rax, Immediate(31)); | 5153 shrl(rax, Immediate(31)); |
5152 addl(rdx, rax); | 5154 addl(rdx, rax); |
5153 } | 5155 } |
5154 | 5156 |
5155 | 5157 |
5156 } } // namespace v8::internal | 5158 } } // namespace v8::internal |
5157 | 5159 |
5158 #endif // V8_TARGET_ARCH_X64 | 5160 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |