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

Side by Side Diff: src/ia32/builtins-ia32.cc

Issue 908883002: new classes: implement new.target passing to superclass constructor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix x64 arithmetic Created 5 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 | « src/hydrogen-instructions.h ('k') | src/ia32/code-stubs-ia32.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 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/codegen.h" 10 #include "src/codegen.h"
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 CHECK(!FLAG_pretenuring_call_new); 512 CHECK(!FLAG_pretenuring_call_new);
513 513
514 { 514 {
515 FrameScope frame_scope(masm, StackFrame::CONSTRUCT); 515 FrameScope frame_scope(masm, StackFrame::CONSTRUCT);
516 516
517 // Preserve actual arguments count. 517 // Preserve actual arguments count.
518 __ SmiTag(eax); 518 __ SmiTag(eax);
519 __ push(eax); 519 __ push(eax);
520 __ SmiUntag(eax); 520 __ SmiUntag(eax);
521 521
522 // Push new.target.
523 __ push(edx);
524
522 // receiver is the hole. 525 // receiver is the hole.
523 __ push(Immediate(masm->isolate()->factory()->the_hole_value())); 526 __ push(Immediate(masm->isolate()->factory()->the_hole_value()));
524 527
525 // Set up pointer to last argument. 528 // Set up pointer to last argument.
526 __ lea(ebx, Operand(ebp, StandardFrameConstants::kCallerSPOffset)); 529 __ lea(ebx, Operand(ebp, StandardFrameConstants::kCallerSPOffset));
527 530
528 // Copy arguments and receiver to the expression stack. 531 // Copy arguments and receiver to the expression stack.
529 Label loop, entry; 532 Label loop, entry;
530 __ mov(ecx, eax); 533 __ mov(ecx, eax);
531 __ jmp(&entry); 534 __ jmp(&entry);
532 __ bind(&loop); 535 __ bind(&loop);
533 __ push(Operand(ebx, ecx, times_4, 0)); 536 __ push(Operand(ebx, ecx, times_4, 0));
534 __ bind(&entry); 537 __ bind(&entry);
535 __ dec(ecx); 538 __ dec(ecx);
536 __ j(greater_equal, &loop); 539 __ j(greater_equal, &loop);
537 540
541 __ inc(eax); // Pushed new.target.
538 ParameterCount actual(eax); 542 ParameterCount actual(eax);
539 __ InvokeFunction(edi, actual, CALL_FUNCTION, NullCallWrapper()); 543 __ InvokeFunction(edi, actual, CALL_FUNCTION, NullCallWrapper());
540 544
541 // Restore context from the frame. 545 // Restore context from the frame.
542 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); 546 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
543 547
544 __ mov(ebx, Operand(esp, 0)); 548 __ mov(ebx, Operand(esp, 0));
545 } 549 }
546 550
547 __ pop(ecx); // Return address. 551 __ pop(ecx); // Return address.
(...skipping 977 matching lines...) Expand 10 before | Expand all | Expand 10 after
1525 1529
1526 __ bind(&ok); 1530 __ bind(&ok);
1527 __ ret(0); 1531 __ ret(0);
1528 } 1532 }
1529 1533
1530 #undef __ 1534 #undef __
1531 } 1535 }
1532 } // namespace v8::internal 1536 } // namespace v8::internal
1533 1537
1534 #endif // V8_TARGET_ARCH_IA32 1538 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698