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

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: Fix clang compile problem. Created 7 years, 5 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') | no next file with comments »
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..e1dda89742620ff85e75f558c900ae1ecad09029 100644
--- a/base/debug/profiler.h
+++ b/base/debug/profiler.h
@@ -55,11 +55,34 @@ 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);
+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 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698