V8 Project
v8::internal::Counters Class Reference

#include <counters.h>

+ Collaboration diagram for v8::internal::Counters:

Public Types

enum  Id { stats_counter_count }
 

Public Member Functions

void ResetCounters ()
 
void ResetHistograms ()
 

Private Member Functions

 Counters (Isolate *isolate)
 
 DISALLOW_IMPLICIT_CONSTRUCTORS (Counters)
 

Friends

class Isolate
 

Detailed Description

Definition at line 559 of file counters.h.

Member Enumeration Documentation

◆ Id

Enumerator
stats_counter_count 

Definition at line 617 of file counters.h.

617  {
618 #define RATE_ID(name, caption) k_##name,
620 #undef RATE_ID
621 #define PERCENTAGE_ID(name, caption) k_##name,
623 #undef PERCENTAGE_ID
624 #define MEMORY_ID(name, caption) k_##name,
626 #undef MEMORY_ID
627 #define COUNTER_ID(name, caption) k_##name,
630 #undef COUNTER_ID
631 #define COUNTER_ID(name) kCountOf##name, kSizeOf##name,
633 #undef COUNTER_ID
634 #define COUNTER_ID(name) kCountOfCODE_TYPE_##name, \
635  kSizeOfCODE_TYPE_##name,
637 #undef COUNTER_ID
638 #define COUNTER_ID(name) kCountOfFIXED_ARRAY__##name, \
639  kSizeOfFIXED_ARRAY__##name,
641 #undef COUNTER_ID
642 #define COUNTER_ID(name) kCountOfCODE_AGE__##name, \
643  kSizeOfCODE_AGE__##name,
645 #undef COUNTER_ID
647  };
#define CODE_AGE_LIST_COMPLETE(V)
Definition: builtins.h:30
#define STATS_COUNTER_LIST_1(SC)
Definition: counters.h:380
#define HISTOGRAM_TIMER_LIST(HT)
Definition: counters.h:300
#define MEMORY_ID(name, caption)
Definition: counters.h:624
#define HISTOGRAM_PERCENTAGE_LIST(HP)
Definition: counters.h:320
#define PERCENTAGE_ID(name, caption)
Definition: counters.h:621
#define COUNTER_ID(name, caption)
Definition: counters.h:642
#define RATE_ID(name, caption)
Definition: counters.h:618
#define HISTOGRAM_MEMORY_LIST(HM)
Definition: counters.h:360
#define STATS_COUNTER_LIST_2(SC)
Definition: counters.h:433
#define INSTANCE_TYPE_LIST(V)
Definition: objects.h:339
#define CODE_KIND_LIST(V)
Definition: objects.h:4950
#define FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(V)
Definition: objects.h:800

Constructor & Destructor Documentation

◆ Counters()

v8::internal::Counters::Counters ( Isolate isolate)
explicitprivate

Definition at line 57 of file counters.cc.

57  {
58 #define HR(name, caption, min, max, num_buckets) \
59  name##_ = Histogram(#caption, min, max, num_buckets, isolate);
61 #undef HR
62 
63 #define HT(name, caption) \
64  name##_ = HistogramTimer(#caption, 0, 10000, 50, isolate);
66 #undef HT
67 
68 #define HP(name, caption) \
69  name##_ = Histogram(#caption, 0, 101, 100, isolate);
71 #undef HP
72 
73 #define HM(name, caption) \
74  name##_ = Histogram(#caption, 1000, 500000, 50, isolate);
76 #undef HM
77 
78 #define SC(name, caption) \
79  name##_ = StatsCounter(isolate, "c:" #caption);
80 
83 #undef SC
84 
85 #define SC(name) \
86  count_of_##name##_ = StatsCounter(isolate, "c:" "V8.CountOf_" #name); \
87  size_of_##name##_ = StatsCounter(isolate, "c:" "V8.SizeOf_" #name);
89 #undef SC
90 
91 #define SC(name) \
92  count_of_CODE_TYPE_##name##_ = \
93  StatsCounter(isolate, "c:" "V8.CountOf_CODE_TYPE-" #name); \
94  size_of_CODE_TYPE_##name##_ = \
95  StatsCounter(isolate, "c:" "V8.SizeOf_CODE_TYPE-" #name);
97 #undef SC
98 
99 #define SC(name) \
100  count_of_FIXED_ARRAY_##name##_ = \
101  StatsCounter(isolate, "c:" "V8.CountOf_FIXED_ARRAY-" #name); \
102  size_of_FIXED_ARRAY_##name##_ = \
103  StatsCounter(isolate, "c:" "V8.SizeOf_FIXED_ARRAY-" #name);
105 #undef SC
106 
107 #define SC(name) \
108  count_of_CODE_AGE_##name##_ = \
109  StatsCounter(isolate, "c:" "V8.CountOf_CODE_AGE-" #name); \
110  size_of_CODE_AGE_##name##_ = \
111  StatsCounter(isolate, "c:" "V8.SizeOf_CODE_AGE-" #name);
113 #undef SC
114 }
#define HT(name, caption)
#define HR(name, caption, min, max, num_buckets)
#define HP(name, caption)
#define HM(name, caption)
#define SC(name, caption)
#define HISTOGRAM_RANGE_LIST(HR)
Definition: counters.h:294

References CODE_AGE_LIST_COMPLETE, CODE_KIND_LIST, FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST, HISTOGRAM_MEMORY_LIST, HISTOGRAM_PERCENTAGE_LIST, HISTOGRAM_RANGE_LIST, HISTOGRAM_TIMER_LIST, HM, HP, HR, HT, INSTANCE_TYPE_LIST, SC, STATS_COUNTER_LIST_1, and STATS_COUNTER_LIST_2.

Member Function Documentation

◆ DISALLOW_IMPLICIT_CONSTRUCTORS()

v8::internal::Counters::DISALLOW_IMPLICIT_CONSTRUCTORS ( Counters  )
private

◆ ResetCounters()

void v8::internal::Counters::ResetCounters ( )

Definition at line 117 of file counters.cc.

117  {
118 #define SC(name, caption) name##_.Reset();
121 #undef SC
122 
123 #define SC(name) \
124  count_of_##name##_.Reset(); \
125  size_of_##name##_.Reset();
127 #undef SC
128 
129 #define SC(name) \
130  count_of_CODE_TYPE_##name##_.Reset(); \
131  size_of_CODE_TYPE_##name##_.Reset();
133 #undef SC
134 
135 #define SC(name) \
136  count_of_FIXED_ARRAY_##name##_.Reset(); \
137  size_of_FIXED_ARRAY_##name##_.Reset();
139 #undef SC
140 
141 #define SC(name) \
142  count_of_CODE_AGE_##name##_.Reset(); \
143  size_of_CODE_AGE_##name##_.Reset();
145 #undef SC
146 }

References CODE_AGE_LIST_COMPLETE, CODE_KIND_LIST, FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST, INSTANCE_TYPE_LIST, SC, STATS_COUNTER_LIST_1, and STATS_COUNTER_LIST_2.

Referenced by v8::Isolate::SetCounterFunction().

+ Here is the caller graph for this function:

◆ ResetHistograms()

void v8::internal::Counters::ResetHistograms ( )

Definition at line 149 of file counters.cc.

149  {
150 #define HR(name, caption, min, max, num_buckets) name##_.Reset();
152 #undef HR
153 
154 #define HT(name, caption) name##_.Reset();
156 #undef HT
157 
158 #define HP(name, caption) name##_.Reset();
160 #undef HP
161 
162 #define HM(name, caption) name##_.Reset();
164 #undef HM
165 }

References HISTOGRAM_MEMORY_LIST, HISTOGRAM_PERCENTAGE_LIST, HISTOGRAM_RANGE_LIST, HISTOGRAM_TIMER_LIST, HM, HP, HR, and HT.

Referenced by v8::Isolate::SetCreateHistogramFunction().

+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ Isolate

friend class Isolate
friend

Definition at line 702 of file counters.h.


The documentation for this class was generated from the following files: