Index: base/debug/profiler.h |
diff --git a/base/debug/profiler.h b/base/debug/profiler.h |
index 69795a507853a83321cf6645ba62e70db71f5ea9..e88d6715b85c11a5cbf746b012136e959d3e33de 100644 |
--- a/base/debug/profiler.h |
+++ b/base/debug/profiler.h |
@@ -34,6 +34,26 @@ BASE_EXPORT bool BeingProfiled(); |
// Reset profiling after a fork, which disables timers. |
BASE_EXPORT void RestartProfilingAfterFork(); |
+// Returns true iff this executable is instrumented with the Syzygy profiler. |
+BASE_EXPORT bool IsBinaryInstrumented(); |
+ |
+// A return address resolution function is used to resolve the location |
+// on stack where a return address originally resided, to the location where |
+// the profiler stashed the original return address. |
jar (doing other things)
2012/02/27 22:44:10
I couldn't understand this comment. Specifically,
Sigurður Ásgeirsson
2012/02/28 16:31:40
Reworked comment with a lot more detail.
|
+// This is necessary for V8 and any other code that looks at the return address |
+// to see where a call originated and/or rewrites the return address. V8 looks |
+// at the return address to identify the JavaScript function that invoked it, |
+// and may rewrite return addresses when it garbage collects or optimizes the |
+// JIT code. |
+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(); |
+ |
} // namespace debug |
} // namespace base |