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 #if V8_TARGET_ARCH_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
6 | 6 |
7 #include "src/arm64/frames-arm64.h" | 7 #include "src/arm64/frames-arm64.h" |
8 #include "src/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 2098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2109 __ Bind(&done); | 2109 __ Bind(&done); |
2110 __ Ret(); | 2110 __ Ret(); |
2111 | 2111 |
2112 // Do the runtime call to allocate the arguments object. | 2112 // Do the runtime call to allocate the arguments object. |
2113 __ Bind(&runtime); | 2113 __ Bind(&runtime); |
2114 __ Push(function, params, param_count_smi); | 2114 __ Push(function, params, param_count_smi); |
2115 __ TailCallRuntime(Runtime::kNewStrictArguments, 3, 1); | 2115 __ TailCallRuntime(Runtime::kNewStrictArguments, 3, 1); |
2116 } | 2116 } |
2117 | 2117 |
2118 | 2118 |
2119 void RestParamAccessStub::GenerateNew(MacroAssembler* masm) { | |
2120 // Stack layout on entry. | |
2121 // jssp[0]: language mode (tagged) | |
2122 // jssp[8]: index of rest parameter (tagged) | |
2123 // jssp[16]: number of parameters (tagged) | |
2124 // jssp[24]: address of receiver argument | |
2125 // | |
2126 // Returns pointer to result object in x0. | |
2127 | |
2128 // Get the stub arguments from the frame, and make an untagged copy of the | |
2129 // parameter count. | |
2130 Register language_mode_smi = x1; | |
2131 Register rest_index_smi = x2; | |
2132 Register param_count_smi = x3; | |
2133 Register params = x4; | |
2134 Register param_count = x13; | |
2135 __ Pop(language_mode_smi, rest_index_smi, param_count_smi, params); | |
2136 __ SmiUntag(param_count, param_count_smi); | |
2137 | |
2138 // Test if arguments adaptor needed. | |
2139 Register caller_fp = x11; | |
2140 Register caller_ctx = x12; | |
2141 Label runtime; | |
2142 __ Ldr(caller_fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | |
2143 __ Ldr(caller_ctx, MemOperand(caller_fp, | |
2144 StandardFrameConstants::kContextOffset)); | |
2145 __ Cmp(caller_ctx, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR)); | |
2146 __ B(ne, &runtime); | |
2147 | |
2148 // x1 language_mode_smi language mode | |
2149 // x2 rest_index_smi index of rest parameter | |
2150 // x3 param_count_smi number of parameters passed to function (smi) | |
2151 // x4 params pointer to parameters | |
2152 // x11 caller_fp caller's frame pointer | |
2153 // x13 param_count number of parameters passed to function | |
2154 | |
2155 // Patch the argument length and parameters pointer. | |
2156 __ Ldr(param_count_smi, | |
2157 MemOperand(caller_fp, | |
2158 ArgumentsAdaptorFrameConstants::kLengthOffset)); | |
2159 __ SmiUntag(param_count, param_count_smi); | |
2160 __ Add(x10, caller_fp, Operand(param_count, LSL, kPointerSizeLog2)); | |
2161 __ Add(params, x10, StandardFrameConstants::kCallerSPOffset); | |
2162 | |
2163 __ Bind(&runtime); | |
2164 __ Push(params, param_count_smi, rest_index_smi, language_mode_smi); | |
2165 __ TailCallRuntime(Runtime::kNewRestParam, 4, 1); | |
2166 } | |
2167 | |
2168 | |
2169 void RegExpExecStub::Generate(MacroAssembler* masm) { | 2119 void RegExpExecStub::Generate(MacroAssembler* masm) { |
2170 #ifdef V8_INTERPRETED_REGEXP | 2120 #ifdef V8_INTERPRETED_REGEXP |
2171 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1); | 2121 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1); |
2172 #else // V8_INTERPRETED_REGEXP | 2122 #else // V8_INTERPRETED_REGEXP |
2173 | 2123 |
2174 // Stack frame on entry. | 2124 // Stack frame on entry. |
2175 // jssp[0]: last_match_info (expected JSArray) | 2125 // jssp[0]: last_match_info (expected JSArray) |
2176 // jssp[8]: previous index | 2126 // jssp[8]: previous index |
2177 // jssp[16]: subject string | 2127 // jssp[16]: subject string |
2178 // jssp[24]: JSRegExp object | 2128 // jssp[24]: JSRegExp object |
(...skipping 3732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5911 MemOperand(fp, 6 * kPointerSize), NULL); | 5861 MemOperand(fp, 6 * kPointerSize), NULL); |
5912 } | 5862 } |
5913 | 5863 |
5914 | 5864 |
5915 #undef __ | 5865 #undef __ |
5916 | 5866 |
5917 } // namespace internal | 5867 } // namespace internal |
5918 } // namespace v8 | 5868 } // namespace v8 |
5919 | 5869 |
5920 #endif // V8_TARGET_ARCH_ARM64 | 5870 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |