Add histograms to track fraction of heap spaces and percentage of generated crankshaft code.
BUG=None R=mstarzinger@chromium.org Review URL: https://codereview.chromium.org/27023003 Patch from Ross McIlroy <rmcilroy@chromium.org>. git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17198 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
83c63cf555
commit
2d0d210eca
@ -116,6 +116,8 @@ Handle<Code> CodeGenerator::MakeCodeEpilogue(MacroAssembler* masm,
|
||||
false, is_crankshafted);
|
||||
isolate->counters()->total_compiled_code_size()->Increment(
|
||||
code->instruction_size());
|
||||
isolate->heap()->IncrementCodeGeneratedBytes(is_crankshafted,
|
||||
code->instruction_size());
|
||||
code->set_prologue_offset(info->prologue_offset());
|
||||
return code;
|
||||
}
|
||||
|
28
src/heap.cc
28
src/heap.cc
@ -141,6 +141,8 @@ Heap::Heap()
|
||||
mark_sweeps_since_idle_round_started_(0),
|
||||
gc_count_at_last_idle_gc_(0),
|
||||
scavenges_since_last_idle_round_(kIdleScavengeThreshold),
|
||||
full_codegen_bytes_generated_(0),
|
||||
crankshaft_codegen_bytes_generated_(0),
|
||||
gcs_since_last_deopt_(0),
|
||||
#ifdef VERIFY_HEAP
|
||||
no_weak_object_verification_scope_depth_(0),
|
||||
@ -508,10 +510,31 @@ void Heap::GarbageCollectionEpilogue() {
|
||||
isolate_->counters()->number_of_symbols()->Set(
|
||||
string_table()->NumberOfElements());
|
||||
|
||||
if (full_codegen_bytes_generated_ + crankshaft_codegen_bytes_generated_ > 0) {
|
||||
isolate_->counters()->codegen_fraction_crankshaft()->AddSample(
|
||||
static_cast<int>((crankshaft_codegen_bytes_generated_ * 100.0) /
|
||||
(crankshaft_codegen_bytes_generated_
|
||||
+ full_codegen_bytes_generated_)));
|
||||
}
|
||||
|
||||
if (CommittedMemory() > 0) {
|
||||
isolate_->counters()->external_fragmentation_total()->AddSample(
|
||||
static_cast<int>(100 - (SizeOfObjects() * 100.0) / CommittedMemory()));
|
||||
|
||||
isolate_->counters()->heap_fraction_new_space()->
|
||||
AddSample(static_cast<int>(
|
||||
(new_space()->CommittedMemory() * 100.0) / CommittedMemory()));
|
||||
isolate_->counters()->heap_fraction_old_pointer_space()->AddSample(
|
||||
static_cast<int>(
|
||||
(old_pointer_space()->CommittedMemory() * 100.0) /
|
||||
CommittedMemory()));
|
||||
isolate_->counters()->heap_fraction_old_data_space()->AddSample(
|
||||
static_cast<int>(
|
||||
(old_data_space()->CommittedMemory() * 100.0) /
|
||||
CommittedMemory()));
|
||||
isolate_->counters()->heap_fraction_code_space()->
|
||||
AddSample(static_cast<int>(
|
||||
(code_space()->CommittedMemory() * 100.0) / CommittedMemory()));
|
||||
isolate_->counters()->heap_fraction_map_space()->AddSample(
|
||||
static_cast<int>(
|
||||
(map_space()->CommittedMemory() * 100.0) / CommittedMemory()));
|
||||
@ -522,6 +545,9 @@ void Heap::GarbageCollectionEpilogue() {
|
||||
AddSample(static_cast<int>(
|
||||
(property_cell_space()->CommittedMemory() * 100.0) /
|
||||
CommittedMemory()));
|
||||
isolate_->counters()->heap_fraction_lo_space()->
|
||||
AddSample(static_cast<int>(
|
||||
(lo_space()->CommittedMemory() * 100.0) / CommittedMemory()));
|
||||
|
||||
isolate_->counters()->heap_sample_total_committed()->AddSample(
|
||||
static_cast<int>(CommittedMemory() / KB));
|
||||
@ -535,6 +561,8 @@ void Heap::GarbageCollectionEpilogue() {
|
||||
heap_sample_property_cell_space_committed()->
|
||||
AddSample(static_cast<int>(
|
||||
property_cell_space()->CommittedMemory() / KB));
|
||||
isolate_->counters()->heap_sample_code_space_committed()->AddSample(
|
||||
static_cast<int>(code_space()->CommittedMemory() / KB));
|
||||
}
|
||||
|
||||
#define UPDATE_COUNTERS_FOR_SPACE(space) \
|
||||
|
12
src/heap.h
12
src/heap.h
@ -1676,6 +1676,14 @@ class Heap {
|
||||
total_regexp_code_generated_ += size;
|
||||
}
|
||||
|
||||
void IncrementCodeGeneratedBytes(bool is_crankshafted, int size) {
|
||||
if (is_crankshafted) {
|
||||
crankshaft_codegen_bytes_generated_ += size;
|
||||
} else {
|
||||
full_codegen_bytes_generated_ += size;
|
||||
}
|
||||
}
|
||||
|
||||
// Returns maximum GC pause.
|
||||
double get_max_gc_pause() { return max_gc_pause_; }
|
||||
|
||||
@ -2371,6 +2379,10 @@ class Heap {
|
||||
unsigned int gc_count_at_last_idle_gc_;
|
||||
int scavenges_since_last_idle_round_;
|
||||
|
||||
// These two counters are monotomically increasing and never reset.
|
||||
size_t full_codegen_bytes_generated_;
|
||||
size_t crankshaft_codegen_bytes_generated_;
|
||||
|
||||
// If the --deopt_every_n_garbage_collections flag is set to a positive value,
|
||||
// this variable holds the number of garbage collections since the last
|
||||
// deoptimization triggered by garbage collection.
|
||||
|
@ -51,6 +51,7 @@ namespace internal {
|
||||
HT(compile_lazy, V8.CompileLazy)
|
||||
|
||||
#define HISTOGRAM_PERCENTAGE_LIST(HP) \
|
||||
/* Heap fragmentation. */ \
|
||||
HP(external_fragmentation_total, \
|
||||
V8.MemoryExternalFragmentationTotal) \
|
||||
HP(external_fragmentation_old_pointer_space, \
|
||||
@ -67,12 +68,26 @@ namespace internal {
|
||||
V8.MemoryExternalFragmentationPropertyCellSpace) \
|
||||
HP(external_fragmentation_lo_space, \
|
||||
V8.MemoryExternalFragmentationLoSpace) \
|
||||
/* Percentages of heap committed to each space. */ \
|
||||
HP(heap_fraction_new_space, \
|
||||
V8.MemoryHeapFractionNewSpace) \
|
||||
HP(heap_fraction_old_pointer_space, \
|
||||
V8.MemoryHeapFractionOldPointerSpace) \
|
||||
HP(heap_fraction_old_data_space, \
|
||||
V8.MemoryHeapFractionOldDataSpace) \
|
||||
HP(heap_fraction_code_space, \
|
||||
V8.MemoryHeapFractionCodeSpace) \
|
||||
HP(heap_fraction_map_space, \
|
||||
V8.MemoryHeapFractionMapSpace) \
|
||||
HP(heap_fraction_cell_space, \
|
||||
V8.MemoryHeapFractionCellSpace) \
|
||||
HP(heap_fraction_property_cell_space, \
|
||||
V8.MemoryHeapFractionPropertyCellSpace) \
|
||||
HP(heap_fraction_lo_space, \
|
||||
V8.MemoryHeapFractionLoSpace) \
|
||||
/* Percentage of crankshafted codegen. */ \
|
||||
HP(codegen_fraction_crankshaft, \
|
||||
V8.CodegenFractionCrankshaft) \
|
||||
|
||||
|
||||
#define HISTOGRAM_MEMORY_LIST(HM) \
|
||||
@ -84,6 +99,8 @@ namespace internal {
|
||||
V8.MemoryHeapSampleCellSpaceCommitted) \
|
||||
HM(heap_sample_property_cell_space_committed, \
|
||||
V8.MemoryHeapSamplePropertyCellSpaceCommitted) \
|
||||
HM(heap_sample_code_space_committed, \
|
||||
V8.MemoryHeapSampleCodeSpaceCommitted) \
|
||||
|
||||
|
||||
// WARNING: STATS_COUNTER_LIST_* is a very large macro that is causing MSVC
|
||||
|
Loading…
Reference in New Issue
Block a user