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

Unified Diff: src/ia32/code-stubs-ia32.cc

Issue 16578008: Improved function entry hook coverage (Closed) Base URL: https://chromium.googlesource.com/external/v8.git@post_fix
Patch Set: Created 7 years, 6 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
« no previous file with comments | « src/ia32/builtins-ia32.cc ('k') | src/ic.cc » ('j') | src/ic.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « src/ia32/builtins-ia32.cc ('k') | src/ic.cc » ('j') | src/ic.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698