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

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

Issue 816913003: Implement ES6 rest parameters (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Disable optimization of functions with rest parameters in parser 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/arm/full-codegen-arm.cc » ('j') | src/arm64/full-codegen-arm64.cc » ('J')
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_ARM 7 #if V8_TARGET_ARCH_ARM
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 1874 matching lines...) Expand 10 before | Expand all | Expand 10 after
1885 __ bind(&done); 1885 __ bind(&done);
1886 __ add(sp, sp, Operand(3 * kPointerSize)); 1886 __ add(sp, sp, Operand(3 * kPointerSize));
1887 __ Ret(); 1887 __ Ret();
1888 1888
1889 // Do the runtime call to allocate the arguments object. 1889 // Do the runtime call to allocate the arguments object.
1890 __ bind(&runtime); 1890 __ bind(&runtime);
1891 __ TailCallRuntime(Runtime::kNewStrictArguments, 3, 1); 1891 __ TailCallRuntime(Runtime::kNewStrictArguments, 3, 1);
1892 } 1892 }
1893 1893
1894 1894
1895 void RestParamAccessStub::GenerateNew(MacroAssembler* masm) {
1896 // Stack layout on entry.
1897 // sp[0] : index of rest parameter
1898 // sp[4] : number of parameters
1899 // sp[8] : receiver displacement
1900 //
1901
1902 Label runtime;
1903 __ ldr(r2, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
1904 __ ldr(r3, MemOperand(r2, StandardFrameConstants::kContextOffset));
1905 __ cmp(r3, Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)));
1906 __ b(ne, &runtime);
1907
1908 // Patch the arguments.length and the parameters pointer.
1909 __ ldr(r1, MemOperand(r2, ArgumentsAdaptorFrameConstants::kLengthOffset));
1910 __ str(r1, MemOperand(sp, 1 * kPointerSize));
1911 __ add(r3, r2, Operand::PointerOffsetFromSmiKey(r1));
1912 __ add(r3, r3, Operand(StandardFrameConstants::kCallerSPOffset));
1913 __ str(r3, MemOperand(sp, 2 * kPointerSize));
1914
1915 __ bind(&runtime);
1916 __ TailCallRuntime(Runtime::kNewRestParam, 3, 1);
1917 }
1918
1919
1895 void RegExpExecStub::Generate(MacroAssembler* masm) { 1920 void RegExpExecStub::Generate(MacroAssembler* masm) {
1896 // Just jump directly to runtime if native RegExp is not selected at compile 1921 // Just jump directly to runtime if native RegExp is not selected at compile
1897 // time or if regexp entry in generated code is turned off runtime switch or 1922 // time or if regexp entry in generated code is turned off runtime switch or
1898 // at compilation. 1923 // at compilation.
1899 #ifdef V8_INTERPRETED_REGEXP 1924 #ifdef V8_INTERPRETED_REGEXP
1900 __ TailCallRuntime(Runtime::kRegExpExecRT, 4, 1); 1925 __ TailCallRuntime(Runtime::kRegExpExecRT, 4, 1);
1901 #else // V8_INTERPRETED_REGEXP 1926 #else // V8_INTERPRETED_REGEXP
1902 1927
1903 // Stack frame on entry. 1928 // Stack frame on entry.
1904 // sp[0]: last_match_info (expected JSArray) 1929 // sp[0]: last_match_info (expected JSArray)
(...skipping 3058 matching lines...) Expand 10 before | Expand all | Expand 10 after
4963 kStackUnwindSpace, NULL, 4988 kStackUnwindSpace, NULL,
4964 MemOperand(fp, 6 * kPointerSize), NULL); 4989 MemOperand(fp, 6 * kPointerSize), NULL);
4965 } 4990 }
4966 4991
4967 4992
4968 #undef __ 4993 #undef __
4969 4994
4970 } } // namespace v8::internal 4995 } } // namespace v8::internal
4971 4996
4972 #endif // V8_TARGET_ARCH_ARM 4997 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm/full-codegen-arm.cc » ('j') | src/arm64/full-codegen-arm64.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698