OLD | NEW |
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 2175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2186 __ Bind(&done); | 2186 __ Bind(&done); |
2187 __ Ret(); | 2187 __ Ret(); |
2188 | 2188 |
2189 // Do the runtime call to allocate the arguments object. | 2189 // Do the runtime call to allocate the arguments object. |
2190 __ Bind(&runtime); | 2190 __ Bind(&runtime); |
2191 __ Push(function, params, param_count_smi); | 2191 __ Push(function, params, param_count_smi); |
2192 __ TailCallRuntime(Runtime::kNewStrictArguments, 3, 1); | 2192 __ TailCallRuntime(Runtime::kNewStrictArguments, 3, 1); |
2193 } | 2193 } |
2194 | 2194 |
2195 | 2195 |
2196 void RestParamAccessStub::GenerateNew(MacroAssembler* masm) { | |
2197 // Stack layout on entry. | |
2198 // jssp[0]: language mode (tagged) | |
2199 // jssp[8]: index of rest parameter (tagged) | |
2200 // jssp[16]: number of parameters (tagged) | |
2201 // jssp[24]: address of receiver argument | |
2202 // | |
2203 // Returns pointer to result object in x0. | |
2204 | |
2205 // Get the stub arguments from the frame, and make an untagged copy of the | |
2206 // parameter count. | |
2207 Register language_mode_smi = x1; | |
2208 Register rest_index_smi = x2; | |
2209 Register param_count_smi = x3; | |
2210 Register params = x4; | |
2211 Register param_count = x13; | |
2212 __ Pop(language_mode_smi, rest_index_smi, param_count_smi, params); | |
2213 __ SmiUntag(param_count, param_count_smi); | |
2214 | |
2215 // Test if arguments adaptor needed. | |
2216 Register caller_fp = x11; | |
2217 Register caller_ctx = x12; | |
2218 Label runtime; | |
2219 __ Ldr(caller_fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | |
2220 __ Ldr(caller_ctx, MemOperand(caller_fp, | |
2221 StandardFrameConstants::kContextOffset)); | |
2222 __ Cmp(caller_ctx, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)); | |
2223 __ B(ne, &runtime); | |
2224 | |
2225 // x1 language_mode_smi language mode | |
2226 // x2 rest_index_smi index of rest parameter | |
2227 // x3 param_count_smi number of parameters passed to function (smi) | |
2228 // x4 params pointer to parameters | |
2229 // x11 caller_fp caller's frame pointer | |
2230 // x13 param_count number of parameters passed to function | |
2231 | |
2232 // Patch the argument length and parameters pointer. | |
2233 __ Ldr(param_count_smi, | |
2234 MemOperand(caller_fp, | |
2235 ArgumentsAdaptorFrameConstants::kLengthOffset)); | |
2236 __ SmiUntag(param_count, param_count_smi); | |
2237 __ Add(x10, caller_fp, Operand(param_count, LSL, kPointerSizeLog2)); | |
2238 __ Add(params, x10, StandardFrameConstants::kCallerSPOffset); | |
2239 | |
2240 __ Bind(&runtime); | |
2241 __ Push(params, param_count_smi, rest_index_smi, language_mode_smi); | |
2242 __ TailCallRuntime(Runtime::kNewRestParam, 4, 1); | |
2243 } | |
2244 | |
2245 | |
2246 void RegExpExecStub::Generate(MacroAssembler* masm) { | 2196 void RegExpExecStub::Generate(MacroAssembler* masm) { |
2247 #ifdef V8_INTERPRETED_REGEXP | 2197 #ifdef V8_INTERPRETED_REGEXP |
2248 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1); | 2198 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1); |
2249 #else // V8_INTERPRETED_REGEXP | 2199 #else // V8_INTERPRETED_REGEXP |
2250 | 2200 |
2251 // Stack frame on entry. | 2201 // Stack frame on entry. |
2252 // jssp[0]: last_match_info (expected JSArray) | 2202 // jssp[0]: last_match_info (expected JSArray) |
2253 // jssp[8]: previous index | 2203 // jssp[8]: previous index |
2254 // jssp[16]: subject string | 2204 // jssp[16]: subject string |
2255 // jssp[24]: JSRegExp object | 2205 // jssp[24]: JSRegExp object |
(...skipping 3571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5827 MemOperand(fp, 6 * kPointerSize), NULL); | 5777 MemOperand(fp, 6 * kPointerSize), NULL); |
5828 } | 5778 } |
5829 | 5779 |
5830 | 5780 |
5831 #undef __ | 5781 #undef __ |
5832 | 5782 |
5833 } // namespace internal | 5783 } // namespace internal |
5834 } // namespace v8 | 5784 } // namespace v8 |
5835 | 5785 |
5836 #endif // V8_TARGET_ARCH_ARM64 | 5786 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |