1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef GIN_PUBLIC_DEBUG_H_
6 #define GIN_PUBLIC_DEBUG_H_
8 #include "build/build_config.h"
9 #include "gin/gin_export.h"
10 #include "v8/include/v8.h"
14 class GIN_EXPORT Debug
{
16 /* Installs a callback that is invoked on entry to every V8-generated
19 * This only affects IsolateHolder instances created after
20 * SetFunctionEntryHook was invoked.
22 static void SetFunctionEntryHook(v8::FunctionEntryHook entry_hook
);
24 /* Installs a callback that is invoked each time jit code is added, moved,
27 * This only affects IsolateHolder instances created after
28 * SetJitCodeEventHandler was invoked.
30 static void SetJitCodeEventHandler(v8::JitCodeEventHandler event_handler
);
33 typedef void (__cdecl
*CodeRangeCreatedCallback
)(void*, size_t);
35 /* Sets a callback that is invoked for every new code range being created.
37 * On Win64, exception handling in jitted code is broken due to the fact
38 * that JS stack frames are not ABI compliant. It is possible to install
39 * custom handlers for the code range which holds the jitted code to work
42 * https://code.google.com/p/v8/issues/detail?id=3598
44 static void SetCodeRangeCreatedCallback(CodeRangeCreatedCallback callback
);
46 typedef void (__cdecl
*CodeRangeDeletedCallback
)(void*);
48 /* Sets a callback that is invoked for every previously registered code range
51 static void SetCodeRangeDeletedCallback(CodeRangeDeletedCallback callback
);
57 #endif // GIN_PUBLIC_DEBUG_H_