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

Unified Diff: src/v8-counters.h

Issue 6685088: Merge isolates to bleeding_edge. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 9 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/v8.cc ('k') | src/v8-counters.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/v8-counters.h
===================================================================
--- src/v8-counters.h (revision 7267)
+++ src/v8-counters.h (working copy)
@@ -254,15 +254,15 @@
// This file contains all the v8 counters that are in use.
-class Counters : AllStatic {
+class Counters {
public:
#define HT(name, caption) \
- static HistogramTimer name;
+ HistogramTimer* name() { return &name##_; }
HISTOGRAM_TIMER_LIST(HT)
#undef HT
#define SC(name, caption) \
- static StatsCounter name;
+ StatsCounter* name() { return &name##_; }
STATS_COUNTER_LIST_1(SC)
STATS_COUNTER_LIST_2(SC)
#undef SC
@@ -272,19 +272,47 @@
HISTOGRAM_TIMER_LIST(RATE_ID)
#undef RATE_ID
#define COUNTER_ID(name, caption) k_##name,
- STATS_COUNTER_LIST_1(COUNTER_ID)
- STATS_COUNTER_LIST_2(COUNTER_ID)
+ STATS_COUNTER_LIST_1(COUNTER_ID)
+ STATS_COUNTER_LIST_2(COUNTER_ID)
#undef COUNTER_ID
#define COUNTER_ID(name) k_##name,
- STATE_TAG_LIST(COUNTER_ID)
+ STATE_TAG_LIST(COUNTER_ID)
#undef COUNTER_ID
stats_counter_count
};
+ StatsCounter* state_counters(StateTag state) {
+ return &state_counters_[state];
+ }
+
+ private:
+#define HT(name, caption) \
+ HistogramTimer name##_;
+ HISTOGRAM_TIMER_LIST(HT)
+#undef HT
+
+#define SC(name, caption) \
+ StatsCounter name##_;
+ STATS_COUNTER_LIST_1(SC)
+ STATS_COUNTER_LIST_2(SC)
+#undef SC
+
+ enum {
+#define COUNTER_ID(name) __##name,
+ STATE_TAG_LIST(COUNTER_ID)
+#undef COUNTER_ID
+ kSlidingStateWindowCounterCount
+ };
+
// Sliding state window counters.
- static StatsCounter state_counters[];
+ StatsCounter state_counters_[kSlidingStateWindowCounterCount];
+ friend class Isolate;
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(Counters);
};
+#define COUNTERS Isolate::Current()->counters()
+
} } // namespace v8::internal
#endif // V8_V8_COUNTERS_H_
« no previous file with comments | « src/v8.cc ('k') | src/v8-counters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698