OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef GIN_PUBLIC_DEBUG_H_ | 5 #ifndef GIN_PUBLIC_DEBUG_H_ |
6 #define GIN_PUBLIC_DEBUG_H_ | 6 #define GIN_PUBLIC_DEBUG_H_ |
7 | 7 |
| 8 #include "build/build_config.h" |
8 #include "gin/gin_export.h" | 9 #include "gin/gin_export.h" |
9 #include "v8/include/v8.h" | 10 #include "v8/include/v8.h" |
10 | 11 |
11 namespace gin { | 12 namespace gin { |
12 | 13 |
13 class GIN_EXPORT Debug { | 14 class GIN_EXPORT Debug { |
14 public: | 15 public: |
15 /* Installs a callback that is invoked on entry to every V8-generated | 16 /* Installs a callback that is invoked on entry to every V8-generated |
16 * function. | 17 * function. |
17 * | 18 * |
18 * This only affects IsolateHolder instances created after | 19 * This only affects IsolateHolder instances created after |
19 * SetFunctionEntryHook was invoked. | 20 * SetFunctionEntryHook was invoked. |
20 */ | 21 */ |
21 static void SetFunctionEntryHook(v8::FunctionEntryHook entry_hook); | 22 static void SetFunctionEntryHook(v8::FunctionEntryHook entry_hook); |
22 | 23 |
23 /* Installs a callback that is invoked each time jit code is added, moved, | 24 /* Installs a callback that is invoked each time jit code is added, moved, |
24 * or removed. | 25 * or removed. |
25 * | 26 * |
26 * This only affects IsolateHolder instances created after | 27 * This only affects IsolateHolder instances created after |
27 * SetJitCodeEventHandler was invoked. | 28 * SetJitCodeEventHandler was invoked. |
28 */ | 29 */ |
29 static void SetJitCodeEventHandler(v8::JitCodeEventHandler event_handler); | 30 static void SetJitCodeEventHandler(v8::JitCodeEventHandler event_handler); |
| 31 |
| 32 #if defined(OS_WIN) |
| 33 typedef void (__cdecl *CodeRangeCreatedCallback)(void*, size_t); |
| 34 |
| 35 /* Sets a callback that is invoked for every new code range being created. |
| 36 * |
| 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 |
| 40 * around this issue. |
| 41 * |
| 42 * https://code.google.com/p/v8/issues/detail?id=3598 |
| 43 */ |
| 44 static void SetCodeRangeCreatedCallback(CodeRangeCreatedCallback callback); |
| 45 |
| 46 typedef void (__cdecl *CodeRangeDeletedCallback)(void*); |
| 47 |
| 48 /* Sets a callback that is invoked for every previously registered code range |
| 49 * when it is deleted. |
| 50 */ |
| 51 static void SetCodeRangeDeletedCallback(CodeRangeDeletedCallback callback); |
| 52 #endif |
30 }; | 53 }; |
31 | 54 |
32 } // namespace gin | 55 } // namespace gin |
33 | 56 |
34 #endif // GIN_PUBLIC_DEBUG_H_ | 57 #endif // GIN_PUBLIC_DEBUG_H_ |
OLD | NEW |