Index: src/ia32/code-stubs-ia32.cc |
diff --git a/src/ia32/code-stubs-ia32.cc b/src/ia32/code-stubs-ia32.cc |
index 5d8aae2eaafacf83c48f8b921ccf54c0f26bb500..b0c656077e8a0e28030cb10b1a39682f27848652 100644 |
--- a/src/ia32/code-stubs-ia32.cc |
+++ b/src/ia32/code-stubs-ia32.cc |
@@ -5226,6 +5226,8 @@ void CEntryStub::Generate(MacroAssembler* masm) { |
// esi: current context (C callee-saved) |
// edi: JS function of the caller (C callee-saved) |
+ ProfileEntryHookStub::MaybeCallEntryHook(masm); |
+ |
// NOTE: Invocations of builtins may return failure objects instead |
// of a proper result. The builtin entry handles this by performing |
// a garbage collection and retrying the builtin (twice). |
@@ -5299,6 +5301,8 @@ void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) { |
Label invoke, handler_entry, exit; |
Label not_outermost_js, not_outermost_js_2; |
+ ProfileEntryHookStub::MaybeCallEntryHook(masm); |
+ |
// Set up frame. |
__ push(ebp); |
__ mov(ebp, esp); |
@@ -7859,9 +7863,11 @@ void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) { |
void ProfileEntryHookStub::Generate(MacroAssembler* masm) { |
- // Ecx is the only volatile register we must save. |
- const int kNumSavedRegisters = 1; |
+ // Save volatile registers. |
+ const int kNumSavedRegisters = 3; |
+ __ push(eax); |
__ push(ecx); |
+ __ push(edx); |
// Calculate and push the original stack pointer. |
__ lea(eax, Operand(esp, (kNumSavedRegisters + 1) * kPointerSize)); |
@@ -7874,12 +7880,16 @@ void ProfileEntryHookStub::Generate(MacroAssembler* masm) { |
__ push(eax); |
// Call the entry hook. |
- int32_t hook_location = reinterpret_cast<int32_t>(&entry_hook_); |
+ int32_t hook_location = |
+ reinterpret_cast<int32_t>(&ProfileEntryHookStub::entry_hook_); |
__ call(Operand(hook_location, RelocInfo::NONE32)); |
__ add(esp, Immediate(2 * kPointerSize)); |
// Restore ecx. |
+ __ pop(edx); |
__ pop(ecx); |
+ __ pop(eax); |
+ |
__ ret(0); |
} |