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

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

Issue 1235153006: [es6] re-implement rest parameters via desugaring (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Refactor Scope::TempScope Created 5 years, 5 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 2181 matching lines...) Expand 10 before | Expand all | Expand 10 after
2192 __ Bind(&done); 2192 __ Bind(&done);
2193 __ Ret(); 2193 __ Ret();
2194 2194
2195 // Do the runtime call to allocate the arguments object. 2195 // Do the runtime call to allocate the arguments object.
2196 __ Bind(&runtime); 2196 __ Bind(&runtime);
2197 __ Push(function, params, param_count_smi); 2197 __ Push(function, params, param_count_smi);
2198 __ TailCallRuntime(Runtime::kNewStrictArguments, 3, 1); 2198 __ TailCallRuntime(Runtime::kNewStrictArguments, 3, 1);
2199 } 2199 }
2200 2200
2201 2201
2202 void RestParamAccessStub::GenerateNew(MacroAssembler* masm) {
2203 // Stack layout on entry.
2204 // jssp[0]: language mode (tagged)
2205 // jssp[8]: index of rest parameter (tagged)
2206 // jssp[16]: number of parameters (tagged)
2207 // jssp[24]: address of receiver argument
2208 //
2209 // Returns pointer to result object in x0.
2210
2211 // Get the stub arguments from the frame, and make an untagged copy of the
2212 // parameter count.
2213 Register language_mode_smi = x1;
2214 Register rest_index_smi = x2;
2215 Register param_count_smi = x3;
2216 Register params = x4;
2217 Register param_count = x13;
2218 __ Pop(language_mode_smi, rest_index_smi, param_count_smi, params);
2219 __ SmiUntag(param_count, param_count_smi);
2220
2221 // Test if arguments adaptor needed.
2222 Register caller_fp = x11;
2223 Register caller_ctx = x12;
2224 Label runtime;
2225 __ Ldr(caller_fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
2226 __ Ldr(caller_ctx, MemOperand(caller_fp,
2227 StandardFrameConstants::kContextOffset));
2228 __ Cmp(caller_ctx, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR));
2229 __ B(ne, &runtime);
2230
2231 // x1 language_mode_smi language mode
2232 // x2 rest_index_smi index of rest parameter
2233 // x3 param_count_smi number of parameters passed to function (smi)
2234 // x4 params pointer to parameters
2235 // x11 caller_fp caller's frame pointer
2236 // x13 param_count number of parameters passed to function
2237
2238 // Patch the argument length and parameters pointer.
2239 __ Ldr(param_count_smi,
2240 MemOperand(caller_fp,
2241 ArgumentsAdaptorFrameConstants::kLengthOffset));
2242 __ SmiUntag(param_count, param_count_smi);
2243 __ Add(x10, caller_fp, Operand(param_count, LSL, kPointerSizeLog2));
2244 __ Add(params, x10, StandardFrameConstants::kCallerSPOffset);
2245
2246 __ Bind(&runtime);
2247 __ Push(params, param_count_smi, rest_index_smi, language_mode_smi);
2248 __ TailCallRuntime(Runtime::kNewRestParam, 4, 1);
2249 }
2250
2251
2252 void RegExpExecStub::Generate(MacroAssembler* masm) { 2202 void RegExpExecStub::Generate(MacroAssembler* masm) {
2253 #ifdef V8_INTERPRETED_REGEXP 2203 #ifdef V8_INTERPRETED_REGEXP
2254 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1); 2204 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1);
2255 #else // V8_INTERPRETED_REGEXP 2205 #else // V8_INTERPRETED_REGEXP
2256 2206
2257 // Stack frame on entry. 2207 // Stack frame on entry.
2258 // jssp[0]: last_match_info (expected JSArray) 2208 // jssp[0]: last_match_info (expected JSArray)
2259 // jssp[8]: previous index 2209 // jssp[8]: previous index
2260 // jssp[16]: subject string 2210 // jssp[16]: subject string
2261 // jssp[24]: JSRegExp object 2211 // jssp[24]: JSRegExp object
(...skipping 3577 matching lines...) Expand 10 before | Expand all | Expand 10 after
5839 MemOperand(fp, 6 * kPointerSize), NULL); 5789 MemOperand(fp, 6 * kPointerSize), NULL);
5840 } 5790 }
5841 5791
5842 5792
5843 #undef __ 5793 #undef __
5844 5794
5845 } // namespace internal 5795 } // namespace internal
5846 } // namespace v8 5796 } // namespace v8
5847 5797
5848 #endif // V8_TARGET_ARCH_ARM64 5798 #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