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

Unified 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: removes an unused label declaration. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/mips64/interface-descriptors-mips64.cc ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/builtins-x64.cc
diff --git a/src/x64/builtins-x64.cc b/src/x64/builtins-x64.cc
index d7382144d28b2bc53ee80360a77eabe666834f5b..1f176007b07907138829210ab74deee44eb5c5a8 100644
--- a/src/x64/builtins-x64.cc
+++ b/src/x64/builtins-x64.cc
@@ -625,6 +625,38 @@ static void Generate_InterpreterPushArgs(MacroAssembler* masm,
// static
+void Builtins::Generate_InterpreterPushArgsAndCallICImpl(
+ MacroAssembler* masm, TailCallMode tail_call_mode) {
+ // ----------- S t a t e -------------
+ // -- rax : the number of arguments (not including the receiver)
+ // -- rbx : the address of the first argument to be pushed. Subsequent
+ // arguments should be consecutive above this, in the same order as
+ // they are to be pushed onto the stack.
+ // -- rdi : the target to call (can be any Object).
+ // -- rdx : Feedback vector slot-id.
+ // -- r9 : type feedback vector. // TODO(mythria): move to rbx to match
+ // CallICStub expectation.
+ // -----------------------------------
+
+ {
+ FrameScope scope(masm, StackFrame::INTERNAL);
+
+ Generate_InterpreterPushArgs(masm, true);
+
+ __ Move(rbx, r9);
+
+ // Call via the CallIC stub.
+ CallICState call_ic_state(0, ConvertReceiverMode::kAny, tail_call_mode,
+ true);
+ CallICStub stub(masm->isolate(), call_ic_state);
+ // TODO(mythria): This should be replaced by a TailCallStub, when we
+ // update the code to find the target IC from jump instructions.
+ __ CallStub(&stub);
+ }
+ __ Ret();
+}
+
+// static
void Builtins::Generate_InterpreterPushArgsAndCallImpl(
MacroAssembler* masm, TailCallMode tail_call_mode) {
// ----------- S t a t e -------------
@@ -647,7 +679,6 @@ void Builtins::Generate_InterpreterPushArgsAndCallImpl(
RelocInfo::CODE_TARGET);
}
-
// static
void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) {
// ----------- S t a t e -------------
@@ -2058,6 +2089,17 @@ void PrepareForTailCall(MacroAssembler* masm, Register args_reg,
__ cmpb(Operand(kScratchRegister, 0), Immediate(0));
__ j(not_equal, &done);
+ // Drop possible internal frame pushed for calling CallICStub.
+ // TODO(mythria): when we tail call the CallICStub, remove this.
+ {
+ Label no_internal_callic_frame;
+ __ Cmp(Operand(rbp, StandardFrameConstants::kMarkerOffset),
+ Smi::FromInt(StackFrame::INTERNAL));
+ __ j(not_equal, &no_internal_callic_frame, Label::kNear);
+ __ movp(rbp, Operand(rbp, StandardFrameConstants::kCallerFPOffset));
+ __ bind(&no_internal_callic_frame);
+ }
+
// Drop possible interpreter handler/stub frame.
{
Label no_interpreter_frame;
« no previous file with comments | « src/mips64/interface-descriptors-mips64.cc ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698