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

Side by Side Diff: src/full-codegen/arm/full-codegen-arm.cc

Issue 1676883002: [runtime] Optimize and unify rest parameters. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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_ARM 5 #if V8_TARGET_ARCH_ARM
6 6
7 #include "src/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 if (new_target_var != nullptr) { 257 if (new_target_var != nullptr) {
258 Comment cmnt(masm_, "[ new.target"); 258 Comment cmnt(masm_, "[ new.target");
259 SetVar(new_target_var, r3, r0, r2); 259 SetVar(new_target_var, r3, r0, r2);
260 } 260 }
261 261
262 // Possibly allocate RestParameters 262 // Possibly allocate RestParameters
263 int rest_index; 263 int rest_index;
264 Variable* rest_param = scope()->rest_parameter(&rest_index); 264 Variable* rest_param = scope()->rest_parameter(&rest_index);
265 if (rest_param) { 265 if (rest_param) {
266 Comment cmnt(masm_, "[ Allocate rest parameter array"); 266 Comment cmnt(masm_, "[ Allocate rest parameter array");
267 267 if (!function_in_register_r1) {
268 int num_parameters = info->scope()->num_parameters(); 268 __ ldr(r1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
269 int offset = num_parameters * kPointerSize; 269 }
270 270 FastNewRestParameterStub stub(isolate());
271 __ mov(RestParamAccessDescriptor::parameter_count(), 271 __ CallStub(&stub);
272 Operand(Smi::FromInt(num_parameters)));
273 __ add(RestParamAccessDescriptor::parameter_pointer(), fp,
274 Operand(StandardFrameConstants::kCallerSPOffset + offset));
275 __ mov(RestParamAccessDescriptor::rest_parameter_index(),
276 Operand(Smi::FromInt(rest_index)));
277 function_in_register_r1 = false; 272 function_in_register_r1 = false;
278
279 RestParamAccessStub stub(isolate());
280 __ CallStub(&stub);
281
282 SetVar(rest_param, r0, r1, r2); 273 SetVar(rest_param, r0, r1, r2);
283 } 274 }
284 275
285 Variable* arguments = scope()->arguments(); 276 Variable* arguments = scope()->arguments();
286 if (arguments != NULL) { 277 if (arguments != NULL) {
287 // Function uses arguments object. 278 // Function uses arguments object.
288 Comment cmnt(masm_, "[ Allocate arguments object"); 279 Comment cmnt(masm_, "[ Allocate arguments object");
289 DCHECK(r1.is(ArgumentsAccessNewDescriptor::function())); 280 DCHECK(r1.is(ArgumentsAccessNewDescriptor::function()));
290 if (!function_in_register_r1) { 281 if (!function_in_register_r1) {
291 // Load this again, if it's used by the local context below. 282 // Load this again, if it's used by the local context below.
(...skipping 4466 matching lines...) Expand 10 before | Expand all | Expand 10 after
4758 DCHECK(interrupt_address == 4749 DCHECK(interrupt_address ==
4759 isolate->builtins()->OsrAfterStackCheck()->entry()); 4750 isolate->builtins()->OsrAfterStackCheck()->entry());
4760 return OSR_AFTER_STACK_CHECK; 4751 return OSR_AFTER_STACK_CHECK;
4761 } 4752 }
4762 4753
4763 4754
4764 } // namespace internal 4755 } // namespace internal
4765 } // namespace v8 4756 } // namespace v8
4766 4757
4767 #endif // V8_TARGET_ARCH_ARM 4758 #endif // V8_TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698