| 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 2186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2197 __ Bind(&done); | 2197 __ Bind(&done); |
| 2198 __ Ret(); | 2198 __ Ret(); |
| 2199 | 2199 |
| 2200 // Do the runtime call to allocate the arguments object. | 2200 // Do the runtime call to allocate the arguments object. |
| 2201 __ Bind(&runtime); | 2201 __ Bind(&runtime); |
| 2202 __ Push(function, params, param_count_smi); | 2202 __ Push(function, params, param_count_smi); |
| 2203 __ TailCallRuntime(Runtime::kNewStrictArguments, 3, 1); | 2203 __ TailCallRuntime(Runtime::kNewStrictArguments, 3, 1); |
| 2204 } | 2204 } |
| 2205 | 2205 |
| 2206 | 2206 |
| 2207 void RestParamAccessStub::GenerateNew(MacroAssembler* masm) { | |
| 2208 // Stack layout on entry. | |
| 2209 // jssp[0]: language mode (tagged) | |
| 2210 // jssp[8]: index of rest parameter (tagged) | |
| 2211 // jssp[16]: number of parameters (tagged) | |
| 2212 // jssp[24]: address of receiver argument | |
| 2213 // | |
| 2214 // Returns pointer to result object in x0. | |
| 2215 | |
| 2216 // Get the stub arguments from the frame, and make an untagged copy of the | |
| 2217 // parameter count. | |
| 2218 Register language_mode_smi = x1; | |
| 2219 Register rest_index_smi = x2; | |
| 2220 Register param_count_smi = x3; | |
| 2221 Register params = x4; | |
| 2222 Register param_count = x13; | |
| 2223 __ Pop(language_mode_smi, rest_index_smi, param_count_smi, params); | |
| 2224 __ SmiUntag(param_count, param_count_smi); | |
| 2225 | |
| 2226 // Test if arguments adaptor needed. | |
| 2227 Register caller_fp = x11; | |
| 2228 Register caller_ctx = x12; | |
| 2229 Label runtime; | |
| 2230 __ Ldr(caller_fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | |
| 2231 __ Ldr(caller_ctx, MemOperand(caller_fp, | |
| 2232 StandardFrameConstants::kContextOffset)); | |
| 2233 __ Cmp(caller_ctx, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)); | |
| 2234 __ B(ne, &runtime); | |
| 2235 | |
| 2236 // x1 language_mode_smi language mode | |
| 2237 // x2 rest_index_smi index of rest parameter | |
| 2238 // x3 param_count_smi number of parameters passed to function (smi) | |
| 2239 // x4 params pointer to parameters | |
| 2240 // x11 caller_fp caller's frame pointer | |
| 2241 // x13 param_count number of parameters passed to function | |
| 2242 | |
| 2243 // Patch the argument length and parameters pointer. | |
| 2244 __ Ldr(param_count_smi, | |
| 2245 MemOperand(caller_fp, | |
| 2246 ArgumentsAdaptorFrameConstants::kLengthOffset)); | |
| 2247 __ SmiUntag(param_count, param_count_smi); | |
| 2248 __ Add(x10, caller_fp, Operand(param_count, LSL, kPointerSizeLog2)); | |
| 2249 __ Add(params, x10, StandardFrameConstants::kCallerSPOffset); | |
| 2250 | |
| 2251 __ Bind(&runtime); | |
| 2252 __ Push(params, param_count_smi, rest_index_smi, language_mode_smi); | |
| 2253 __ TailCallRuntime(Runtime::kNewRestParam, 4, 1); | |
| 2254 } | |
| 2255 | |
| 2256 | |
| 2257 void RegExpExecStub::Generate(MacroAssembler* masm) { | 2207 void RegExpExecStub::Generate(MacroAssembler* masm) { |
| 2258 #ifdef V8_INTERPRETED_REGEXP | 2208 #ifdef V8_INTERPRETED_REGEXP |
| 2259 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1); | 2209 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1); |
| 2260 #else // V8_INTERPRETED_REGEXP | 2210 #else // V8_INTERPRETED_REGEXP |
| 2261 | 2211 |
| 2262 // Stack frame on entry. | 2212 // Stack frame on entry. |
| 2263 // jssp[0]: last_match_info (expected JSArray) | 2213 // jssp[0]: last_match_info (expected JSArray) |
| 2264 // jssp[8]: previous index | 2214 // jssp[8]: previous index |
| 2265 // jssp[16]: subject string | 2215 // jssp[16]: subject string |
| 2266 // jssp[24]: JSRegExp object | 2216 // jssp[24]: JSRegExp object |
| (...skipping 3730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5997 MemOperand(fp, 6 * kPointerSize), NULL); | 5947 MemOperand(fp, 6 * kPointerSize), NULL); |
| 5998 } | 5948 } |
| 5999 | 5949 |
| 6000 | 5950 |
| 6001 #undef __ | 5951 #undef __ |
| 6002 | 5952 |
| 6003 } // namespace internal | 5953 } // namespace internal |
| 6004 } // namespace v8 | 5954 } // namespace v8 |
| 6005 | 5955 |
| 6006 #endif // V8_TARGET_ARCH_ARM64 | 5956 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |