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 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
726 | 726 |
727 | 727 |
728 void MacroAssembler::GetBuiltinEntry(Register target, Builtins::JavaScript id) { | 728 void MacroAssembler::GetBuiltinEntry(Register target, Builtins::JavaScript id) { |
729 DCHECK(!target.is(rdi)); | 729 DCHECK(!target.is(rdi)); |
730 // Load the JavaScript builtin function from the builtins object. | 730 // Load the JavaScript builtin function from the builtins object. |
731 GetBuiltinFunction(rdi, id); | 731 GetBuiltinFunction(rdi, id); |
732 movp(target, FieldOperand(rdi, JSFunction::kCodeEntryOffset)); | 732 movp(target, FieldOperand(rdi, JSFunction::kCodeEntryOffset)); |
733 } | 733 } |
734 | 734 |
735 | 735 |
736 void MacroAssembler::BranchIfNotBuiltin(Register function, Register temp, | |
737 BuiltinFunctionId id, Label* miss) { | |
738 movp(temp, FieldOperand(function, JSFunction::kSharedFunctionInfoOffset)); | |
739 movp(temp, FieldOperand(temp, SharedFunctionInfo::kFunctionDataOffset)); | |
740 Cmp(temp, Smi::FromInt(id)); | |
741 j(not_equal, miss); | |
742 } | |
743 | |
744 | |
745 #define REG(Name) { kRegister_ ## Name ## _Code } | 736 #define REG(Name) { kRegister_ ## Name ## _Code } |
746 | 737 |
747 static const Register saved_regs[] = { | 738 static const Register saved_regs[] = { |
748 REG(rax), REG(rcx), REG(rdx), REG(rbx), REG(rbp), REG(rsi), REG(rdi), REG(r8), | 739 REG(rax), REG(rcx), REG(rdx), REG(rbx), REG(rbp), REG(rsi), REG(rdi), REG(r8), |
749 REG(r9), REG(r10), REG(r11) | 740 REG(r9), REG(r10), REG(r11) |
750 }; | 741 }; |
751 | 742 |
752 #undef REG | 743 #undef REG |
753 | 744 |
754 static const int kNumberOfSavedRegs = sizeof(saved_regs) / sizeof(Register); | 745 static const int kNumberOfSavedRegs = sizeof(saved_regs) / sizeof(Register); |
(...skipping 4344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5099 if (mag.shift > 0) sarl(rdx, Immediate(mag.shift)); | 5090 if (mag.shift > 0) sarl(rdx, Immediate(mag.shift)); |
5100 movl(rax, dividend); | 5091 movl(rax, dividend); |
5101 shrl(rax, Immediate(31)); | 5092 shrl(rax, Immediate(31)); |
5102 addl(rdx, rax); | 5093 addl(rdx, rax); |
5103 } | 5094 } |
5104 | 5095 |
5105 | 5096 |
5106 } } // namespace v8::internal | 5097 } } // namespace v8::internal |
5107 | 5098 |
5108 #endif // V8_TARGET_ARCH_X64 | 5099 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |