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

Side by Side Diff: src/x64/builtins-x64.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/variables.h ('k') | src/x64/code-stubs-x64.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_X64 7 #if V8_TARGET_ARCH_X64
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 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 CHECK(!FLAG_pretenuring_call_new); 509 CHECK(!FLAG_pretenuring_call_new);
510 510
511 { 511 {
512 FrameScope frame_scope(masm, StackFrame::CONSTRUCT); 512 FrameScope frame_scope(masm, StackFrame::CONSTRUCT);
513 513
514 // Store a smi-tagged arguments count on the stack. 514 // Store a smi-tagged arguments count on the stack.
515 __ Integer32ToSmi(rax, rax); 515 __ Integer32ToSmi(rax, rax);
516 __ Push(rax); 516 __ Push(rax);
517 __ SmiToInteger32(rax, rax); 517 __ SmiToInteger32(rax, rax);
518 518
519 // Push new.target
520 __ Push(rdx);
521
519 // receiver is the hole. 522 // receiver is the hole.
520 __ Push(masm->isolate()->factory()->the_hole_value()); 523 __ Push(masm->isolate()->factory()->the_hole_value());
521 524
522 // Set up pointer to last argument. 525 // Set up pointer to last argument.
523 __ leap(rbx, Operand(rbp, StandardFrameConstants::kCallerSPOffset)); 526 __ leap(rbx, Operand(rbp, StandardFrameConstants::kCallerSPOffset));
524 527
525 // Copy arguments and receiver to the expression stack. 528 // Copy arguments and receiver to the expression stack.
526 Label loop, entry; 529 Label loop, entry;
527 __ movp(rcx, rax); 530 __ movp(rcx, rax);
528 __ jmp(&entry); 531 __ jmp(&entry);
529 __ bind(&loop); 532 __ bind(&loop);
530 __ Push(Operand(rbx, rcx, times_pointer_size, 0)); 533 __ Push(Operand(rbx, rcx, times_pointer_size, 0));
531 __ bind(&entry); 534 __ bind(&entry);
532 __ decp(rcx); 535 __ decp(rcx);
533 __ j(greater_equal, &loop); 536 __ j(greater_equal, &loop);
534 537
535 // Call the function. 538 // Call the function.
539 __ incp(rax); // Pushed new.target.
536 ParameterCount actual(rax); 540 ParameterCount actual(rax);
537 __ InvokeFunction(rdi, actual, CALL_FUNCTION, NullCallWrapper()); 541 __ InvokeFunction(rdi, actual, CALL_FUNCTION, NullCallWrapper());
538 542
539 // Restore context from the frame. 543 // Restore context from the frame.
540 __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); 544 __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
541 545
542 __ movp(rbx, Operand(rsp, 0)); // Get arguments count. 546 __ movp(rbx, Operand(rsp, 0)); // Get arguments count.
543 } // Leave construct frame. 547 } // Leave construct frame.
544 548
545 // Remove caller arguments from the stack and return. 549 // Remove caller arguments from the stack and return.
(...skipping 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after
1592 __ bind(&ok); 1596 __ bind(&ok);
1593 __ ret(0); 1597 __ ret(0);
1594 } 1598 }
1595 1599
1596 1600
1597 #undef __ 1601 #undef __
1598 1602
1599 } } // namespace v8::internal 1603 } } // namespace v8::internal
1600 1604
1601 #endif // V8_TARGET_ARCH_X64 1605 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/variables.h ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698