Index: src/code-stubs.cc |
diff --git a/src/code-stubs.cc b/src/code-stubs.cc |
index 2d94ec978e098da76d89aedb2b41c48d1d5b2d5d..5bec7e05f913be19ef8526f76e86580b99041115 100644 |
--- a/src/code-stubs.cc |
+++ b/src/code-stubs.cc |
@@ -757,11 +757,24 @@ void StubFailureTrampolineStub::GenerateAheadOfTime(Isolate* isolate) { |
} |
+FunctionEntryHook ProfileEntryHookStub::entry_hook_ = NULL; |
+ |
+ |
void ProfileEntryHookStub::EntryHookTrampoline(intptr_t function, |
intptr_t stack_pointer) { |
- FunctionEntryHook entry_hook = Isolate::Current()->function_entry_hook(); |
- ASSERT(entry_hook != NULL); |
- entry_hook(function, stack_pointer); |
+ if (entry_hook_ != NULL) |
+ entry_hook_(function, stack_pointer); |
+} |
+ |
+ |
+bool ProfileEntryHookStub::SetFunctionEntryHook(FunctionEntryHook entry_hook) { |
+ // We don't allow setting a new entry hook over one that's |
+ // already active, as the hooks won't stack. |
+ if (entry_hook != 0 && entry_hook_ != 0) |
+ return false; |
+ |
+ entry_hook_ = entry_hook; |
+ return true; |
} |