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

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

Issue 816913003: Implement ES6 rest parameters (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix typo in ARM port 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 | « src/arm/full-codegen-arm.cc ('k') | src/arm64/full-codegen-arm64.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 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_ARM64 7 #if V8_TARGET_ARCH_ARM64
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 2142 matching lines...) Expand 10 before | Expand all | Expand 10 after
2153 __ Bind(&done); 2153 __ Bind(&done);
2154 __ Ret(); 2154 __ Ret();
2155 2155
2156 // Do the runtime call to allocate the arguments object. 2156 // Do the runtime call to allocate the arguments object.
2157 __ Bind(&runtime); 2157 __ Bind(&runtime);
2158 __ Push(function, params, param_count_smi); 2158 __ Push(function, params, param_count_smi);
2159 __ TailCallRuntime(Runtime::kNewStrictArguments, 3, 1); 2159 __ TailCallRuntime(Runtime::kNewStrictArguments, 3, 1);
2160 } 2160 }
2161 2161
2162 2162
2163 void RestParamAccessStub::GenerateNew(MacroAssembler* masm) {
2164 // Stack layout on entry.
2165 // jssp[0]: index of rest parameter (tagged)
2166 // jssp[8]: number of parameters (tagged)
2167 // jssp[16]: address of receiver argument
2168 //
2169 // Returns pointer to result object in x0.
2170
2171 // Get the stub arguments from the frame, and make an untagged copy of the
2172 // parameter count.
2173 Register rest_index_smi = x1;
2174 Register param_count_smi = x2;
2175 Register params = x3;
2176 Register param_count = x13;
2177 __ Pop(rest_index_smi, param_count_smi, params);
2178 __ SmiUntag(param_count, param_count_smi);
2179
2180 // Test if arguments adaptor needed.
2181 Register caller_fp = x11;
2182 Register caller_ctx = x12;
2183 Label runtime;
2184 __ Ldr(caller_fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
2185 __ Ldr(caller_ctx, MemOperand(caller_fp,
2186 StandardFrameConstants::kContextOffset));
2187 __ Cmp(caller_ctx, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR));
2188 __ B(ne, &runtime);
2189
2190 // x1 rest_index_smi index of rest parameter
2191 // x2 param_count_smi number of parameters passed to function (smi)
2192 // x3 params pointer to parameters
2193 // x11 caller_fp caller's frame pointer
2194 // x13 param_count number of parameters passed to function
2195
2196 // Patch the argument length and parameters pointer.
2197 __ Ldr(param_count_smi,
2198 MemOperand(caller_fp,
2199 ArgumentsAdaptorFrameConstants::kLengthOffset));
2200 __ SmiUntag(param_count, param_count_smi);
2201 __ Add(x10, caller_fp, Operand(param_count, LSL, kPointerSizeLog2));
2202 __ Add(params, x10, StandardFrameConstants::kCallerSPOffset);
2203
2204 __ Bind(&runtime);
2205 __ Push(params, param_count_smi, rest_index_smi);
2206 __ TailCallRuntime(Runtime::kNewRestParam, 3, 1);
2207 }
2208
2209
2163 void RegExpExecStub::Generate(MacroAssembler* masm) { 2210 void RegExpExecStub::Generate(MacroAssembler* masm) {
2164 #ifdef V8_INTERPRETED_REGEXP 2211 #ifdef V8_INTERPRETED_REGEXP
2165 __ TailCallRuntime(Runtime::kRegExpExecRT, 4, 1); 2212 __ TailCallRuntime(Runtime::kRegExpExecRT, 4, 1);
2166 #else // V8_INTERPRETED_REGEXP 2213 #else // V8_INTERPRETED_REGEXP
2167 2214
2168 // Stack frame on entry. 2215 // Stack frame on entry.
2169 // jssp[0]: last_match_info (expected JSArray) 2216 // jssp[0]: last_match_info (expected JSArray)
2170 // jssp[8]: previous index 2217 // jssp[8]: previous index
2171 // jssp[16]: subject string 2218 // jssp[16]: subject string
2172 // jssp[24]: JSRegExp object 2219 // jssp[24]: JSRegExp object
(...skipping 3261 matching lines...) Expand 10 before | Expand all | Expand 10 after
5434 kStackUnwindSpace, NULL, spill_offset, 5481 kStackUnwindSpace, NULL, spill_offset,
5435 MemOperand(fp, 6 * kPointerSize), NULL); 5482 MemOperand(fp, 6 * kPointerSize), NULL);
5436 } 5483 }
5437 5484
5438 5485
5439 #undef __ 5486 #undef __
5440 5487
5441 } } // namespace v8::internal 5488 } } // namespace v8::internal
5442 5489
5443 #endif // V8_TARGET_ARCH_ARM64 5490 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/arm/full-codegen-arm.cc ('k') | src/arm64/full-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698