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

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

Issue 1549743003: PPC: Partial revert of rest parameter desugaring. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 | « 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/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 SetVar(this_function_var, r4, r3, r5); 257 SetVar(this_function_var, r4, r3, r5);
258 } 258 }
259 259
260 // Possibly set up a local binding to the new target value. 260 // Possibly set up a local binding to the new target value.
261 Variable* new_target_var = scope()->new_target_var(); 261 Variable* new_target_var = scope()->new_target_var();
262 if (new_target_var != nullptr) { 262 if (new_target_var != nullptr) {
263 Comment cmnt(masm_, "[ new.target"); 263 Comment cmnt(masm_, "[ new.target");
264 SetVar(new_target_var, r6, r3, r5); 264 SetVar(new_target_var, r6, r3, r5);
265 } 265 }
266 266
267 // Possibly allocate RestParameters
268 int rest_index;
269 Variable* rest_param = scope()->rest_parameter(&rest_index);
270 if (rest_param) {
271 Comment cmnt(masm_, "[ Allocate rest parameter array");
272
273 int num_parameters = info->scope()->num_parameters();
274 int offset = num_parameters * kPointerSize;
275
276 __ addi(r6, fp, Operand(StandardFrameConstants::kCallerSPOffset + offset));
277 __ LoadSmiLiteral(r5, Smi::FromInt(num_parameters));
278 __ LoadSmiLiteral(r4, Smi::FromInt(rest_index));
279 __ LoadSmiLiteral(r3, Smi::FromInt(language_mode()));
280 __ Push(r6, r5, r4, r3);
281 function_in_register_r4 = false;
282
283 RestParamAccessStub stub(isolate());
284 __ CallStub(&stub);
285
286 SetVar(rest_param, r3, r4, r5);
287 }
288
267 Variable* arguments = scope()->arguments(); 289 Variable* arguments = scope()->arguments();
268 if (arguments != NULL) { 290 if (arguments != NULL) {
269 // Function uses arguments object. 291 // Function uses arguments object.
270 Comment cmnt(masm_, "[ Allocate arguments object"); 292 Comment cmnt(masm_, "[ Allocate arguments object");
271 DCHECK(r4.is(ArgumentsAccessNewDescriptor::function())); 293 DCHECK(r4.is(ArgumentsAccessNewDescriptor::function()));
272 if (!function_in_register_r4) { 294 if (!function_in_register_r4) {
273 // Load this again, if it's used by the local context below. 295 // Load this again, if it's used by the local context below.
274 __ LoadP(r4, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); 296 __ LoadP(r4, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
275 } 297 }
276 // Receiver is just before the parameters on the caller's stack. 298 // Receiver is just before the parameters on the caller's stack.
(...skipping 4559 matching lines...) Expand 10 before | Expand all | Expand 10 after
4836 return ON_STACK_REPLACEMENT; 4858 return ON_STACK_REPLACEMENT;
4837 } 4859 }
4838 4860
4839 DCHECK(interrupt_address == 4861 DCHECK(interrupt_address ==
4840 isolate->builtins()->OsrAfterStackCheck()->entry()); 4862 isolate->builtins()->OsrAfterStackCheck()->entry());
4841 return OSR_AFTER_STACK_CHECK; 4863 return OSR_AFTER_STACK_CHECK;
4842 } 4864 }
4843 } // namespace internal 4865 } // namespace internal
4844 } // namespace v8 4866 } // namespace v8
4845 #endif // V8_TARGET_ARCH_PPC 4867 #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