50
51
HT(compile_lazy, V8.CompileLazy)
54
#define HISTOGRAM_PERCENTAGE_LIST(HP) \
55
HP(external_fragmentation_total, \
56
V8.MemoryExternalFragmentationTotal) \
57
HP(external_fragmentation_old_pointer_space, \
58
V8.MemoryExternalFragmentationOldPointerSpace) \
59
HP(external_fragmentation_old_data_space, \
60
V8.MemoryExternalFragmentationOldDataSpace) \
61
HP(external_fragmentation_code_space, \
62
V8.MemoryExternalFragmentationCodeSpace) \
63
HP(external_fragmentation_map_space, \
64
V8.MemoryExternalFragmentationMapSpace) \
65
HP(external_fragmentation_cell_space, \
66
V8.MemoryExternalFragmentationCellSpace) \
67
HP(external_fragmentation_lo_space, \
68
V8.MemoryExternalFragmentationLoSpace) \
69
HP(heap_fraction_map_space, \
70
V8.MemoryHeapFractionMapSpace) \
71
HP(heap_fraction_cell_space, \
72
V8.MemoryHeapFractionCellSpace) \
75
#define HISTOGRAM_MEMORY_LIST(HM) \
76
HM(heap_sample_total_committed, V8.MemoryHeapSampleTotalCommitted) \
77
HM(heap_sample_total_used, V8.MemoryHeapSampleTotalUsed) \
78
HM(heap_sample_map_space_committed, \
79
V8.MemoryHeapSampleMapSpaceCommitted) \
80
HM(heap_sample_cell_space_committed, \
81
V8.MemoryHeapSampleCellSpaceCommitted)
53
84
// WARNING: STATS_COUNTER_LIST_* is a very large macro that is causing MSVC
54
85
// Intellisense to crash. It was broken into two macros (each of length 40
55
86
// lines) rather than one macro (of length about 80 lines) to work around
107
138
SC(contexts_created_by_snapshot, V8.ContextsCreatedBySnapshot) \
108
139
/* Number of code objects found from pc. */ \
109
140
SC(pc_to_code, V8.PcToCode) \
110
SC(pc_to_code_cached, V8.PcToCodeCached)
141
SC(pc_to_code_cached, V8.PcToCodeCached) \
142
/* The store-buffer implementation of the write barrier. */ \
143
SC(store_buffer_compactions, V8.StoreBufferCompactions) \
144
SC(store_buffer_overflows, V8.StoreBufferOverflows)
113
147
#define STATS_COUNTER_LIST_2(SC) \
126
160
V8.GCCompactorCausedByWeakHandles) \
127
161
SC(gc_last_resort_from_js, V8.GCLastResortFromJS) \
128
162
SC(gc_last_resort_from_handles, V8.GCLastResortFromHandles) \
129
SC(map_to_fast_elements, V8.MapToFastElements) \
130
SC(map_to_fast_double_elements, V8.MapToFastDoubleElements) \
131
SC(map_to_slow_elements, V8.MapToSlowElements) \
132
SC(map_to_external_array_elements, V8.MapToExternalArrayElements) \
133
163
/* How is the generic keyed-load stub used? */ \
134
164
SC(keyed_load_generic_smi, V8.KeyedLoadGenericSmi) \
135
165
SC(keyed_load_generic_symbol, V8.KeyedLoadGenericSymbol) \
199
229
SC(constructed_objects_stub, V8.ConstructedObjectsStub) \
200
230
SC(negative_lookups, V8.NegativeLookups) \
201
231
SC(negative_lookups_miss, V8.NegativeLookupsMiss) \
232
SC(megamorphic_stub_cache_probes, V8.MegamorphicStubCacheProbes) \
233
SC(megamorphic_stub_cache_misses, V8.MegamorphicStubCacheMisses) \
234
SC(megamorphic_stub_cache_updates, V8.MegamorphicStubCacheUpdates) \
202
235
SC(array_function_runtime, V8.ArrayFunctionRuntime) \
203
236
SC(array_function_native, V8.ArrayFunctionNative) \
204
237
SC(for_in, V8.ForIn) \
208
241
SC(compute_entry_frame, V8.ComputeEntryFrame) \
209
242
SC(generic_binary_stub_calls, V8.GenericBinaryStubCalls) \
210
243
SC(generic_binary_stub_calls_regs, V8.GenericBinaryStubCallsRegs) \
244
SC(fast_new_closure_total, V8.FastNewClosureTotal) \
245
SC(fast_new_closure_try_optimized, V8.FastNewClosureTryOptimized) \
246
SC(fast_new_closure_install_optimized, V8.FastNewClosureInstallOptimized) \
211
247
SC(string_add_runtime, V8.StringAddRuntime) \
212
248
SC(string_add_native, V8.StringAddNative) \
213
249
SC(string_add_runtime_ext_to_ascii, V8.StringAddRuntimeExtToAscii) \
238
274
SC(transcendental_cache_miss, V8.TranscendentalCacheMiss) \
239
275
SC(stack_interrupts, V8.StackInterrupts) \
240
276
SC(runtime_profiler_ticks, V8.RuntimeProfilerTicks) \
241
SC(other_ticks, V8.OtherTicks) \
242
SC(js_opt_ticks, V8.JsOptTicks) \
243
SC(js_non_opt_ticks, V8.JsNonoptTicks) \
244
SC(js_other_ticks, V8.JsOtherTicks) \
245
277
SC(smi_checks_removed, V8.SmiChecksRemoved) \
246
278
SC(map_checks_removed, V8.MapChecksRemoved) \
247
279
SC(quote_json_char_count, V8.QuoteJsonCharacterCount) \
248
SC(quote_json_char_recount, V8.QuoteJsonCharacterReCount)
280
SC(quote_json_char_recount, V8.QuoteJsonCharacterReCount) \
281
SC(new_space_bytes_available, V8.MemoryNewSpaceBytesAvailable) \
282
SC(new_space_bytes_committed, V8.MemoryNewSpaceBytesCommitted) \
283
SC(new_space_bytes_used, V8.MemoryNewSpaceBytesUsed) \
284
SC(old_pointer_space_bytes_available, \
285
V8.MemoryOldPointerSpaceBytesAvailable) \
286
SC(old_pointer_space_bytes_committed, \
287
V8.MemoryOldPointerSpaceBytesCommitted) \
288
SC(old_pointer_space_bytes_used, V8.MemoryOldPointerSpaceBytesUsed) \
289
SC(old_data_space_bytes_available, V8.MemoryOldDataSpaceBytesAvailable) \
290
SC(old_data_space_bytes_committed, V8.MemoryOldDataSpaceBytesCommitted) \
291
SC(old_data_space_bytes_used, V8.MemoryOldDataSpaceBytesUsed) \
292
SC(code_space_bytes_available, V8.MemoryCodeSpaceBytesAvailable) \
293
SC(code_space_bytes_committed, V8.MemoryCodeSpaceBytesCommitted) \
294
SC(code_space_bytes_used, V8.MemoryCodeSpaceBytesUsed) \
295
SC(map_space_bytes_available, V8.MemoryMapSpaceBytesAvailable) \
296
SC(map_space_bytes_committed, V8.MemoryMapSpaceBytesCommitted) \
297
SC(map_space_bytes_used, V8.MemoryMapSpaceBytesUsed) \
298
SC(cell_space_bytes_available, V8.MemoryCellSpaceBytesAvailable) \
299
SC(cell_space_bytes_committed, V8.MemoryCellSpaceBytesCommitted) \
300
SC(cell_space_bytes_used, V8.MemoryCellSpaceBytesUsed) \
301
SC(lo_space_bytes_available, V8.MemoryLoSpaceBytesAvailable) \
302
SC(lo_space_bytes_committed, V8.MemoryLoSpaceBytesCommitted) \
303
SC(lo_space_bytes_used, V8.MemoryLoSpaceBytesUsed)
251
306
// This file contains all the v8 counters that are in use.
256
311
HISTOGRAM_TIMER_LIST(HT)
314
#define HP(name, caption) \
315
Histogram* name() { return &name##_; }
316
HISTOGRAM_PERCENTAGE_LIST(HP)
319
#define HM(name, caption) \
320
Histogram* name() { return &name##_; }
321
HISTOGRAM_MEMORY_LIST(HM)
259
324
#define SC(name, caption) \
260
325
StatsCounter* name() { return &name##_; }
261
326
STATS_COUNTER_LIST_1(SC)
262
327
STATS_COUNTER_LIST_2(SC)
331
StatsCounter* count_of_##name() { return &count_of_##name##_; } \
332
StatsCounter* size_of_##name() { return &size_of_##name##_; }
333
INSTANCE_TYPE_LIST(SC)
337
StatsCounter* count_of_CODE_TYPE_##name() \
338
{ return &count_of_CODE_TYPE_##name##_; } \
339
StatsCounter* size_of_CODE_TYPE_##name() \
340
{ return &size_of_CODE_TYPE_##name##_; }
345
StatsCounter* count_of_FIXED_ARRAY_##name() \
346
{ return &count_of_FIXED_ARRAY_##name##_; } \
347
StatsCounter* size_of_FIXED_ARRAY_##name() \
348
{ return &size_of_FIXED_ARRAY_##name##_; }
349
FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(SC)
266
353
#define RATE_ID(name, caption) k_##name,
267
354
HISTOGRAM_TIMER_LIST(RATE_ID)
356
#define PERCENTAGE_ID(name, caption) k_##name,
357
HISTOGRAM_PERCENTAGE_LIST(PERCENTAGE_ID)
359
#define MEMORY_ID(name, caption) k_##name,
360
HISTOGRAM_MEMORY_LIST(MEMORY_ID)
269
362
#define COUNTER_ID(name, caption) k_##name,
270
363
STATS_COUNTER_LIST_1(COUNTER_ID)
271
364
STATS_COUNTER_LIST_2(COUNTER_ID)
272
365
#undef COUNTER_ID
366
#define COUNTER_ID(name) kCountOf##name, kSizeOf##name,
367
INSTANCE_TYPE_LIST(COUNTER_ID)
369
#define COUNTER_ID(name) kCountOfCODE_TYPE_##name, \
370
kSizeOfCODE_TYPE_##name,
371
CODE_KIND_LIST(COUNTER_ID)
373
#define COUNTER_ID(name) kCountOfFIXED_ARRAY__##name, \
374
kSizeOfFIXED_ARRAY__##name,
375
FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(COUNTER_ID)
273
377
#define COUNTER_ID(name) k_##name,
274
378
STATE_TAG_LIST(COUNTER_ID)
275
379
#undef COUNTER_ID
280
384
return &state_counters_[state];
387
void ResetHistograms();
284
390
#define HT(name, caption) \
285
391
HistogramTimer name##_;
286
392
HISTOGRAM_TIMER_LIST(HT)
395
#define HP(name, caption) \
397
HISTOGRAM_PERCENTAGE_LIST(HP)
400
#define HM(name, caption) \
402
HISTOGRAM_MEMORY_LIST(HM)
289
405
#define SC(name, caption) \
290
406
StatsCounter name##_;
291
407
STATS_COUNTER_LIST_1(SC)
292
408
STATS_COUNTER_LIST_2(SC)
412
StatsCounter size_of_##name##_; \
413
StatsCounter count_of_##name##_;
414
INSTANCE_TYPE_LIST(SC)
418
StatsCounter size_of_CODE_TYPE_##name##_; \
419
StatsCounter count_of_CODE_TYPE_##name##_;
424
StatsCounter size_of_FIXED_ARRAY_##name##_; \
425
StatsCounter count_of_FIXED_ARRAY_##name##_;
426
FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(SC)
296
430
#define COUNTER_ID(name) __##name,
297
431
STATE_TAG_LIST(COUNTER_ID)