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

Unified Diff: src/log.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/liveedit-debugger.js ('k') | src/log.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/log.h
diff --git a/src/log.h b/src/log.h
index a889079a4efe7df4b22117434f8d29244f13e73c..77bf8aef313a181cf5697a2c0d151ca2057d6ac7 100644
--- a/src/log.h
+++ b/src/log.h
@@ -140,6 +140,9 @@ class CompressionHelper;
// original tags when writing to the log.
+class Sampler;
+
+
class Logger {
public:
#define DECLARE_ENUM(enum_item, ignore1, ignore2) enum_item,
@@ -152,6 +155,11 @@ class Logger {
// Acquires resources for logging if the right flags are set.
bool Setup();
+ void EnsureTickerStarted();
+ void EnsureTickerStopped();
+
+ Sampler* sampler();
+
// Frees resources acquired in Setup.
void TearDown();
@@ -407,10 +415,43 @@ class Logger {
};
+// Process wide registry of samplers.
+class SamplerRegistry : public AllStatic {
+ public:
+ enum State {
+ HAS_NO_SAMPLERS,
+ HAS_SAMPLERS,
+ HAS_CPU_PROFILING_SAMPLERS
+ };
+
+ typedef void (*VisitSampler)(Sampler*, void*);
+
+ static State GetState();
+
+ // Iterates over all active samplers keeping the internal lock held.
+ // Returns whether there are any active samplers.
+ static bool IterateActiveSamplers(VisitSampler func, void* param);
+
+ // Adds/Removes an active sampler.
+ static void AddActiveSampler(Sampler* sampler);
+ static void RemoveActiveSampler(Sampler* sampler);
+
+ private:
+ static bool ActiveSamplersExist() {
+ return active_samplers_ != NULL && !active_samplers_->is_empty();
+ }
+
+ static Mutex* mutex_; // Protects the state below.
+ static List<Sampler*>* active_samplers_;
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(SamplerRegistry);
+};
+
+
// Class that extracts stack trace, used for profiling.
class StackTracer : public AllStatic {
public:
- static void Trace(TickSample* sample);
+ static void Trace(Isolate* isolate, TickSample* sample);
};
} } // namespace v8::internal
« no previous file with comments | « src/liveedit-debugger.js ('k') | src/log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698