Cleanup allocation site pretenuring tracing, added new flag --trace-pretenuring-statistics.

BUG=
R=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/153273003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19141 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
hpayer@chromium.org 2014-02-06 10:30:13 +00:00
parent 76646e88ed
commit 9b61008f27
3 changed files with 15 additions and 11 deletions

View File

@ -224,6 +224,8 @@ DEFINE_bool(allocation_site_pretenuring, true,
"pretenure with allocation sites")
DEFINE_bool(trace_pretenuring, false,
"trace pretenuring decisions of HAllocate instructions")
DEFINE_bool(trace_pretenuring_statistics, false,
"trace allocation site pretenuring statistics")
DEFINE_bool(track_fields, true, "track fields with only smi values")
DEFINE_bool(track_double_fields, true, "track fields with double values")
DEFINE_bool(track_heap_object_fields, true, "track fields with heap values")

View File

@ -548,10 +548,7 @@ void Heap::ProcessPretenuringFeedback() {
allocation_sites_scratchpad_length = 0;
// TODO(mvstanton): Pretenure decisions are only made once for an allocation
// site. Find a sane way to decide about revisiting the decision later.
if (FLAG_trace_track_allocation_sites &&
if (FLAG_trace_pretenuring_statistics &&
(allocation_mementos_found > 0 ||
tenure_decisions > 0 ||
dont_tenure_decisions > 0)) {

View File

@ -1550,14 +1550,11 @@ inline void AllocationSite::IncrementMementoCreateCount() {
inline bool AllocationSite::DigestPretenuringFeedback() {
bool decision_changed = false;
int create_count = memento_create_count();
int found_count = memento_found_count();
double ratio = static_cast<double>(found_count) / create_count;
PretenureFlag current_mode = GetPretenureMode();
if (create_count >= kPretenureMinimumCreated) {
int found_count = memento_found_count();
double ratio = static_cast<double>(found_count) / create_count;
if (FLAG_trace_track_allocation_sites) {
PrintF("AllocationSite: %p (created, found, ratio) (%d, %d, %f)\n",
static_cast<void*>(this), create_count, found_count, ratio);
}
int current_mode = GetPretenureMode();
PretenureDecision result = ratio >= kPretenureRatio
? kTenure
: kDontTenure;
@ -1570,6 +1567,14 @@ inline bool AllocationSite::DigestPretenuringFeedback() {
}
}
if (FLAG_trace_pretenuring_statistics) {
PrintF(
"AllocationSite(%p): (created, found, ratio) (%d, %d, %f) %s => %s\n",
static_cast<void*>(this), create_count, found_count, ratio,
current_mode == TENURED ? "tenured" : "not tenured",
GetPretenureMode() == TENURED ? "tenured" : "not tenured");
}
// Clear feedback calculation fields until the next gc.
set_memento_found_count(0);
set_memento_create_count(0);