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

Unified Diff: src/mark-compact.cc

Issue 345523002: An object should only be promoted to the old generation if it survived a scavenge operation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 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/mark-compact.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mark-compact.cc
diff --git a/src/mark-compact.cc b/src/mark-compact.cc
index 61b1b54c7bd13c95acfe0b71f262e9dd6860c15f..104af70261362bddef2f5545880a14db3bf83ff3 100644
--- a/src/mark-compact.cc
+++ b/src/mark-compact.cc
@@ -1975,7 +1975,7 @@ static void DiscoverGreyObjectsOnPage(MarkingDeque* marking_deque,
}
-int MarkCompactCollector::DiscoverAndPromoteBlackObjectsOnPage(
+int MarkCompactCollector::DiscoverAndEvacuateBlackObjectsOnPage(
NewSpace* new_space,
NewSpacePage* p) {
ASSERT(strcmp(Marking::kWhiteBitPattern, "00") == 0);
@@ -2008,8 +2008,10 @@ int MarkCompactCollector::DiscoverAndPromoteBlackObjectsOnPage(
offset++;
current_cell >>= 1;
- // Aggressively promote young survivors to the old space.
- if (TryPromoteObject(object, size)) {
+
+ // TODO(hpayer): Refactor EvacuateObject and call this function instead.
+ if (heap()->ShouldBePromoted(object->address(), size) &&
+ TryPromoteObject(object, size)) {
continue;
}
@@ -3052,7 +3054,7 @@ void MarkCompactCollector::EvacuateNewSpace() {
NewSpacePageIterator it(from_bottom, from_top);
while (it.has_next()) {
NewSpacePage* p = it.next();
- survivors_size += DiscoverAndPromoteBlackObjectsOnPage(new_space, p);
+ survivors_size += DiscoverAndEvacuateBlackObjectsOnPage(new_space, p);
}
heap_->IncrementYoungSurvivorsCounter(survivors_size);
« no previous file with comments | « src/mark-compact.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698