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

Unified Diff: src/runtime-profiler.cc

Issue 5890003: Make V8 compilable with profiling support turned off. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 10 years 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 | « src/log.cc ('k') | src/top.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime-profiler.cc
diff --git a/src/runtime-profiler.cc b/src/runtime-profiler.cc
index 3c0490f8ded66615de1349f889a5f3b9a401a159..c53ddd2b9714ba0ddb76479e41addda787177da9 100644
--- a/src/runtime-profiler.cc
+++ b/src/runtime-profiler.cc
@@ -350,6 +350,7 @@ void RuntimeProfiler::OptimizeSoon(JSFunction* function) {
}
+#ifdef ENABLE_LOGGING_AND_PROFILING
static void UpdateStateRatio(SamplerState current_state) {
static const int kStateWindowSize = 128;
static SamplerState state_window[kStateWindowSize];
@@ -366,15 +367,18 @@ static void UpdateStateRatio(SamplerState current_state) {
NoBarrier_Store(&js_ratio, state_counts[IN_JS_STATE] * 100 /
kStateWindowSize);
}
+#endif
void RuntimeProfiler::NotifyTick() {
+#ifdef ENABLE_LOGGING_AND_PROFILING
// Record state sample.
SamplerState state = Top::IsInJSState()
? IN_JS_STATE
: IN_NON_JS_STATE;
UpdateStateRatio(state);
StackGuard::RequestRuntimeProfilerTick();
+#endif
}
@@ -428,6 +432,7 @@ int RuntimeProfiler::SamplerWindowSize() {
bool RuntimeProfilerRateLimiter::SuspendIfNecessary() {
+#ifdef ENABLE_LOGGING_AND_PROFILING
static const int kNonJSTicksThreshold = 100;
// We suspend the runtime profiler thread when not running
// JavaScript. If the CPU profiler is active we must not do this
@@ -445,6 +450,7 @@ bool RuntimeProfilerRateLimiter::SuspendIfNecessary() {
}
}
}
+#endif
return false;
}
« no previous file with comments | « src/log.cc ('k') | src/top.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698