OLD | NEW |
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 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 // Copy arguments and receiver to the expression stack. | 520 // Copy arguments and receiver to the expression stack. |
521 Label loop, entry; | 521 Label loop, entry; |
522 __ movp(rcx, rax); | 522 __ movp(rcx, rax); |
523 __ jmp(&entry); | 523 __ jmp(&entry); |
524 __ bind(&loop); | 524 __ bind(&loop); |
525 __ Push(Operand(rbx, rcx, times_pointer_size, 0)); | 525 __ Push(Operand(rbx, rcx, times_pointer_size, 0)); |
526 __ bind(&entry); | 526 __ bind(&entry); |
527 __ decp(rcx); | 527 __ decp(rcx); |
528 __ j(greater_equal, &loop); | 528 __ j(greater_equal, &loop); |
529 | 529 |
530 __ incp(rax); // Pushed new.target. | |
531 | |
532 // Handle step in. | 530 // Handle step in. |
533 Label skip_step_in; | 531 Label skip_step_in; |
534 ExternalReference debug_step_in_fp = | 532 ExternalReference debug_step_in_fp = |
535 ExternalReference::debug_step_in_fp_address(masm->isolate()); | 533 ExternalReference::debug_step_in_fp_address(masm->isolate()); |
536 __ Move(kScratchRegister, debug_step_in_fp); | 534 __ Move(kScratchRegister, debug_step_in_fp); |
537 __ cmpp(Operand(kScratchRegister, 0), Immediate(0)); | 535 __ cmpp(Operand(kScratchRegister, 0), Immediate(0)); |
538 __ j(equal, &skip_step_in); | 536 __ j(equal, &skip_step_in); |
539 | 537 |
540 __ Push(rax); | 538 __ Push(rax); |
541 __ Push(rdi); | 539 __ Push(rdi); |
542 __ Push(rdi); | 540 __ Push(rdi); |
543 __ CallRuntime(Runtime::kHandleStepInForDerivedConstructors, 1); | 541 __ CallRuntime(Runtime::kHandleStepInForDerivedConstructors, 1); |
544 __ Pop(rdi); | 542 __ Pop(rdi); |
545 __ Pop(rax); | 543 __ Pop(rax); |
546 | 544 |
547 __ bind(&skip_step_in); | 545 __ bind(&skip_step_in); |
548 | 546 |
549 // Call the function. | 547 // Call the function. |
550 ParameterCount actual(rax); | 548 ParameterCount actual(rax); |
551 __ InvokeFunction(rdi, actual, CALL_FUNCTION, NullCallWrapper()); | 549 __ InvokeFunction(rdi, actual, CALL_FUNCTION, NullCallWrapper()); |
552 | 550 |
553 // Restore context from the frame. | 551 // Restore context from the frame. |
554 __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); | 552 __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); |
555 | 553 |
556 __ movp(rbx, Operand(rsp, 0)); // Get arguments count. | 554 // Get arguments count, skipping over new.target. |
557 } // Leave construct frame. | 555 __ movp(rbx, Operand(rsp, kPointerSize)); // Get arguments count. |
| 556 } // Leave construct frame. |
558 | 557 |
559 // Remove caller arguments from the stack and return. | 558 // Remove caller arguments from the stack and return. |
560 __ PopReturnAddressTo(rcx); | 559 __ PopReturnAddressTo(rcx); |
561 SmiIndex index = masm->SmiToIndex(rbx, rbx, kPointerSizeLog2); | 560 SmiIndex index = masm->SmiToIndex(rbx, rbx, kPointerSizeLog2); |
562 __ leap(rsp, Operand(rsp, index.reg, index.scale, 1 * kPointerSize)); | 561 __ leap(rsp, Operand(rsp, index.reg, index.scale, 1 * kPointerSize)); |
563 __ PushReturnAddressFrom(rcx); | 562 __ PushReturnAddressFrom(rcx); |
564 __ ret(0); | 563 __ ret(0); |
565 } | 564 } |
566 | 565 |
567 | 566 |
(...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1784 __ ret(0); | 1783 __ ret(0); |
1785 } | 1784 } |
1786 | 1785 |
1787 | 1786 |
1788 #undef __ | 1787 #undef __ |
1789 | 1788 |
1790 } // namespace internal | 1789 } // namespace internal |
1791 } // namespace v8 | 1790 } // namespace v8 |
1792 | 1791 |
1793 #endif // V8_TARGET_ARCH_X64 | 1792 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |