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

Unified Diff: src/mark-compact.cc

Issue 8060004: Pass sweeping mode as template parameter. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 3 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/mark-compact.cc
diff --git a/src/mark-compact.cc b/src/mark-compact.cc
index 117da368e302da104763d5b2891c07432615cee3..65d2558274fe69034280ecb7d7530fb77db855fe 100644
--- a/src/mark-compact.cc
+++ b/src/mark-compact.cc
@@ -2793,10 +2793,9 @@ enum SkipListRebuildingMode {
// over it. Map space is swept precisely, because it is not compacted.
// Slots in live objects pointing into evacuation candidates are updated
// if requested.
-template<SkipListRebuildingMode skip_list_mode>
+template<SweepingMode sweeping_mode, SkipListRebuildingMode skip_list_mode>
static void SweepPrecisely(PagedSpace* space,
Page* p,
- SweepingMode mode,
ObjectVisitor* v) {
ASSERT(!p->IsEvacuationCandidate() && !p->WasSwept());
ASSERT_EQ(skip_list_mode == REBUILD_SKIP_LIST,
@@ -2841,7 +2840,7 @@ static void SweepPrecisely(PagedSpace* space,
ASSERT(Marking::IsBlack(Marking::MarkBitFrom(live_object)));
Map* map = live_object->map();
int size = live_object->SizeFromMap(map);
- if (mode == SWEEP_AND_VISIT_LIVE_OBJECTS) {
+ if (sweeping_mode == SWEEP_AND_VISIT_LIVE_OBJECTS) {
live_object->IterateBody(map->instance_type(), size, v);
}
if ((skip_list_mode == REBUILD_SKIP_LIST) && skip_list != NULL) {
@@ -3069,16 +3068,12 @@ void MarkCompactCollector::EvacuateNewSpaceAndCandidates() {
SweepConservatively(space, p);
break;
case OLD_POINTER_SPACE:
- SweepPrecisely<IGNORE_SKIP_LIST>(space,
- p,
- SWEEP_AND_VISIT_LIVE_OBJECTS,
- &updating_visitor);
+ SweepPrecisely<SWEEP_AND_VISIT_LIVE_OBJECTS, IGNORE_SKIP_LIST>(
+ space, p, &updating_visitor);
break;
case CODE_SPACE:
- SweepPrecisely<REBUILD_SKIP_LIST>(space,
- p,
- SWEEP_AND_VISIT_LIVE_OBJECTS,
- &updating_visitor);
+ SweepPrecisely<SWEEP_AND_VISIT_LIVE_OBJECTS, REBUILD_SKIP_LIST>(
+ space, p, &updating_visitor);
break;
default:
UNREACHABLE();
@@ -3618,9 +3613,9 @@ void MarkCompactCollector::SweepSpace(PagedSpace* space,
}
case PRECISE: {
if (space->identity() == CODE_SPACE) {
- SweepPrecisely<REBUILD_SKIP_LIST>(space, p, SWEEP_ONLY, NULL);
+ SweepPrecisely<SWEEP_ONLY, REBUILD_SKIP_LIST>(space, p, NULL);
} else {
- SweepPrecisely<IGNORE_SKIP_LIST>(space, p, SWEEP_ONLY, NULL);
+ SweepPrecisely<SWEEP_ONLY, IGNORE_SKIP_LIST>(space, p, NULL);
}
break;
}
« 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