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