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 #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/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
840 StandardFrameConstants::kCallerSPOffset)); | 840 StandardFrameConstants::kCallerSPOffset)); |
841 __ movp(args.GetArgumentOperand(1), rdx); | 841 __ movp(args.GetArgumentOperand(1), rdx); |
842 | 842 |
843 __ bind(&runtime); | 843 __ bind(&runtime); |
844 __ TailCallRuntime(Runtime::kNewSloppyArguments, 3, 1); | 844 __ TailCallRuntime(Runtime::kNewSloppyArguments, 3, 1); |
845 } | 845 } |
846 | 846 |
847 | 847 |
848 void RestParamAccessStub::GenerateNew(MacroAssembler* masm) { | 848 void RestParamAccessStub::GenerateNew(MacroAssembler* masm) { |
849 // rsp[0] : return address | 849 // rsp[0] : return address |
850 // rsp[8] : index of rest parameter | 850 // rsp[8] : language mode |
851 // rsp[16] : number of parameters | 851 // rsp[16] : index of rest parameter |
852 // rsp[24] : receiver displacement | 852 // rsp[24] : number of parameters |
| 853 // rsp[32] : receiver displacement |
853 | 854 |
854 // Check if the calling frame is an arguments adaptor frame. | 855 // Check if the calling frame is an arguments adaptor frame. |
855 Label runtime; | 856 Label runtime; |
856 __ movp(rdx, Operand(rbp, StandardFrameConstants::kCallerFPOffset)); | 857 __ movp(rdx, Operand(rbp, StandardFrameConstants::kCallerFPOffset)); |
857 __ movp(rcx, Operand(rdx, StandardFrameConstants::kContextOffset)); | 858 __ movp(rcx, Operand(rdx, StandardFrameConstants::kContextOffset)); |
858 __ Cmp(rcx, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)); | 859 __ Cmp(rcx, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)); |
859 __ j(not_equal, &runtime); | 860 __ j(not_equal, &runtime); |
860 | 861 |
861 // Patch the arguments.length and the parameters pointer. | 862 // Patch the arguments.length and the parameters pointer. |
862 StackArgumentsAccessor args(rsp, 3, ARGUMENTS_DONT_CONTAIN_RECEIVER); | 863 StackArgumentsAccessor args(rsp, 4, ARGUMENTS_DONT_CONTAIN_RECEIVER); |
863 __ movp(rcx, Operand(rdx, ArgumentsAdaptorFrameConstants::kLengthOffset)); | 864 __ movp(rcx, Operand(rdx, ArgumentsAdaptorFrameConstants::kLengthOffset)); |
864 __ movp(args.GetArgumentOperand(1), rcx); | 865 __ movp(args.GetArgumentOperand(1), rcx); |
865 __ SmiToInteger64(rcx, rcx); | 866 __ SmiToInteger64(rcx, rcx); |
866 __ leap(rdx, Operand(rdx, rcx, times_pointer_size, | 867 __ leap(rdx, Operand(rdx, rcx, times_pointer_size, |
867 StandardFrameConstants::kCallerSPOffset)); | 868 StandardFrameConstants::kCallerSPOffset)); |
868 __ movp(args.GetArgumentOperand(0), rdx); | 869 __ movp(args.GetArgumentOperand(0), rdx); |
869 | 870 |
870 __ bind(&runtime); | 871 __ bind(&runtime); |
871 __ TailCallRuntime(Runtime::kNewRestParam, 3, 1); | 872 __ TailCallRuntime(Runtime::kNewRestParam, 4, 1); |
872 } | 873 } |
873 | 874 |
874 | 875 |
875 void LoadIndexedInterceptorStub::Generate(MacroAssembler* masm) { | 876 void LoadIndexedInterceptorStub::Generate(MacroAssembler* masm) { |
876 // Return address is on the stack. | 877 // Return address is on the stack. |
877 Label slow; | 878 Label slow; |
878 | 879 |
879 Register receiver = LoadDescriptor::ReceiverRegister(); | 880 Register receiver = LoadDescriptor::ReceiverRegister(); |
880 Register key = LoadDescriptor::NameRegister(); | 881 Register key = LoadDescriptor::NameRegister(); |
881 Register scratch = rax; | 882 Register scratch = rax; |
(...skipping 4541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5423 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, getter_arg, | 5424 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, getter_arg, |
5424 kStackSpace, nullptr, return_value_operand, NULL); | 5425 kStackSpace, nullptr, return_value_operand, NULL); |
5425 } | 5426 } |
5426 | 5427 |
5427 | 5428 |
5428 #undef __ | 5429 #undef __ |
5429 | 5430 |
5430 } } // namespace v8::internal | 5431 } } // namespace v8::internal |
5431 | 5432 |
5432 #endif // V8_TARGET_ARCH_X64 | 5433 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |