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

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

Issue 1272673003: [es6] Re-implement rest parameters via desugaring. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Oops. 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_MIPS 5 #if V8_TARGET_ARCH_MIPS
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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 MemOperand(a2, ConstructFrameConstants::kOriginalConstructorOffset)); 288 MemOperand(a2, ConstructFrameConstants::kOriginalConstructorOffset));
289 __ Branch(&done); 289 __ Branch(&done);
290 290
291 __ bind(&non_construct_frame); 291 __ bind(&non_construct_frame);
292 __ LoadRoot(v0, Heap::kUndefinedValueRootIndex); 292 __ LoadRoot(v0, Heap::kUndefinedValueRootIndex);
293 __ bind(&done); 293 __ bind(&done);
294 294
295 SetVar(new_target_var, v0, a2, a3); 295 SetVar(new_target_var, v0, a2, a3);
296 } 296 }
297 297
298 // Possibly allocate RestParameters
299 int rest_index;
300 Variable* rest_param = scope()->rest_parameter(&rest_index);
301 if (rest_param) {
302 Comment cmnt(masm_, "[ Allocate rest parameter array");
303
304 int num_parameters = info->scope()->num_parameters();
305 int offset = num_parameters * kPointerSize;
306
307 __ Addu(a3, fp,
308 Operand(StandardFrameConstants::kCallerSPOffset + offset));
309 __ li(a2, Operand(Smi::FromInt(num_parameters)));
310 __ li(a1, Operand(Smi::FromInt(rest_index)));
311 __ li(a0, Operand(Smi::FromInt(language_mode())));
312 __ Push(a3, a2, a1, a0);
313 function_in_register_a1 = false;
314
315 RestParamAccessStub stub(isolate());
316 __ CallStub(&stub);
317
318 SetVar(rest_param, v0, a1, a2);
319 }
320
321 Variable* arguments = scope()->arguments(); 298 Variable* arguments = scope()->arguments();
322 if (arguments != NULL) { 299 if (arguments != NULL) {
323 // Function uses arguments object. 300 // Function uses arguments object.
324 Comment cmnt(masm_, "[ Allocate arguments object"); 301 Comment cmnt(masm_, "[ Allocate arguments object");
325 if (!function_in_register_a1) { 302 if (!function_in_register_a1) {
326 // Load this again, if it's used by the local context below. 303 // Load this again, if it's used by the local context below.
327 __ lw(a3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); 304 __ lw(a3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
328 } else { 305 } else {
329 __ mov(a3, a1); 306 __ mov(a3, a1);
330 } 307 }
(...skipping 5013 matching lines...) Expand 10 before | Expand all | Expand 10 after
5344 reinterpret_cast<uint32_t>( 5321 reinterpret_cast<uint32_t>(
5345 isolate->builtins()->OsrAfterStackCheck()->entry())); 5322 isolate->builtins()->OsrAfterStackCheck()->entry()));
5346 return OSR_AFTER_STACK_CHECK; 5323 return OSR_AFTER_STACK_CHECK;
5347 } 5324 }
5348 5325
5349 5326
5350 } // namespace internal 5327 } // namespace internal
5351 } // namespace v8 5328 } // namespace v8
5352 5329
5353 #endif // V8_TARGET_ARCH_MIPS 5330 #endif // V8_TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698