| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
| 10 #include "src/ic/handler-compiler.h" | 10 #include "src/ic/handler-compiler.h" |
| (...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 835 __ PopReturnAddressTo(rax); | 835 __ PopReturnAddressTo(rax); |
| 836 __ Push(rdi); // Push function. | 836 __ Push(rdi); // Push function. |
| 837 __ Push(rdx); // Push parameters pointer. | 837 __ Push(rdx); // Push parameters pointer. |
| 838 __ Push(rcx); // Push parameter count. | 838 __ Push(rcx); // Push parameter count. |
| 839 __ PushReturnAddressFrom(rax); | 839 __ PushReturnAddressFrom(rax); |
| 840 __ TailCallRuntime(Runtime::kNewSloppyArguments); | 840 __ TailCallRuntime(Runtime::kNewSloppyArguments); |
| 841 } | 841 } |
| 842 | 842 |
| 843 | 843 |
| 844 void RestParamAccessStub::GenerateNew(MacroAssembler* masm) { | 844 void RestParamAccessStub::GenerateNew(MacroAssembler* masm) { |
| 845 // rsp[0] : return address | 845 // rcx : number of parameters (tagged) |
| 846 // rsp[8] : language mode | 846 // rdx : parameters pointer |
| 847 // rsp[16] : index of rest parameter | 847 // rbx : rest parameter index (tagged) |
| 848 // rsp[24] : number of parameters | 848 // rdi : language mode (tagged) |
| 849 // rsp[32] : receiver displacement | 849 // rsp[0] : return address |
| 850 | 850 |
| 851 // Check if the calling frame is an arguments adaptor frame. | 851 // Check if the calling frame is an arguments adaptor frame. |
| 852 Label runtime; | 852 Label runtime; |
| 853 __ movp(rdx, Operand(rbp, StandardFrameConstants::kCallerFPOffset)); | 853 __ movp(r8, Operand(rbp, StandardFrameConstants::kCallerFPOffset)); |
| 854 __ movp(rcx, Operand(rdx, StandardFrameConstants::kContextOffset)); | 854 __ movp(rax, Operand(r8, StandardFrameConstants::kContextOffset)); |
| 855 __ Cmp(rcx, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)); | 855 __ Cmp(rax, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)); |
| 856 __ j(not_equal, &runtime); | 856 __ j(not_equal, &runtime); |
| 857 | 857 |
| 858 // Patch the arguments.length and the parameters pointer. | 858 // Patch the arguments.length and the parameters pointer. |
| 859 StackArgumentsAccessor args(rsp, 4, ARGUMENTS_DONT_CONTAIN_RECEIVER); | 859 StackArgumentsAccessor args(rsp, 4, ARGUMENTS_DONT_CONTAIN_RECEIVER); |
| 860 __ movp(rcx, Operand(rdx, ArgumentsAdaptorFrameConstants::kLengthOffset)); | 860 __ movp(rcx, Operand(r8, ArgumentsAdaptorFrameConstants::kLengthOffset)); |
| 861 __ movp(args.GetArgumentOperand(1), rcx); | 861 __ SmiToInteger64(rax, rcx); |
| 862 __ SmiToInteger64(rcx, rcx); | 862 __ leap(rdx, Operand(r8, rax, times_pointer_size, |
| 863 __ leap(rdx, Operand(rdx, rcx, times_pointer_size, | |
| 864 StandardFrameConstants::kCallerSPOffset)); | 863 StandardFrameConstants::kCallerSPOffset)); |
| 865 __ movp(args.GetArgumentOperand(0), rdx); | |
| 866 | 864 |
| 867 __ bind(&runtime); | 865 __ bind(&runtime); |
| 866 __ PopReturnAddressTo(rax); |
| 867 __ Push(rcx); // Push number of parameters. |
| 868 __ Push(rdx); // Push parameters pointer. |
| 869 __ Push(rbx); // Push rest parameter index. |
| 870 __ Push(rdi); // Push language mode. |
| 871 __ PushReturnAddressFrom(rax); |
| 868 __ TailCallRuntime(Runtime::kNewRestParam); | 872 __ TailCallRuntime(Runtime::kNewRestParam); |
| 869 } | 873 } |
| 870 | 874 |
| 871 | 875 |
| 872 void LoadIndexedInterceptorStub::Generate(MacroAssembler* masm) { | 876 void LoadIndexedInterceptorStub::Generate(MacroAssembler* masm) { |
| 873 // Return address is on the stack. | 877 // Return address is on the stack. |
| 874 Label slow; | 878 Label slow; |
| 875 | 879 |
| 876 Register receiver = LoadDescriptor::ReceiverRegister(); | 880 Register receiver = LoadDescriptor::ReceiverRegister(); |
| 877 Register key = LoadDescriptor::NameRegister(); | 881 Register key = LoadDescriptor::NameRegister(); |
| (...skipping 4534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5412 kStackSpace, nullptr, return_value_operand, NULL); | 5416 kStackSpace, nullptr, return_value_operand, NULL); |
| 5413 } | 5417 } |
| 5414 | 5418 |
| 5415 | 5419 |
| 5416 #undef __ | 5420 #undef __ |
| 5417 | 5421 |
| 5418 } // namespace internal | 5422 } // namespace internal |
| 5419 } // namespace v8 | 5423 } // namespace v8 |
| 5420 | 5424 |
| 5421 #endif // V8_TARGET_ARCH_X64 | 5425 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |