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

Unified Diff: src/runtime-profiler.cc

Issue 7535004: Merge bleeding edge up to 8774 into the GC branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: Created 9 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 | « src/runtime.js ('k') | src/scopeinfo.cc » ('j') | 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 8778)
+++ src/runtime-profiler.cc (working copy)
@@ -61,9 +61,7 @@
Atomic32 RuntimeProfiler::state_ = 0;
// TODO(isolates): Create the semaphore lazily and clean it up when no
// longer required.
-#ifdef ENABLE_LOGGING_AND_PROFILING
Semaphore* RuntimeProfiler::semaphore_ = OS::CreateSemaphore(0);
-#endif
#ifdef DEBUG
bool RuntimeProfiler::has_been_globally_setup_ = false;
@@ -245,9 +243,7 @@
void RuntimeProfiler::NotifyTick() {
-#ifdef ENABLE_LOGGING_AND_PROFILING
isolate_->stack_guard()->RequestRuntimeProfilerTick();
-#endif
}
@@ -295,7 +291,6 @@
void RuntimeProfiler::HandleWakeUp(Isolate* isolate) {
-#ifdef ENABLE_LOGGING_AND_PROFILING
// The profiler thread must still be waiting.
ASSERT(NoBarrier_Load(&state_) >= 0);
// In IsolateEnteredJS we have already incremented the counter and
@@ -303,7 +298,6 @@
// to get the right count of active isolates.
NoBarrier_AtomicIncrement(&state_, 1);
semaphore_->Signal();
-#endif
}
@@ -313,18 +307,15 @@
bool RuntimeProfiler::WaitForSomeIsolateToEnterJS() {
-#ifdef ENABLE_LOGGING_AND_PROFILING
Atomic32 old_state = NoBarrier_CompareAndSwap(&state_, 0, -1);
ASSERT(old_state >= -1);
if (old_state != 0) return false;
semaphore_->Wait();
-#endif
return true;
}
void RuntimeProfiler::StopRuntimeProfilerThreadBeforeShutdown(Thread* thread) {
-#ifdef ENABLE_LOGGING_AND_PROFILING
// Do a fake increment. If the profiler is waiting on the semaphore,
// the returned state is 0, which can be left as an initial state in
// case profiling is restarted later. If the profiler is not
@@ -343,7 +334,6 @@
if (new_state != 0) {
NoBarrier_AtomicIncrement(&state_, -1);
}
-#endif
}
@@ -366,11 +356,9 @@
bool RuntimeProfilerRateLimiter::SuspendIfNecessary() {
-#ifdef ENABLE_LOGGING_AND_PROFILING
if (!RuntimeProfiler::IsSomeIsolateInJS()) {
return RuntimeProfiler::WaitForSomeIsolateToEnterJS();
}
-#endif
return false;
}
« no previous file with comments | « src/runtime.js ('k') | src/scopeinfo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698