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

Side by Side Diff: src/full-codegen/arm/full-codegen-arm.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 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/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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 MemOperand(r2, ConstructFrameConstants::kOriginalConstructorOffset)); 264 MemOperand(r2, ConstructFrameConstants::kOriginalConstructorOffset));
265 __ b(&done); 265 __ b(&done);
266 266
267 __ bind(&non_construct_frame); 267 __ bind(&non_construct_frame);
268 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); 268 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex);
269 __ bind(&done); 269 __ bind(&done);
270 270
271 SetVar(new_target_var, r0, r2, r3); 271 SetVar(new_target_var, r0, r2, r3);
272 } 272 }
273 273
274 // Possibly allocate RestParameters
275 int rest_index;
276 Variable* rest_param = scope()->rest_parameter(&rest_index);
277 if (rest_param) {
278 Comment cmnt(masm_, "[ Allocate rest parameter array");
279
280 int num_parameters = info->scope()->num_parameters();
281 int offset = num_parameters * kPointerSize;
282
283 __ add(r3, fp, Operand(StandardFrameConstants::kCallerSPOffset + offset));
284 __ mov(r2, Operand(Smi::FromInt(num_parameters)));
285 __ mov(r1, Operand(Smi::FromInt(rest_index)));
286 __ mov(r0, Operand(Smi::FromInt(language_mode())));
287 __ Push(r3, r2, r1, r0);
288
289 RestParamAccessStub stub(isolate());
290 __ CallStub(&stub);
291
292 SetVar(rest_param, r0, r1, r2);
293 }
294
295 Variable* arguments = scope()->arguments(); 274 Variable* arguments = scope()->arguments();
296 if (arguments != NULL) { 275 if (arguments != NULL) {
297 // Function uses arguments object. 276 // Function uses arguments object.
298 Comment cmnt(masm_, "[ Allocate arguments object"); 277 Comment cmnt(masm_, "[ Allocate arguments object");
299 if (!function_in_register) { 278 if (!function_in_register) {
300 // Load this again, if it's used by the local context below. 279 // Load this again, if it's used by the local context below.
301 __ ldr(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); 280 __ ldr(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
302 } else { 281 } else {
303 __ mov(r3, r1); 282 __ mov(r3, r1);
304 } 283 }
(...skipping 5063 matching lines...) Expand 10 before | Expand all | Expand 10 after
5368 DCHECK(interrupt_address == 5347 DCHECK(interrupt_address ==
5369 isolate->builtins()->OsrAfterStackCheck()->entry()); 5348 isolate->builtins()->OsrAfterStackCheck()->entry());
5370 return OSR_AFTER_STACK_CHECK; 5349 return OSR_AFTER_STACK_CHECK;
5371 } 5350 }
5372 5351
5373 5352
5374 } // namespace internal 5353 } // namespace internal
5375 } // namespace v8 5354 } // namespace v8
5376 5355
5377 #endif // V8_TARGET_ARCH_ARM 5356 #endif // V8_TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698