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

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

Issue 1235153006: [es6] re-implement rest parameters via desugaring (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Refactor Scope::TempScope Created 5 years, 5 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 | « src/ia32/code-stubs-ia32.cc ('k') | src/parser.h » ('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 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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_IA32 7 #if V8_TARGET_ARCH_IA32
8 8
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 270
271 // Non-construct frame 271 // Non-construct frame
272 __ bind(&non_construct_frame); 272 __ bind(&non_construct_frame);
273 __ mov(eax, Immediate(isolate()->factory()->undefined_value())); 273 __ mov(eax, Immediate(isolate()->factory()->undefined_value()));
274 274
275 __ bind(&done); 275 __ bind(&done);
276 SetVar(new_target_var, eax, ebx, edx); 276 SetVar(new_target_var, eax, ebx, edx);
277 } 277 }
278 278
279 279
280 // Possibly allocate RestParameters
281 int rest_index;
282 Variable* rest_param = scope()->rest_parameter(&rest_index);
283 if (rest_param) {
284 Comment cmnt(masm_, "[ Allocate rest parameter array");
285
286 int num_parameters = info->scope()->num_parameters();
287 int offset = num_parameters * kPointerSize;
288
289 __ lea(edx,
290 Operand(ebp, StandardFrameConstants::kCallerSPOffset + offset));
291 __ push(edx);
292 __ push(Immediate(Smi::FromInt(num_parameters)));
293 __ push(Immediate(Smi::FromInt(rest_index)));
294 __ push(Immediate(Smi::FromInt(language_mode())));
295
296 RestParamAccessStub stub(isolate());
297 __ CallStub(&stub);
298
299 SetVar(rest_param, eax, ebx, edx);
300 }
301
302 Variable* arguments = scope()->arguments(); 280 Variable* arguments = scope()->arguments();
303 if (arguments != NULL) { 281 if (arguments != NULL) {
304 // Function uses arguments object. 282 // Function uses arguments object.
305 Comment cmnt(masm_, "[ Allocate arguments object"); 283 Comment cmnt(masm_, "[ Allocate arguments object");
306 if (function_in_register) { 284 if (function_in_register) {
307 __ push(edi); 285 __ push(edi);
308 } else { 286 } else {
309 __ push(Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); 287 __ push(Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
310 } 288 }
311 // Receiver is just before the parameters on the caller's stack. 289 // Receiver is just before the parameters on the caller's stack.
(...skipping 5145 matching lines...) Expand 10 before | Expand all | Expand 10 after
5457 Assembler::target_address_at(call_target_address, 5435 Assembler::target_address_at(call_target_address,
5458 unoptimized_code)); 5436 unoptimized_code));
5459 return OSR_AFTER_STACK_CHECK; 5437 return OSR_AFTER_STACK_CHECK;
5460 } 5438 }
5461 5439
5462 5440
5463 } // namespace internal 5441 } // namespace internal
5464 } // namespace v8 5442 } // namespace v8
5465 5443
5466 #endif // V8_TARGET_ARCH_IA32 5444 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698