Chromium Code Reviews| 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 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
| 6 | 6 |
| 7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
| 9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
| 10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
| (...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 768 // Pop return address to allow tail-call after pushing arguments. | 768 // Pop return address to allow tail-call after pushing arguments. |
| 769 __ PopReturnAddressTo(kScratchRegister); | 769 __ PopReturnAddressTo(kScratchRegister); |
| 770 | 770 |
| 771 Generate_InterpreterPushArgs(masm, true); | 771 Generate_InterpreterPushArgs(masm, true); |
| 772 | 772 |
| 773 // Call the target. | 773 // Call the target. |
| 774 __ PushReturnAddressFrom(kScratchRegister); // Re-push return address. | 774 __ PushReturnAddressFrom(kScratchRegister); // Re-push return address. |
| 775 __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); | 775 __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); |
| 776 } | 776 } |
| 777 | 777 |
| 778 // static | |
| 779 void Builtins::Generate_InterpreterPushArgsAndCallIC(MacroAssembler* masm) { | |
| 780 // ----------- S t a t e ------------- | |
| 781 // -- rax : the number of arguments (not including the receiver) | |
| 782 // -- rbx : the address of the first argument to be pushed. Subsequent | |
| 783 // arguments should be consecutive above this, in the same order as | |
| 784 // they are to be pushed onto the stack. | |
| 785 // -- rdi : the target to call (can be any Object). | |
| 786 // -- rdx : Feedback vector slot-id. | |
| 787 // -- r9 : type feedback vector. // TODO(mythria): move to rbx to match | |
| 788 // CallICStub expectation. | |
| 789 // ----------------------------------- | |
| 790 | |
|
mvstanton
2016/02/15 11:13:45
Wow, more registers makes things so much nicer :p.
mythria
2016/02/17 11:02:48
Yes :).
| |
| 791 { | |
| 792 FrameScope scope(masm, StackFrame::INTERNAL); | |
| 793 | |
| 794 Generate_InterpreterPushArgs(masm, true); | |
| 795 | |
| 796 __ Move(rbx, r9); | |
| 797 | |
| 798 // Call via the CallIC stub. | |
| 799 CallICState call_ic_state(0, ConvertReceiverMode::kAny, | |
| 800 TailCallMode::kDisallow, true); | |
| 801 CallICStub stub(masm->isolate(), call_ic_state); | |
| 802 // TODO(mythria): This should be replaced by a TailCallStub, when we | |
| 803 // update the code to find the target IC from jump instructions. | |
| 804 __ CallStub(&stub); | |
| 805 } | |
| 806 __ Ret(); | |
| 807 } | |
| 778 | 808 |
| 779 // static | 809 // static |
| 780 void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) { | 810 void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) { |
| 781 // ----------- S t a t e ------------- | 811 // ----------- S t a t e ------------- |
| 782 // -- rax : the number of arguments (not including the receiver) | 812 // -- rax : the number of arguments (not including the receiver) |
| 783 // -- rdx : the new target (either the same as the constructor or | 813 // -- rdx : the new target (either the same as the constructor or |
| 784 // the JSFunction on which new was invoked initially) | 814 // the JSFunction on which new was invoked initially) |
| 785 // -- rdi : the constructor to call (can be any Object) | 815 // -- rdi : the constructor to call (can be any Object) |
| 786 // -- rbx : the address of the first argument to be pushed. Subsequent | 816 // -- rbx : the address of the first argument to be pushed. Subsequent |
| 787 // arguments should be consecutive above this, in the same order as | 817 // arguments should be consecutive above this, in the same order as |
| (...skipping 2062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2850 __ ret(0); | 2880 __ ret(0); |
| 2851 } | 2881 } |
| 2852 | 2882 |
| 2853 | 2883 |
| 2854 #undef __ | 2884 #undef __ |
| 2855 | 2885 |
| 2856 } // namespace internal | 2886 } // namespace internal |
| 2857 } // namespace v8 | 2887 } // namespace v8 |
| 2858 | 2888 |
| 2859 #endif // V8_TARGET_ARCH_X64 | 2889 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |