Commit d394f31d authored by yurys@chromium.org's avatar yurys@chromium.org

Use boolean instead of Atomic32 for is_profiling_ flag

The field is only accessed on the JS thread so it can be converted into bool.

BUG=None

Review URL: https://codereview.chromium.org/12340052

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13731 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 52a015b1
......@@ -491,7 +491,7 @@ void CpuProfiler::StartProcessorIfNotStarted() {
isolate->logger()->logging_nesting_ = 0;
generator_ = new ProfileGenerator(profiles_);
processor_ = new ProfilerEventsProcessor(generator_);
NoBarrier_Store(&is_profiling_, true);
is_profiling_ = true;
processor_->Start();
// Enumerate stuff we already have in the heap.
if (isolate->heap()->HasBeenSetUp()) {
......@@ -552,7 +552,7 @@ void CpuProfiler::StopProcessor() {
sampler->Stop();
need_to_stop_sampler_ = false;
}
NoBarrier_Store(&is_profiling_, false);
is_profiling_ = false;
processor_->Stop();
processor_->Join();
delete processor_;
......
......@@ -245,11 +245,9 @@ class CpuProfiler {
static void SetterCallbackEvent(String* name, Address entry_point);
static void SharedFunctionInfoMoveEvent(Address from, Address to);
// TODO(isolates): this doesn't have to use atomics anymore.
static INLINE(bool is_profiling(Isolate* isolate)) {
CpuProfiler* profiler = isolate->cpu_profiler();
return profiler != NULL && NoBarrier_Load(&profiler->is_profiling_);
return profiler != NULL && profiler->is_profiling_;
}
private:
......@@ -271,7 +269,7 @@ class CpuProfiler {
ProfilerEventsProcessor* processor_;
int saved_logging_nesting_;
bool need_to_stop_sampler_;
Atomic32 is_profiling_;
bool is_profiling_;
private:
DISALLOW_COPY_AND_ASSIGN(CpuProfiler);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment