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) |