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

Unified Diff: src/runtime-profiler.cc

Issue 5720003: Fix bug that disabled optimization when profiling. (Closed) Base URL: http://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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime-profiler.cc
===================================================================
--- src/runtime-profiler.cc (revision 5961)
+++ src/runtime-profiler.cc (working copy)
@@ -424,17 +424,22 @@
bool RuntimeProfilerRateLimiter::SuspendIfNecessary() {
static const int kNonJSTicksThreshold = 100;
+ bool top_is_in_js_state = Top::IsInJSState();
+ // Record state sample.
+ if (top_is_in_js_state) {
Florian Schneider 2010/12/10 14:02:55 Do you need to check for RuntimeProfiler::IsEnable
Karl Klose 2010/12/10 14:08:48 Done.
+ AddStateSample(IN_JS_STATE);
+ } else {
+ AddStateSample(IN_NON_JS_STATE);
+ }
// We suspend the runtime profiler thread when not running
// JavaScript. If the CPU profiler is active we must not do this
// because it samples both JavaScript and C++ code.
if (RuntimeProfiler::IsEnabled() &&
!CpuProfiler::is_profiling() &&
!(FLAG_prof && FLAG_prof_auto)) {
- if (Top::IsInJSState()) {
- AddStateSample(IN_JS_STATE);
+ if (top_is_in_js_state) {
non_js_ticks_ = 0;
} else {
- AddStateSample(IN_NON_JS_STATE);
if (non_js_ticks_ < kNonJSTicksThreshold) {
++non_js_ticks_;
} else {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698