Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(543)

Unified Diff: src/objects-inl.h

Issue 153863005: Just calculate pretenuring ratio when needed. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index a0256fb416429940c41002429ae7731c6024e984..320bdf3e5f99477a196ff6bc71d5cf98ca114631 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -1551,10 +1551,11 @@ 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;
+ double ratio = 0.0;
PretenureFlag current_mode = GetPretenureMode();
if (create_count >= kPretenureMinimumCreated) {
+ ratio = static_cast<double>(found_count) / create_count;
mvstanton 2014/02/06 11:23:33 Per our chat, something like: bool minimum_met =
Hannes Payer (out of office) 2014/02/06 11:26:53 Done.
PretenureDecision result = ratio >= kPretenureRatio
? kTenure
: kDontTenure;
@@ -1568,6 +1569,7 @@ inline bool AllocationSite::DigestPretenuringFeedback() {
}
if (FLAG_trace_pretenuring_statistics) {
+ ratio = static_cast<double>(found_count) / create_count;
PrintF(
"AllocationSite(%p): (created, found, ratio) (%d, %d, %f) %s => %s\n",
static_cast<void*>(this), create_count, found_count, ratio,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698