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

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

Issue 1272673003: [es6] Re-implement rest parameters via desugaring. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Use else-if (and rebase, sorry) Created 5 years, 3 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 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/code-factory.h" 7 #include "src/code-factory.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/compiler.h" 10 #include "src/compiler.h"
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 __ B(&done); 272 __ B(&done);
273 273
274 __ Bind(&non_construct_frame); 274 __ Bind(&non_construct_frame);
275 __ LoadRoot(x0, Heap::kUndefinedValueRootIndex); 275 __ LoadRoot(x0, Heap::kUndefinedValueRootIndex);
276 276
277 __ Bind(&done); 277 __ Bind(&done);
278 278
279 SetVar(new_target_var, x0, x2, x3); 279 SetVar(new_target_var, x0, x2, x3);
280 } 280 }
281 281
282 // Possibly allocate RestParameters
283 int rest_index;
284 Variable* rest_param = scope()->rest_parameter(&rest_index);
285 if (rest_param) {
286 Comment cmnt(masm_, "[ Allocate rest parameter array");
287
288 int num_parameters = info->scope()->num_parameters();
289 int offset = num_parameters * kPointerSize;
290
291 __ Add(x3, fp, StandardFrameConstants::kCallerSPOffset + offset);
292 __ Mov(x2, Smi::FromInt(num_parameters));
293 __ Mov(x1, Smi::FromInt(rest_index));
294 __ Mov(x0, Smi::FromInt(language_mode()));
295 __ Push(x3, x2, x1, x0);
296
297 RestParamAccessStub stub(isolate());
298 __ CallStub(&stub);
299
300 SetVar(rest_param, x0, x1, x2);
301 }
302
303 Variable* arguments = scope()->arguments(); 282 Variable* arguments = scope()->arguments();
304 if (arguments != NULL) { 283 if (arguments != NULL) {
305 // Function uses arguments object. 284 // Function uses arguments object.
306 Comment cmnt(masm_, "[ Allocate arguments object"); 285 Comment cmnt(masm_, "[ Allocate arguments object");
307 if (!function_in_register_x1) { 286 if (!function_in_register_x1) {
308 // Load this again, if it's used by the local context below. 287 // Load this again, if it's used by the local context below.
309 __ Ldr(x3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); 288 __ Ldr(x3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
310 } else { 289 } else {
311 __ Mov(x3, x1); 290 __ Mov(x3, x1);
312 } 291 }
(...skipping 5044 matching lines...) Expand 10 before | Expand all | Expand 10 after
5357 } 5336 }
5358 5337
5359 return INTERRUPT; 5338 return INTERRUPT;
5360 } 5339 }
5361 5340
5362 5341
5363 } // namespace internal 5342 } // namespace internal
5364 } // namespace v8 5343 } // namespace v8
5365 5344
5366 #endif // V8_TARGET_ARCH_ARM64 5345 #endif // V8_TARGET_ARCH_ARM64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698