Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(845)

Unified Diff: base/debug/profiler.h

Issue 15914002: Implement glue for V8 JIT code profiling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ready for review. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/debug/profiler.cc » ('j') | base/debug/profiler.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug/profiler.h
diff --git a/base/debug/profiler.h b/base/debug/profiler.h
index d703876b4df5d0151bf0c05ca021de33cc66c12a..973e4f221887e4416c7eaf590550155825fd6902 100644
--- a/base/debug/profiler.h
+++ b/base/debug/profiler.h
@@ -55,11 +55,32 @@ BASE_EXPORT bool IsBinaryInstrumented();
typedef uintptr_t (*ReturnAddressLocationResolver)(
uintptr_t return_addr_location);
-// If this binary is instrumented and the instrumentation supplies a return
-// address resolution function, finds and returns the address resolution
-// function. Otherwise returns NULL.
-BASE_EXPORT ReturnAddressLocationResolver
- GetProfilerReturnAddrResolutionFunc();
+// This type declaration must match V8's FunctionEntryHook.
+typedef void (*DynamicFunctionEntryHook)(uintptr_t function,
+ uintptr_t return_addr_location);
+
+// The functions below here are to support profiling V8-generated code.
+// V8 has provisions for generating a call to an entry hook for newly generated
+// JIT code, and it can push symbol information on code generation and advise
+// when the garbage collector moves code. The functions declarations below here
+// make glue between V8's facilities and a profiler.
+
+// This type declaration must match V8's FunctionEntryHook.
+typedef void (*DynamicFunctionEntryHook)(uintptr_t function,
+ uintptr_t return_addr_location);
+
+typedef void (*AddDynamicSymbol)(
+ const void* address, size_t length, const char* name, size_t name_len);
jar (doing other things) 2013/06/22 00:38:14 nit: Chromium style guide suggests that for declar
Sigurður Ásgeirsson 2013/06/27 17:42:35 Done.
+typedef void (*MoveDynamicSymbol)(const void* address, const void* new_address);
+
+
+// If this binary is instrumented and the instrumentation supplies a function
+// for each of those purposes, find and return the the function in question.
+// Otherwise returns NULL.
+BASE_EXPORT ReturnAddressLocationResolver GetProfilerReturnAddrResolutionFunc();
+BASE_EXPORT DynamicFunctionEntryHook GetProfilerDynamicFunctionEntryHookFunc();
+BASE_EXPORT AddDynamicSymbol GetProfilerAddDynamicSymbolFunc();
+BASE_EXPORT MoveDynamicSymbol GetProfilerMoveDynamicSymbolFunc();
} // namespace debug
} // namespace base
« no previous file with comments | « no previous file | base/debug/profiler.cc » ('j') | base/debug/profiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698