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

Unified Diff: src/objects-inl.h

Issue 96783002: Allocation site pretenuring. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 11 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 | « src/objects.cc ('k') | test/cctest/test-heap.cc » ('j') | 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 15c9c1f5ff197d5eb7851fb2ecf66baca8963d18..bcfb59846d9be85857c82b105ba681719775a2ff 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -1385,20 +1385,22 @@ inline void AllocationSite::IncrementMementoCreateCount() {
inline bool AllocationSite::DigestPretenuringFeedback() {
bool decision_made = false;
- if (!PretenuringDecisionMade()) {
- int create_count = memento_create_count()->value();
- if (create_count >= kPretenureMinimumCreated) {
- int found_count = memento_found_count()->value();
- 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 result = ratio >= kPretenureRatio ? kTenure : kDontTenure;
- set_pretenure_decision(Smi::FromInt(result));
- decision_made = true;
- // TODO(mvstanton): if the decision represents a change, any dependent
- // code registered for pretenuring changes should be deopted.
+ int create_count = memento_create_count()->value();
+ if (create_count >= kPretenureMinimumCreated) {
+ int found_count = memento_found_count()->value();
+ 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();
+ int result = ratio >= kPretenureRatio ? kTenure : kDontTenure;
+ set_pretenure_decision(Smi::FromInt(result));
+ decision_made = true;
+ if (current_mode != GetPretenureMode()) {
+ dependent_code()->DeoptimizeDependentCodeGroup(
+ GetIsolate(),
+ DependentCode::kAllocationSiteTenuringChangedGroup);
}
}
« no previous file with comments | « src/objects.cc ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698