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); |