Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Side by Side Diff: src/x87/code-stubs-x87.cc

Issue 929763002: X87: Implement ES6 rest parameters. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/x87/full-codegen-x87.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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_X87 7 #if V8_TARGET_ARCH_X87
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 // Return and remove the on-stack parameters. 833 // Return and remove the on-stack parameters.
834 __ bind(&done); 834 __ bind(&done);
835 __ ret(3 * kPointerSize); 835 __ ret(3 * kPointerSize);
836 836
837 // Do the runtime call to allocate the arguments object. 837 // Do the runtime call to allocate the arguments object.
838 __ bind(&runtime); 838 __ bind(&runtime);
839 __ TailCallRuntime(Runtime::kNewStrictArguments, 3, 1); 839 __ TailCallRuntime(Runtime::kNewStrictArguments, 3, 1);
840 } 840 }
841 841
842 842
843 void RestParamAccessStub::GenerateNew(MacroAssembler* masm) {
844 // esp[0] : return address
845 // esp[4] : index of rest parameter
846 // esp[8] : number of parameters
847 // esp[12] : receiver displacement
848
849 // Check if the calling frame is an arguments adaptor frame.
850 Label runtime;
851 __ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset));
852 __ mov(ecx, Operand(edx, StandardFrameConstants::kContextOffset));
853 __ cmp(ecx, Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)));
854 __ j(not_equal, &runtime);
855
856 // Patch the arguments.length and the parameters pointer.
857 __ mov(ecx, Operand(edx, ArgumentsAdaptorFrameConstants::kLengthOffset));
858 __ mov(Operand(esp, 2 * kPointerSize), ecx);
859 __ lea(edx, Operand(edx, ecx, times_2,
860 StandardFrameConstants::kCallerSPOffset));
861 __ mov(Operand(esp, 3 * kPointerSize), edx);
862
863 __ bind(&runtime);
864 __ TailCallRuntime(Runtime::kNewRestParam, 3, 1);
865 }
866
867
843 void RegExpExecStub::Generate(MacroAssembler* masm) { 868 void RegExpExecStub::Generate(MacroAssembler* masm) {
844 // Just jump directly to runtime if native RegExp is not selected at compile 869 // Just jump directly to runtime if native RegExp is not selected at compile
845 // time or if regexp entry in generated code is turned off runtime switch or 870 // time or if regexp entry in generated code is turned off runtime switch or
846 // at compilation. 871 // at compilation.
847 #ifdef V8_INTERPRETED_REGEXP 872 #ifdef V8_INTERPRETED_REGEXP
848 __ TailCallRuntime(Runtime::kRegExpExecRT, 4, 1); 873 __ TailCallRuntime(Runtime::kRegExpExecRT, 4, 1);
849 #else // V8_INTERPRETED_REGEXP 874 #else // V8_INTERPRETED_REGEXP
850 875
851 // Stack frame on entry. 876 // Stack frame on entry.
852 // esp[0]: return address 877 // esp[0]: return address
(...skipping 3920 matching lines...) Expand 10 before | Expand all | Expand 10 after
4773 ApiParameterOperand(2), kStackSpace, nullptr, 4798 ApiParameterOperand(2), kStackSpace, nullptr,
4774 Operand(ebp, 7 * kPointerSize), NULL); 4799 Operand(ebp, 7 * kPointerSize), NULL);
4775 } 4800 }
4776 4801
4777 4802
4778 #undef __ 4803 #undef __
4779 4804
4780 } } // namespace v8::internal 4805 } } // namespace v8::internal
4781 4806
4782 #endif // V8_TARGET_ARCH_X87 4807 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « no previous file | src/x87/full-codegen-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698