Chromium Code Reviews| Index: include/v8.h |
| diff --git a/include/v8.h b/include/v8.h |
| index 5c2c8b6671827f56ddddb6ef4a71182b6d54c164..f25347d4dc3a7255139cfe0854085cd9ff235fa9 100644 |
| --- a/include/v8.h |
| +++ b/include/v8.h |
| @@ -2944,6 +2944,40 @@ typedef void (*FunctionEntryHook)(uintptr_t function, |
| /** |
| + * A JIT code event is issued each time code is added, moved or removed. |
| + * |
| + * \note removal events are not currently issued. |
| + */ |
| +struct JitCodeEvent { |
| + enum EventType { |
| + CODE_ADDED, |
| + CODE_MOVED, |
| + CODE_REMOVED |
| + }; |
| + |
| + EventType type; |
| + // Start of the instructions. |
| + void* code_start; |
| + // Size of the instructions. |
| + size_t code_len; |
| + union { |
| + // Name of the object associated with the code. Only valid for CODE_ADDED. |
| + const char* name; |
| + // New location of instructions. Only valid for CODE_MOVED. |
| + void* new_code_start; |
| + }; |
| +}; |
| + |
| + |
| +/** |
| + * Callback function passed to SetJitCodeEventHandler. |
| + * |
| + * \param event code add, move or removal event. |
| + */ |
| +typedef void (*JitCodeEventHandler)(const JitCodeEvent* event); |
| + |
| + |
| +/** |
| * Interface for iterating though all external resources in the heap. |
| */ |
| class V8EXPORT ExternalResourceVisitor { // NOLINT |
| @@ -3218,6 +3252,16 @@ class V8EXPORT V8 { |
| static bool SetFunctionEntryHook(FunctionEntryHook entry_hook); |
| /** |
| + * Allows the host application to provide the address of a function that is |
| + * notified each time code is added, moved or removed. |
| + * |
| + * \param event_handler the JIT code event handler, which will be invoked |
| + * each time code is added, moved or removed. |
| + * \note \p event_handler won't get notified of existent code. |
|
mnaganov (inactive)
2012/07/30 11:43:36
One more thing worth mentioning here -- because of
Sigurður Ásgeirsson
2012/07/30 13:54:43
Thanks! Added docs regarding overlap and string/ev
|
| + */ |
| + static void SetJitCodeEventHandler(JitCodeEventHandler event_handler); |
| + |
| + /** |
| * 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 |