Index: include/v8.h |
diff --git a/include/v8.h b/include/v8.h |
index f8883fc1de96e9839d3ed353597e417a2b69d6c3..4dc6be39ac08b5b569513a12d80e195b1c5b6f03 100644 |
--- a/include/v8.h |
+++ b/include/v8.h |
@@ -2925,6 +2925,15 @@ typedef uintptr_t (*ReturnAddressLocationResolver)( |
/** |
+ * FunctionEntryHook is the type of the profile entry hook called at entry to |
+ * any generated function when function-level profiling is enabled. |
+ */ |
+typedef void (*FunctionEntryHook)(intptr_t function, |
+ intptr_t stack_pointer, |
+ uint64_t entry_time); |
+ |
+ |
+/** |
* Interface for iterating though all external resources in the heap. |
*/ |
class V8EXPORT ExternalResourceVisitor { // NOLINT |
@@ -3185,6 +3194,20 @@ class V8EXPORT V8 { |
ReturnAddressLocationResolver return_address_resolver); |
/** |
+ * Allows the host application to provide the address of a function that's |
+ * invoked on entry to every V8-generated function. |
+ * Note that \p entry_hook is invoked at the very start of each |
+ * generated function. |
+ * |
+ * \param entry_hook a function that will be invoked on entry to every |
+ * V8-generated function. |
+ * \returns true on success on supported platforms, false on failure. |
+ * \note Setting a new entry hook function when one is already active will |
+ * fail. |
+ */ |
+ static bool SetFunctionEntryHook(FunctionEntryHook entry_hook); |
+ |
+ /** |
* Adjusts the amount of registered external memory. Used to give |
* V8 an indication of the amount of externally allocated memory |
* that is kept alive by JavaScript objects. V8 uses this to decide |