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

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

Issue 1688283003: [Interpreter] Implements calls through CallICStub in the interpreter. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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
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 #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
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
791 {
792 FrameScope scope(masm, StackFrame::INTERNAL);
793
794 Generate_InterpreterPushArgs(masm, true);
795
796 // Call via the CallIC stub.
797 __ Move(rbx, r9);
798
799 CallICState call_ic_state(0, ConvertReceiverMode::kAny,
800 TailCallMode::kDisallow, true);
801 CallICStub stub(masm->isolate(), call_ic_state);
802 __ CallStub(&stub);
803 }
804 __ Ret();
805 }
778 806
779 // static 807 // static
780 void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) { 808 void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) {
781 // ----------- S t a t e ------------- 809 // ----------- S t a t e -------------
782 // -- rax : the number of arguments (not including the receiver) 810 // -- rax : the number of arguments (not including the receiver)
783 // -- rdx : the new target (either the same as the constructor or 811 // -- rdx : the new target (either the same as the constructor or
784 // the JSFunction on which new was invoked initially) 812 // the JSFunction on which new was invoked initially)
785 // -- rdi : the constructor to call (can be any Object) 813 // -- rdi : the constructor to call (can be any Object)
786 // -- rbx : the address of the first argument to be pushed. Subsequent 814 // -- rbx : the address of the first argument to be pushed. Subsequent
787 // arguments should be consecutive above this, in the same order as 815 // arguments should be consecutive above this, in the same order as
(...skipping 2062 matching lines...) Expand 10 before | Expand all | Expand 10 after
2850 __ ret(0); 2878 __ ret(0);
2851 } 2879 }
2852 2880
2853 2881
2854 #undef __ 2882 #undef __
2855 2883
2856 } // namespace internal 2884 } // namespace internal
2857 } // namespace v8 2885 } // namespace v8
2858 2886
2859 #endif // V8_TARGET_ARCH_X64 2887 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698