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

Unified Diff: src/ia32/builtins-ia32.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 side-by-side diff with in-line comments
Download patch
Index: src/ia32/builtins-ia32.cc
diff --git a/src/ia32/builtins-ia32.cc b/src/ia32/builtins-ia32.cc
index 1715ac156291f14d4e3d03c57872e2b169d29faf..c5d4fdcbb5ac2f4abc4a28546e051f9b55d7ed43 100644
--- a/src/ia32/builtins-ia32.cc
+++ b/src/ia32/builtins-ia32.cc
@@ -705,6 +705,48 @@ void Builtins::Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) {
// static
+void Builtins::Generate_InterpreterPushArgsAndCallIC(MacroAssembler* masm) {
+ // ----------- S t a t e -------------
+ // -- eax : the number of arguments (not including the receiver)
+ // -- ebx : 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.
+ // -- edi : the target to call (can be any Object).
+ // -- edx : feedback slot id.
+ // -- ecx : type feedback vector.
+ // -----------------------------------
+
+ {
+ FrameScope scope(masm, StackFrame::INTERNAL);
+ // Store the feedback vector below where arguments are going to be pushed.
+ // This would act like a temporary store without disturbing the stack.
+ // We push eax + 1 values, so adjust the displacement accordingly.
+ __ neg(eax);
+ __ mov(Operand(esp, eax, times_pointer_size, -2 * kPointerSize), ecx);
+ __ neg(eax);
rmcilroy 2016/02/12 14:21:03 Could you try and use a virtual register instead,
mythria 2016/02/17 11:02:48 Done.
+
+ // Find the address of the last argument.
+ __ mov(ecx, eax);
+ __ add(ecx, Immediate(1)); // Add one for receiver.
+ __ shl(ecx, kPointerSizeLog2);
+ __ neg(ecx);
+ __ add(ecx, ebx);
rmcilroy 2016/02/12 14:21:03 Could you pull this out to a helper function (to s
mythria 2016/02/17 11:02:48 Done.
+
+ Generate_InterpreterPushArgs(masm, ecx);
+
+ // Call via the CallIC stub.
rmcilroy 2016/02/12 14:21:03 nit - move this comment above CallIcState call_ic.
mythria 2016/02/17 11:02:48 Done.
+ // Restore feedback vector to ebx from the stack.
+ __ mov(ebx, Operand(esp, -kPointerSize));
+
+ CallICState call_ic_state(0, ConvertReceiverMode::kAny,
+ TailCallMode::kDisallow, true);
+ CallICStub stub(masm->isolate(), call_ic_state);
+ __ CallStub(&stub);
rmcilroy 2016/02/12 14:21:03 Add a TODO that we should replace this with a Tail
mythria 2016/02/17 11:02:47 Done.
+ }
+ __ Ret();
+}
+
+// static
void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) {
// ----------- S t a t e -------------
// -- eax : the number of arguments (not including the receiver)

Powered by Google App Engine
This is Rietveld 408576698