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

Unified Diff: src/v8-counters.h

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.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 3427)
+++ src/v8-counters.h (working copy)
@@ -158,15 +158,15 @@
SC(string_add_native, V8.StringAddNative)
// 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;
HISTOGRAM_TIMER_LIST(HT)
#undef HT
#define SC(name, caption) \
- static StatsCounter name;
+ StatsCounter name;
STATS_COUNTER_LIST_1(SC)
STATS_COUNTER_LIST_2(SC)
#undef SC
@@ -186,9 +186,18 @@
};
// Sliding state window counters.
- static StatsCounter state_counters[];
+ StatsCounter* const state_counters;
+ private:
+ Counters();
+ friend class V8Context;
+ DISALLOW_COPY_AND_ASSIGN(Counters);
};
+#define COUNTER(name) v8::v8_context()->counters_.name
+#define INC_COUNTER(name) COUNTER(name).Increment()
+#define DEC_COUNTER(name) COUNTER(name).Decrement()
+#define INCREMENT_COUNTER(name, amount) COUNTER(name).Increment(amount)
+#define DECREMENT_COUNTER(name, amount) COUNTER(name).Decrement(amount)
} } // 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