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