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

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

Issue 1556913002: Use register arguments for RestParamAccessStub (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Ports. Created 4 years, 11 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/interface-descriptors-arm.cc ('k') | src/arm64/interface-descriptors-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 #if V8_TARGET_ARCH_ARM64 5 #if V8_TARGET_ARCH_ARM64
6 6
7 #include "src/bootstrapper.h" 7 #include "src/bootstrapper.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/codegen.h" 9 #include "src/codegen.h"
10 #include "src/ic/handler-compiler.h" 10 #include "src/ic/handler-compiler.h"
(...skipping 2104 matching lines...) Expand 10 before | Expand all | Expand 10 after
2115 __ Ret(); 2115 __ Ret();
2116 2116
2117 // Do the runtime call to allocate the arguments object. 2117 // Do the runtime call to allocate the arguments object.
2118 __ Bind(&runtime); 2118 __ Bind(&runtime);
2119 __ Push(function, params, param_count_smi); 2119 __ Push(function, params, param_count_smi);
2120 __ TailCallRuntime(Runtime::kNewStrictArguments); 2120 __ TailCallRuntime(Runtime::kNewStrictArguments);
2121 } 2121 }
2122 2122
2123 2123
2124 void RestParamAccessStub::GenerateNew(MacroAssembler* masm) { 2124 void RestParamAccessStub::GenerateNew(MacroAssembler* masm) {
2125 // Stack layout on entry. 2125 // x2 : number of parameters (tagged)
2126 // jssp[0]: language mode (tagged) 2126 // x3 : parameters pointer
2127 // jssp[8]: index of rest parameter (tagged) 2127 // x4 : rest parameter index (tagged)
2128 // jssp[16]: number of parameters (tagged) 2128 // x1 : language mode (tagged)
2129 // jssp[24]: address of receiver argument
2130 // 2129 //
2131 // Returns pointer to result object in x0. 2130 // Returns pointer to result object in x0.
2132 2131
2132 DCHECK(x2.is(ArgumentsAccessNewDescriptor::parameter_count()));
2133 DCHECK(x3.is(RestParamAccessDescriptor::parameter_pointer()));
2134 DCHECK(x4.is(RestParamAccessDescriptor::rest_parameter_index()));
2135 DCHECK(x1.is(RestParamAccessDescriptor::language_mode()));
2136
2133 // Get the stub arguments from the frame, and make an untagged copy of the 2137 // Get the stub arguments from the frame, and make an untagged copy of the
2134 // parameter count. 2138 // parameter count.
2135 Register language_mode_smi = x1; 2139 Register language_mode_smi = x1;
2136 Register rest_index_smi = x2; 2140 Register rest_index_smi = x4;
2137 Register param_count_smi = x3; 2141 Register param_count_smi = x2;
2138 Register params = x4; 2142 Register params = x3;
2139 Register param_count = x13; 2143 Register param_count = x13;
2140 __ Pop(language_mode_smi, rest_index_smi, param_count_smi, params);
2141 __ SmiUntag(param_count, param_count_smi); 2144 __ SmiUntag(param_count, param_count_smi);
2142 2145
2143 // Test if arguments adaptor needed. 2146 // Test if arguments adaptor needed.
2144 Register caller_fp = x11; 2147 Register caller_fp = x11;
2145 Register caller_ctx = x12; 2148 Register caller_ctx = x12;
2146 Label runtime; 2149 Label runtime;
2147 __ Ldr(caller_fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); 2150 __ Ldr(caller_fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
2148 __ Ldr(caller_ctx, 2151 __ Ldr(caller_ctx,
2149 MemOperand(caller_fp, StandardFrameConstants::kContextOffset)); 2152 MemOperand(caller_fp, StandardFrameConstants::kContextOffset));
2150 __ Cmp(caller_ctx, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)); 2153 __ Cmp(caller_ctx, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR));
2151 __ B(ne, &runtime); 2154 __ B(ne, &runtime);
2152 2155
2153 // x1 language_mode_smi language mode 2156 // x1 language_mode_smi language mode
2154 // x2 rest_index_smi index of rest parameter 2157 // x4 rest_index_smi index of rest parameter
2155 // x3 param_count_smi number of parameters passed to function (smi) 2158 // x2 param_count_smi number of parameters passed to function (smi)
2156 // x4 params pointer to parameters 2159 // x3 params pointer to parameters
2157 // x11 caller_fp caller's frame pointer 2160 // x11 caller_fp caller's frame pointer
2158 // x13 param_count number of parameters passed to function 2161 // x13 param_count number of parameters passed to function
2159 2162
2160 // Patch the argument length and parameters pointer. 2163 // Patch the argument length and parameters pointer.
2161 __ Ldr(param_count_smi, 2164 __ Ldr(param_count_smi,
2162 MemOperand(caller_fp, ArgumentsAdaptorFrameConstants::kLengthOffset)); 2165 MemOperand(caller_fp, ArgumentsAdaptorFrameConstants::kLengthOffset));
2163 __ SmiUntag(param_count, param_count_smi); 2166 __ SmiUntag(param_count, param_count_smi);
2164 __ Add(x10, caller_fp, Operand(param_count, LSL, kPointerSizeLog2)); 2167 __ Add(x10, caller_fp, Operand(param_count, LSL, kPointerSizeLog2));
2165 __ Add(params, x10, StandardFrameConstants::kCallerSPOffset); 2168 __ Add(params, x10, StandardFrameConstants::kCallerSPOffset);
2166 2169
2167 __ Bind(&runtime); 2170 __ Bind(&runtime);
2168 __ Push(params, param_count_smi, rest_index_smi, language_mode_smi); 2171 __ Push(param_count_smi, params, rest_index_smi, language_mode_smi);
2169 __ TailCallRuntime(Runtime::kNewRestParam); 2172 __ TailCallRuntime(Runtime::kNewRestParam);
2170 } 2173 }
2171 2174
2172 2175
2173 void RegExpExecStub::Generate(MacroAssembler* masm) { 2176 void RegExpExecStub::Generate(MacroAssembler* masm) {
2174 #ifdef V8_INTERPRETED_REGEXP 2177 #ifdef V8_INTERPRETED_REGEXP
2175 __ TailCallRuntime(Runtime::kRegExpExec); 2178 __ TailCallRuntime(Runtime::kRegExpExec);
2176 #else // V8_INTERPRETED_REGEXP 2179 #else // V8_INTERPRETED_REGEXP
2177 2180
2178 // Stack frame on entry. 2181 // Stack frame on entry.
(...skipping 3657 matching lines...) Expand 10 before | Expand all | Expand 10 after
5836 MemOperand(fp, 6 * kPointerSize), NULL); 5839 MemOperand(fp, 6 * kPointerSize), NULL);
5837 } 5840 }
5838 5841
5839 5842
5840 #undef __ 5843 #undef __
5841 5844
5842 } // namespace internal 5845 } // namespace internal
5843 } // namespace v8 5846 } // namespace v8
5844 5847
5845 #endif // V8_TARGET_ARCH_ARM64 5848 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/arm/interface-descriptors-arm.cc ('k') | src/arm64/interface-descriptors-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698