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

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

Issue 1537683002: Partial revert of rest parameter desugaring. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix test failures. Created 5 years 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/code-stubs-arm.cc ('k') | src/ast/ast-literal-reindexer.h » ('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 2116 matching lines...) Expand 10 before | Expand all | Expand 10 after
2127 __ Bind(&done); 2127 __ Bind(&done);
2128 __ Ret(); 2128 __ Ret();
2129 2129
2130 // Do the runtime call to allocate the arguments object. 2130 // Do the runtime call to allocate the arguments object.
2131 __ Bind(&runtime); 2131 __ Bind(&runtime);
2132 __ Push(function, params, param_count_smi); 2132 __ Push(function, params, param_count_smi);
2133 __ TailCallRuntime(Runtime::kNewStrictArguments, 3, 1); 2133 __ TailCallRuntime(Runtime::kNewStrictArguments, 3, 1);
2134 } 2134 }
2135 2135
2136 2136
2137 void RestParamAccessStub::GenerateNew(MacroAssembler* masm) {
2138 // Stack layout on entry.
2139 // jssp[0]: language mode (tagged)
2140 // jssp[8]: index of rest parameter (tagged)
2141 // jssp[16]: number of parameters (tagged)
2142 // jssp[24]: address of receiver argument
2143 //
2144 // Returns pointer to result object in x0.
2145
2146 // Get the stub arguments from the frame, and make an untagged copy of the
2147 // parameter count.
2148 Register language_mode_smi = x1;
2149 Register rest_index_smi = x2;
2150 Register param_count_smi = x3;
2151 Register params = x4;
2152 Register param_count = x13;
2153 __ Pop(language_mode_smi, rest_index_smi, param_count_smi, params);
2154 __ SmiUntag(param_count, param_count_smi);
2155
2156 // Test if arguments adaptor needed.
2157 Register caller_fp = x11;
2158 Register caller_ctx = x12;
2159 Label runtime;
2160 __ Ldr(caller_fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset));
2161 __ Ldr(caller_ctx,
2162 MemOperand(caller_fp, StandardFrameConstants::kContextOffset));
2163 __ Cmp(caller_ctx, Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR));
2164 __ B(ne, &runtime);
2165
2166 // x1 language_mode_smi language mode
2167 // x2 rest_index_smi index of rest parameter
2168 // x3 param_count_smi number of parameters passed to function (smi)
2169 // x4 params pointer to parameters
2170 // x11 caller_fp caller's frame pointer
2171 // x13 param_count number of parameters passed to function
2172
2173 // Patch the argument length and parameters pointer.
2174 __ Ldr(param_count_smi,
2175 MemOperand(caller_fp, ArgumentsAdaptorFrameConstants::kLengthOffset));
2176 __ SmiUntag(param_count, param_count_smi);
2177 __ Add(x10, caller_fp, Operand(param_count, LSL, kPointerSizeLog2));
2178 __ Add(params, x10, StandardFrameConstants::kCallerSPOffset);
2179
2180 __ Bind(&runtime);
2181 __ Push(params, param_count_smi, rest_index_smi, language_mode_smi);
2182 __ TailCallRuntime(Runtime::kNewRestParam, 4, 1);
2183 }
2184
2185
2137 void RegExpExecStub::Generate(MacroAssembler* masm) { 2186 void RegExpExecStub::Generate(MacroAssembler* masm) {
2138 #ifdef V8_INTERPRETED_REGEXP 2187 #ifdef V8_INTERPRETED_REGEXP
2139 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1); 2188 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1);
2140 #else // V8_INTERPRETED_REGEXP 2189 #else // V8_INTERPRETED_REGEXP
2141 2190
2142 // Stack frame on entry. 2191 // Stack frame on entry.
2143 // jssp[0]: last_match_info (expected JSArray) 2192 // jssp[0]: last_match_info (expected JSArray)
2144 // jssp[8]: previous index 2193 // jssp[8]: previous index
2145 // jssp[16]: subject string 2194 // jssp[16]: subject string
2146 // jssp[24]: JSRegExp object 2195 // jssp[24]: JSRegExp object
(...skipping 3654 matching lines...) Expand 10 before | Expand all | Expand 10 after
5801 MemOperand(fp, 6 * kPointerSize), NULL); 5850 MemOperand(fp, 6 * kPointerSize), NULL);
5802 } 5851 }
5803 5852
5804 5853
5805 #undef __ 5854 #undef __
5806 5855
5807 } // namespace internal 5856 } // namespace internal
5808 } // namespace v8 5857 } // namespace v8
5809 5858
5810 #endif // V8_TARGET_ARCH_ARM64 5859 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | src/ast/ast-literal-reindexer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698