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

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

Issue 1318523006: PPC: [es6] Re-implement rest parameters via desugaring. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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
« no previous file with comments | « no previous file | src/ppc/code-stubs-ppc.cc » ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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_PPC 5 #if V8_TARGET_ARCH_PPC
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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 r5, ConstructFrameConstants::kOriginalConstructorOffset)); 283 r5, ConstructFrameConstants::kOriginalConstructorOffset));
284 __ b(&done); 284 __ b(&done);
285 285
286 __ bind(&non_construct_frame); 286 __ bind(&non_construct_frame);
287 __ LoadRoot(r3, Heap::kUndefinedValueRootIndex); 287 __ LoadRoot(r3, Heap::kUndefinedValueRootIndex);
288 __ bind(&done); 288 __ bind(&done);
289 289
290 SetVar(new_target_var, r3, r5, r6); 290 SetVar(new_target_var, r3, r5, r6);
291 } 291 }
292 292
293 // Possibly allocate RestParameters
294 int rest_index;
295 Variable* rest_param = scope()->rest_parameter(&rest_index);
296 if (rest_param) {
297 Comment cmnt(masm_, "[ Allocate rest parameter array");
298
299 int num_parameters = info->scope()->num_parameters();
300 int offset = num_parameters * kPointerSize;
301
302 __ addi(r6, fp, Operand(StandardFrameConstants::kCallerSPOffset + offset));
303 __ LoadSmiLiteral(r5, Smi::FromInt(num_parameters));
304 __ LoadSmiLiteral(r4, Smi::FromInt(rest_index));
305 __ LoadSmiLiteral(r3, Smi::FromInt(language_mode()));
306 __ Push(r6, r5, r4, r3);
307 function_in_register_r4 = false;
308
309 RestParamAccessStub stub(isolate());
310 __ CallStub(&stub);
311
312 SetVar(rest_param, r3, r4, r5);
313 }
314
315 Variable* arguments = scope()->arguments(); 293 Variable* arguments = scope()->arguments();
316 if (arguments != NULL) { 294 if (arguments != NULL) {
317 // Function uses arguments object. 295 // Function uses arguments object.
318 Comment cmnt(masm_, "[ Allocate arguments object"); 296 Comment cmnt(masm_, "[ Allocate arguments object");
319 if (!function_in_register_r4) { 297 if (!function_in_register_r4) {
320 // Load this again, if it's used by the local context below. 298 // Load this again, if it's used by the local context below.
321 __ LoadP(r6, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); 299 __ LoadP(r6, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
322 } else { 300 } else {
323 __ mr(r6, r4); 301 __ mr(r6, r4);
324 } 302 }
(...skipping 4997 matching lines...) Expand 10 before | Expand all | Expand 10 after
5322 return ON_STACK_REPLACEMENT; 5300 return ON_STACK_REPLACEMENT;
5323 } 5301 }
5324 5302
5325 DCHECK(interrupt_address == 5303 DCHECK(interrupt_address ==
5326 isolate->builtins()->OsrAfterStackCheck()->entry()); 5304 isolate->builtins()->OsrAfterStackCheck()->entry());
5327 return OSR_AFTER_STACK_CHECK; 5305 return OSR_AFTER_STACK_CHECK;
5328 } 5306 }
5329 } // namespace internal 5307 } // namespace internal
5330 } // namespace v8 5308 } // namespace v8
5331 #endif // V8_TARGET_ARCH_PPC 5309 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « no previous file | src/ppc/code-stubs-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698