v8  3.25.30(node0.11.13)
V8 is Google's open source JavaScript engine
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
v8-counters.cc
Go to the documentation of this file.
1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are
4 // met:
5 //
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided
11 // with the distribution.
12 // * Neither the name of Google Inc. nor the names of its
13 // contributors may be used to endorse or promote products derived
14 // from this software without specific prior written permission.
15 //
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 
28 #include "v8.h"
29 
30 #include "v8-counters.h"
31 
32 namespace v8 {
33 namespace internal {
34 
35 Counters::Counters(Isolate* isolate) {
36 #define HT(name, caption) \
37  name##_ = HistogramTimer(#caption, 0, 10000, 50, isolate);
39 #undef HT
40 
41 #define HP(name, caption) \
42  name##_ = Histogram(#caption, 0, 101, 100, isolate);
44 #undef HP
45 
46 #define HM(name, caption) \
47  name##_ = Histogram(#caption, 1000, 500000, 50, isolate);
49 #undef HM
50 
51 #define SC(name, caption) \
52  name##_ = StatsCounter(isolate, "c:" #caption);
53 
56 #undef SC
57 
58 #define SC(name) \
59  count_of_##name##_ = StatsCounter(isolate, "c:" "V8.CountOf_" #name); \
60  size_of_##name##_ = StatsCounter(isolate, "c:" "V8.SizeOf_" #name);
62 #undef SC
63 
64 #define SC(name) \
65  count_of_CODE_TYPE_##name##_ = \
66  StatsCounter(isolate, "c:" "V8.CountOf_CODE_TYPE-" #name); \
67  size_of_CODE_TYPE_##name##_ = \
68  StatsCounter(isolate, "c:" "V8.SizeOf_CODE_TYPE-" #name);
70 #undef SC
71 
72 #define SC(name) \
73  count_of_FIXED_ARRAY_##name##_ = \
74  StatsCounter(isolate, "c:" "V8.CountOf_FIXED_ARRAY-" #name); \
75  size_of_FIXED_ARRAY_##name##_ = \
76  StatsCounter(isolate, "c:" "V8.SizeOf_FIXED_ARRAY-" #name);
78 #undef SC
79 
80 #define SC(name) \
81  count_of_CODE_AGE_##name##_ = \
82  StatsCounter(isolate, "c:" "V8.CountOf_CODE_AGE-" #name); \
83  size_of_CODE_AGE_##name##_ = \
84  StatsCounter(isolate, "c:" "V8.SizeOf_CODE_AGE-" #name);
86 #undef SC
87 }
88 
89 
91 #define HT(name, caption) name##_.Reset();
93 #undef HT
94 
95 #define HP(name, caption) name##_.Reset();
97 #undef HP
98 
99 #define HM(name, caption) name##_.Reset();
101 #undef HM
102 }
103 
104 } } // namespace v8::internal
#define CODE_AGE_LIST_COMPLETE(V)
Definition: builtins.h:53
#define INSTANCE_TYPE_LIST(V)
Definition: objects.h:342
#define HM(name, caption)
#define STATS_COUNTER_LIST_2(SC)
Definition: v8-counters.h:165
#define HISTOGRAM_MEMORY_LIST(HM)
Definition: v8-counters.h:93
#define HISTOGRAM_PERCENTAGE_LIST(HP)
Definition: v8-counters.h:53
#define HT(name, caption)
#define FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(V)
Definition: objects.h:863
#define CODE_KIND_LIST(V)
Definition: objects.h:5204
#define SC(name, caption)
#define HISTOGRAM_TIMER_LIST(HT)
Definition: v8-counters.h:39
#define HP(name, caption)
#define STATS_COUNTER_LIST_1(SC)
Definition: v8-counters.h:113