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

Unified Diff: src/cpu-profiler.h

Issue 6529055: [Isolates] Merge crankshaft (r5922 from bleeding_edge). (Closed)
Patch Set: Win32 port Created 9 years, 10 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/contexts.cc ('k') | src/cpu-profiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/cpu-profiler.h
diff --git a/src/cpu-profiler.h b/src/cpu-profiler.h
index 9d54984f9520b4d5e7cd2f140deb1a16ffe3621f..ca263f588d98411292b35dc417bb5a228d55efdc 100644
--- a/src/cpu-profiler.h
+++ b/src/cpu-profiler.h
@@ -30,6 +30,7 @@
#ifdef ENABLE_LOGGING_AND_PROFILING
+#include "atomicops.h"
#include "circular-queue.h"
#include "unbound-queue.h"
@@ -243,7 +244,7 @@ class CpuProfiler {
static CpuProfile* FindProfile(Object* security_token, unsigned uid);
// Invoked from stack sampler (thread or signal handler.)
- static TickSample* TickSampleEvent();
+ static TickSample* TickSampleEvent(Isolate* isolate);
// Must be called via PROFILE macro, otherwise will crash when
// profiling is not enabled.
@@ -271,13 +272,15 @@ class CpuProfiler {
static void ProcessMovedFunctions();
static void SetterCallbackEvent(String* name, Address entry_point);
+ // TODO(isolates): this doesn't have to use atomics anymore.
+
static INLINE(bool is_profiling()) {
return is_profiling(Isolate::Current());
}
static INLINE(bool is_profiling(Isolate* isolate)) {
- return isolate->cpu_profiler() != NULL &&
- isolate->cpu_profiler()->processor_ != NULL;
+ CpuProfiler* profiler = isolate->cpu_profiler();
+ return profiler != NULL && NoBarrier_Load(&profiler->is_profiling_);
}
private:
@@ -296,6 +299,7 @@ class CpuProfiler {
ProfileGenerator* generator_;
ProfilerEventsProcessor* processor_;
int saved_logging_nesting_;
+ Atomic32 is_profiling_;
#else
static INLINE(bool is_profiling()) { return false; }
« no previous file with comments | « src/contexts.cc ('k') | src/cpu-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698