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 827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
838 __ SmiToInteger64(rcx, rcx); | 838 __ SmiToInteger64(rcx, rcx); |
839 __ leap(rdx, Operand(rdx, rcx, times_pointer_size, | 839 __ leap(rdx, Operand(rdx, rcx, times_pointer_size, |
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) { |
| 849 // rsp[0] : return address |
| 850 // rsp[8] : index of rest parameter |
| 851 // rsp[16] : number of parameters |
| 852 // rsp[24] : receiver displacement |
| 853 |
| 854 // Check if the calling frame is an arguments adaptor frame. |
| 855 Label runtime; |
| 856 __ movp(rdx, Operand(rbp, StandardFrameConstants::kCallerFPOffset)); |
| 857 __ movp(rcx, Operand(rdx, StandardFrameConstants::kContextOffset)); |
| 858 __ Cmp(rcx, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)); |
| 859 __ j(not_equal, &runtime); |
| 860 |
| 861 // Patch the arguments.length and the parameters pointer. |
| 862 StackArgumentsAccessor args(rsp, 3, ARGUMENTS_DONT_CONTAIN_RECEIVER); |
| 863 __ movp(rcx, Operand(rdx, ArgumentsAdaptorFrameConstants::kLengthOffset)); |
| 864 __ movp(args.GetArgumentOperand(1), rcx); |
| 865 __ SmiToInteger64(rcx, rcx); |
| 866 __ leap(rdx, Operand(rdx, rcx, times_pointer_size, |
| 867 StandardFrameConstants::kCallerSPOffset)); |
| 868 __ movp(args.GetArgumentOperand(0), rdx); |
| 869 |
| 870 __ bind(&runtime); |
| 871 __ TailCallRuntime(Runtime::kNewRestParam, 3, 1); |
| 872 } |
| 873 |
| 874 |
848 void LoadIndexedInterceptorStub::Generate(MacroAssembler* masm) { | 875 void LoadIndexedInterceptorStub::Generate(MacroAssembler* masm) { |
849 // Return address is on the stack. | 876 // Return address is on the stack. |
850 Label slow; | 877 Label slow; |
851 | 878 |
852 Register receiver = LoadDescriptor::ReceiverRegister(); | 879 Register receiver = LoadDescriptor::ReceiverRegister(); |
853 Register key = LoadDescriptor::NameRegister(); | 880 Register key = LoadDescriptor::NameRegister(); |
854 Register scratch = rax; | 881 Register scratch = rax; |
855 DCHECK(!scratch.is(receiver) && !scratch.is(key)); | 882 DCHECK(!scratch.is(receiver) && !scratch.is(key)); |
856 | 883 |
857 // Check that the key is an array index, that is Uint32. | 884 // Check that the key is an array index, that is Uint32. |
(...skipping 4211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5069 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, getter_arg, | 5096 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, getter_arg, |
5070 kStackSpace, nullptr, return_value_operand, NULL); | 5097 kStackSpace, nullptr, return_value_operand, NULL); |
5071 } | 5098 } |
5072 | 5099 |
5073 | 5100 |
5074 #undef __ | 5101 #undef __ |
5075 | 5102 |
5076 } } // namespace v8::internal | 5103 } } // namespace v8::internal |
5077 | 5104 |
5078 #endif // V8_TARGET_ARCH_X64 | 5105 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |