Index: src/x87/code-stubs-x87.cc |
diff --git a/src/x87/code-stubs-x87.cc b/src/x87/code-stubs-x87.cc |
index a90d83a09ffe156b8f29b15ff5325ce60d812cf5..03f7854018061f78a38f07cfafd1db1604b563ea 100644 |
--- a/src/x87/code-stubs-x87.cc |
+++ b/src/x87/code-stubs-x87.cc |
@@ -2137,11 +2137,23 @@ void CEntryStub::Generate(MacroAssembler* masm) { |
// esp: stack pointer (restored after C call) |
// esi: current context (C callee-saved) |
// edi: JS function of the caller (C callee-saved) |
+ // |
+ // If argv_in_register(): |
+ // ecx: pointer to the first argument |
ProfileEntryHookStub::MaybeCallEntryHook(masm); |
// Enter the exit frame that transitions from JavaScript to C++. |
- __ EnterExitFrame(save_doubles()); |
+ if (argv_in_register()) { |
+ DCHECK(!save_doubles()); |
+ __ EnterApiExitFrame(3); |
+ |
+ // Move argc and argv into the correct registers. |
+ __ mov(esi, ecx); |
+ __ mov(edi, eax); |
+ } else { |
+ __ EnterExitFrame(save_doubles()); |
+ } |
// ebx: pointer to C function (C callee-saved) |
// ebp: frame pointer (restored after C call) |
@@ -2186,7 +2198,7 @@ void CEntryStub::Generate(MacroAssembler* masm) { |
} |
// Exit the JavaScript to C++ exit frame. |
- __ LeaveExitFrame(save_doubles()); |
+ __ LeaveExitFrame(save_doubles(), !argv_in_register()); |
__ ret(0); |
// Handling of exception. |