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

Unified Diff: src/runtime-profiler.h

Issue 6825054: Add global setup for runtime profiler. (Closed)
Patch Set: Created 9 years, 8 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 | src/runtime-profiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime-profiler.h
diff --git a/src/runtime-profiler.h b/src/runtime-profiler.h
index 3656893ae783c556bf1215bba30c4ffc1c057f7d..692b4ffacc29c5e03a7f7f3d312cd641c0d806d0 100644
--- a/src/runtime-profiler.h
+++ b/src/runtime-profiler.h
@@ -44,7 +44,12 @@ class RuntimeProfiler {
public:
explicit RuntimeProfiler(Isolate* isolate);
- static bool IsEnabled();
+ static void GlobalSetup();
+
+ static inline bool IsEnabled() {
+ ASSERT(has_been_globally_setup_);
+ return enabled_;
+ }
void OptimizeNow();
void OptimizeSoon(JSFunction* function);
@@ -143,6 +148,11 @@ class RuntimeProfiler {
// 0 or positive => the number of isolates running JavaScript code.
static Atomic32 state_;
static Semaphore* semaphore_;
+
+#ifdef DEBUG
+ static bool has_been_globally_setup_;
+#endif
+ static bool enabled_;
};
« no previous file with comments | « no previous file | src/runtime-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698