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

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..dbac0f4685e2d0e594014e97410698499d5b84ff 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -1551,10 +1551,13 @@ 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;
+ bool minimum_mementos_created = create_count >= kPretenureMinimumCreated;
+ double ratio =
+ minimum_mementos_created || FLAG_trace_pretenuring_statistics ?
+ static_cast<double>(found_count) / create_count : 0.0;
PretenureFlag current_mode = GetPretenureMode();
- if (create_count >= kPretenureMinimumCreated) {
+ if (minimum_mementos_created) {
PretenureDecision result = ratio >= kPretenureRatio
? kTenure
: kDontTenure;
« 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