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

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

Issue 1676883002: [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
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_MIPS64 5 #if V8_TARGET_ARCH_MIPS64
6 6
7 // Note on Mips implementation: 7 // Note on Mips implementation:
8 // 8 //
9 // The result_register() for mips is the 'v0' register, which is defined 9 // The result_register() for mips is the 'v0' register, which is defined
10 // by the ABI to contain function return values. However, the first 10 // by the ABI to contain function return values. However, the first
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 if (new_target_var != nullptr) { 265 if (new_target_var != nullptr) {
266 Comment cmnt(masm_, "[ new.target"); 266 Comment cmnt(masm_, "[ new.target");
267 SetVar(new_target_var, a3, a0, a2); 267 SetVar(new_target_var, a3, a0, a2);
268 } 268 }
269 269
270 // Possibly allocate RestParameters 270 // Possibly allocate RestParameters
271 int rest_index; 271 int rest_index;
272 Variable* rest_param = scope()->rest_parameter(&rest_index); 272 Variable* rest_param = scope()->rest_parameter(&rest_index);
273 if (rest_param) { 273 if (rest_param) {
274 Comment cmnt(masm_, "[ Allocate rest parameter array"); 274 Comment cmnt(masm_, "[ Allocate rest parameter array");
275 275 if (!function_in_register_a1) {
276 int num_parameters = info->scope()->num_parameters(); 276 __ lw(a1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
277 int offset = num_parameters * kPointerSize; 277 }
278 278 FastNewRestParameterStub stub(isolate());
279 __ li(RestParamAccessDescriptor::parameter_count(), 279 __ CallStub(&stub);
280 Operand(Smi::FromInt(num_parameters)));
281 __ Daddu(RestParamAccessDescriptor::parameter_pointer(), fp,
282 Operand(StandardFrameConstants::kCallerSPOffset + offset));
283 __ li(RestParamAccessDescriptor::rest_parameter_index(),
284 Operand(Smi::FromInt(rest_index)));
285 function_in_register_a1 = false; 280 function_in_register_a1 = false;
286
287 RestParamAccessStub stub(isolate());
288 __ CallStub(&stub);
289
290 SetVar(rest_param, v0, a1, a2); 281 SetVar(rest_param, v0, a1, a2);
291 } 282 }
292 283
293 Variable* arguments = scope()->arguments(); 284 Variable* arguments = scope()->arguments();
294 if (arguments != NULL) { 285 if (arguments != NULL) {
295 // Function uses arguments object. 286 // Function uses arguments object.
296 Comment cmnt(masm_, "[ Allocate arguments object"); 287 Comment cmnt(masm_, "[ Allocate arguments object");
297 DCHECK(a1.is(ArgumentsAccessNewDescriptor::function())); 288 DCHECK(a1.is(ArgumentsAccessNewDescriptor::function()));
298 if (!function_in_register_a1) { 289 if (!function_in_register_a1) {
299 // Load this again, if it's used by the local context below. 290 // Load this again, if it's used by the local context below.
(...skipping 4417 matching lines...) Expand 10 before | Expand all | Expand 10 after
4717 reinterpret_cast<uint64_t>( 4708 reinterpret_cast<uint64_t>(
4718 isolate->builtins()->OsrAfterStackCheck()->entry())); 4709 isolate->builtins()->OsrAfterStackCheck()->entry()));
4719 return OSR_AFTER_STACK_CHECK; 4710 return OSR_AFTER_STACK_CHECK;
4720 } 4711 }
4721 4712
4722 4713
4723 } // namespace internal 4714 } // namespace internal
4724 } // namespace v8 4715 } // namespace v8
4725 4716
4726 #endif // V8_TARGET_ARCH_MIPS64 4717 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698