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

Unified Diff: src/v8-counters.cc

Issue 435003: Patch for allowing several V8 instances in process:... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years 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-counters.h ('k') | src/v8-global-context.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/v8-counters.cc
===================================================================
--- src/v8-counters.cc (revision 3427)
+++ src/v8-counters.cc (working copy)
@@ -31,25 +31,40 @@
namespace v8 {
namespace internal {
-
-#define HT(name, caption) \
- HistogramTimer Counters::name = { #caption, NULL, false, 0, 0 }; \
-
- HISTOGRAM_TIMER_LIST(HT)
-#undef SR
-
-#define SC(name, caption) \
- StatsCounter Counters::name = { "c:" #caption, NULL, false };
-
- STATS_COUNTER_LIST_1(SC)
- STATS_COUNTER_LIST_2(SC)
-#undef SC
-
-StatsCounter Counters::state_counters[] = {
+static StatsCounter state_counters[] = {
#define COUNTER_NAME(name) \
{ "c:V8.State" #name, NULL, false },
STATE_TAG_LIST(COUNTER_NAME)
#undef COUNTER_NAME
};
+enum {
+ #define COUNTER_ID(name) k##name,
+ STATE_TAG_LIST(COUNTER_ID)
+#undef COUNTER_ID
+ state_counters_count
+};
+
+Counters::Counters()
+ : state_counters(new StatsCounter[state_counters_count]) {
+ #define HT(name, caption) \
+ HistogramTimer _##name = { #caption, NULL, false, 0, 0 }; \
+ name = _##name; \
+
+ HISTOGRAM_TIMER_LIST(HT)
+ #undef HT
+
+ #define SC(name, caption) \
+ StatsCounter _##name = { "c:" #caption, NULL, false }; \
+ name = _##name;
+
+ STATS_COUNTER_LIST_1(SC)
+ STATS_COUNTER_LIST_2(SC)
+ #undef SC
+
+ for (int i = 0; i < state_counters_count; ++i) {
+ state_counters[i] = v8::internal::state_counters[i];
+ }
+}
+
} } // namespace v8::internal
« no previous file with comments | « src/v8-counters.h ('k') | src/v8-global-context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698