Index: src/ia32/virtual-frame-ia32.cc |
diff --git a/src/ia32/virtual-frame-ia32.cc b/src/ia32/virtual-frame-ia32.cc |
index bc27e1de7a55804dcfa437f4cdc6ce3a5f4fbb95..10aaa52b8338055c3bc2ed4800ea6f3215d08c3d 100644 |
--- a/src/ia32/virtual-frame-ia32.cc |
+++ b/src/ia32/virtual-frame-ia32.cc |
@@ -909,6 +909,25 @@ Result VirtualFrame::CallStub(CodeStub* stub, Result* arg0, Result* arg1) { |
} |
+Result VirtualFrame::CallJSFunction(int arg_count) { |
+ Result function = Pop(); |
+ |
+ // InvokeFunction requires function in edi. Move it in there. |
+ function.ToRegister(edi); |
+ function.Unuse(); |
+ |
+ // +1 for receiver. |
+ PrepareForCall(arg_count + 1, arg_count + 1); |
+ ASSERT(cgen()->HasValidEntryRegisters()); |
+ ParameterCount count(arg_count); |
+ __ InvokeFunction(edi, count, CALL_FUNCTION); |
+ RestoreContextRegister(); |
+ Result result = cgen()->allocator()->Allocate(eax); |
+ ASSERT(result.is_valid()); |
+ return result; |
+} |
+ |
+ |
Result VirtualFrame::CallRuntime(Runtime::Function* f, int arg_count) { |
PrepareForCall(arg_count, arg_count); |
ASSERT(cgen()->HasValidEntryRegisters()); |