summaryrefslogtreecommitdiff
path: root/deps/v8/src/counters.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/counters.cc')
-rw-r--r--deps/v8/src/counters.cc49
1 files changed, 45 insertions, 4 deletions
diff --git a/deps/v8/src/counters.cc b/deps/v8/src/counters.cc
index eb1b4c27f..a8dcc0bdc 100644
--- a/deps/v8/src/counters.cc
+++ b/deps/v8/src/counters.cc
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "v8.h"
+#include "src/v8.h"
-#include "counters.h"
-#include "isolate.h"
-#include "platform.h"
+#include "src/base/platform/platform.h"
+#include "src/counters.h"
+#include "src/isolate.h"
namespace v8 {
namespace internal {
@@ -55,6 +55,11 @@ void HistogramTimer::Stop() {
Counters::Counters(Isolate* isolate) {
+#define HR(name, caption, min, max, num_buckets) \
+ name##_ = Histogram(#caption, min, max, num_buckets, isolate);
+ HISTOGRAM_RANGE_LIST(HR)
+#undef HR
+
#define HT(name, caption) \
name##_ = HistogramTimer(#caption, 0, 10000, 50, isolate);
HISTOGRAM_TIMER_LIST(HT)
@@ -109,7 +114,43 @@ Counters::Counters(Isolate* isolate) {
}
+void Counters::ResetCounters() {
+#define SC(name, caption) name##_.Reset();
+ STATS_COUNTER_LIST_1(SC)
+ STATS_COUNTER_LIST_2(SC)
+#undef SC
+
+#define SC(name) \
+ count_of_##name##_.Reset(); \
+ size_of_##name##_.Reset();
+ INSTANCE_TYPE_LIST(SC)
+#undef SC
+
+#define SC(name) \
+ count_of_CODE_TYPE_##name##_.Reset(); \
+ size_of_CODE_TYPE_##name##_.Reset();
+ CODE_KIND_LIST(SC)
+#undef SC
+
+#define SC(name) \
+ count_of_FIXED_ARRAY_##name##_.Reset(); \
+ size_of_FIXED_ARRAY_##name##_.Reset();
+ FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(SC)
+#undef SC
+
+#define SC(name) \
+ count_of_CODE_AGE_##name##_.Reset(); \
+ size_of_CODE_AGE_##name##_.Reset();
+ CODE_AGE_LIST_COMPLETE(SC)
+#undef SC
+}
+
+
void Counters::ResetHistograms() {
+#define HR(name, caption, min, max, num_buckets) name##_.Reset();
+ HISTOGRAM_RANGE_LIST(HR)
+#undef HR
+
#define HT(name, caption) name##_.Reset();
HISTOGRAM_TIMER_LIST(HT)
#undef HT