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

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

Issue 1677223002: PPC: [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
« 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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 if (new_target_var != nullptr) { 256 if (new_target_var != nullptr) {
257 Comment cmnt(masm_, "[ new.target"); 257 Comment cmnt(masm_, "[ new.target");
258 SetVar(new_target_var, r6, r3, r5); 258 SetVar(new_target_var, r6, r3, r5);
259 } 259 }
260 260
261 // Possibly allocate RestParameters 261 // Possibly allocate RestParameters
262 int rest_index; 262 int rest_index;
263 Variable* rest_param = scope()->rest_parameter(&rest_index); 263 Variable* rest_param = scope()->rest_parameter(&rest_index);
264 if (rest_param) { 264 if (rest_param) {
265 Comment cmnt(masm_, "[ Allocate rest parameter array"); 265 Comment cmnt(masm_, "[ Allocate rest parameter array");
266 266 if (!function_in_register_r4) {
267 int num_parameters = info->scope()->num_parameters(); 267 __ LoadP(r4, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
268 int offset = num_parameters * kPointerSize; 268 }
269 269 FastNewRestParameterStub stub(isolate());
270 __ LoadSmiLiteral(RestParamAccessDescriptor::parameter_count(), 270 __ CallStub(&stub);
271 Smi::FromInt(num_parameters));
272 __ addi(RestParamAccessDescriptor::parameter_pointer(), fp,
273 Operand(StandardFrameConstants::kCallerSPOffset + offset));
274 __ LoadSmiLiteral(RestParamAccessDescriptor::rest_parameter_index(),
275 Smi::FromInt(rest_index));
276 function_in_register_r4 = false; 271 function_in_register_r4 = false;
277
278 RestParamAccessStub stub(isolate());
279 __ CallStub(&stub);
280
281 SetVar(rest_param, r3, r4, r5); 272 SetVar(rest_param, r3, r4, r5);
282 } 273 }
283 274
284 Variable* arguments = scope()->arguments(); 275 Variable* arguments = scope()->arguments();
285 if (arguments != NULL) { 276 if (arguments != NULL) {
286 // Function uses arguments object. 277 // Function uses arguments object.
287 Comment cmnt(masm_, "[ Allocate arguments object"); 278 Comment cmnt(masm_, "[ Allocate arguments object");
288 DCHECK(r4.is(ArgumentsAccessNewDescriptor::function())); 279 DCHECK(r4.is(ArgumentsAccessNewDescriptor::function()));
289 if (!function_in_register_r4) { 280 if (!function_in_register_r4) {
290 // Load this again, if it's used by the local context below. 281 // Load this again, if it's used by the local context below.
(...skipping 4362 matching lines...) Expand 10 before | Expand all | Expand 10 after
4653 return ON_STACK_REPLACEMENT; 4644 return ON_STACK_REPLACEMENT;
4654 } 4645 }
4655 4646
4656 DCHECK(interrupt_address == 4647 DCHECK(interrupt_address ==
4657 isolate->builtins()->OsrAfterStackCheck()->entry()); 4648 isolate->builtins()->OsrAfterStackCheck()->entry());
4658 return OSR_AFTER_STACK_CHECK; 4649 return OSR_AFTER_STACK_CHECK;
4659 } 4650 }
4660 } // namespace internal 4651 } // namespace internal
4661 } // namespace v8 4652 } // namespace v8
4662 #endif // V8_TARGET_ARCH_PPC 4653 #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