OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/base/division-by-constant.h" | 10 #include "src/base/division-by-constant.h" |
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
918 if (value == 0) { | 918 if (value == 0) { |
919 xorl(kScratchRegister, kScratchRegister); | 919 xorl(kScratchRegister, kScratchRegister); |
920 return kScratchRegister; | 920 return kScratchRegister; |
921 } | 921 } |
922 LoadSmiConstant(kScratchRegister, source); | 922 LoadSmiConstant(kScratchRegister, source); |
923 return kScratchRegister; | 923 return kScratchRegister; |
924 } | 924 } |
925 | 925 |
926 | 926 |
927 void MacroAssembler::LoadSmiConstant(Register dst, Smi* source) { | 927 void MacroAssembler::LoadSmiConstant(Register dst, Smi* source) { |
| 928 // Special-casing 0 here to use xorl seems to make things slower, so we don't |
| 929 // do it. |
928 Move(dst, source, Assembler::RelocInfoNone()); | 930 Move(dst, source, Assembler::RelocInfoNone()); |
929 } | 931 } |
930 | 932 |
931 | 933 |
932 void MacroAssembler::Integer32ToSmi(Register dst, Register src) { | 934 void MacroAssembler::Integer32ToSmi(Register dst, Register src) { |
933 STATIC_ASSERT(kSmiTag == 0); | 935 STATIC_ASSERT(kSmiTag == 0); |
934 if (!dst.is(src)) { | 936 if (!dst.is(src)) { |
935 movl(dst, src); | 937 movl(dst, src); |
936 } | 938 } |
937 shlp(dst, Immediate(kSmiShift)); | 939 shlp(dst, Immediate(kSmiShift)); |
(...skipping 4152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5090 if (mag.shift > 0) sarl(rdx, Immediate(mag.shift)); | 5092 if (mag.shift > 0) sarl(rdx, Immediate(mag.shift)); |
5091 movl(rax, dividend); | 5093 movl(rax, dividend); |
5092 shrl(rax, Immediate(31)); | 5094 shrl(rax, Immediate(31)); |
5093 addl(rdx, rax); | 5095 addl(rdx, rax); |
5094 } | 5096 } |
5095 | 5097 |
5096 | 5098 |
5097 } } // namespace v8::internal | 5099 } } // namespace v8::internal |
5098 | 5100 |
5099 #endif // V8_TARGET_ARCH_X64 | 5101 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |