From: mstarzinger@chromium.org Date: Tue, 27 Sep 2011 07:52:34 +0000 (+0000) Subject: Pass sweeping mode as template parameter. X-Git-Tag: upstream/4.7.83~18355 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e7da8b3eeb0720c15b61cba0c350b0e3721a0713;p=platform%2Fupstream%2Fv8.git Pass sweeping mode as template parameter. R=yangguo@chromium.org Review URL: http://codereview.chromium.org/8060004 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9440 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/mark-compact.cc b/src/mark-compact.cc index 117da36..65d2558 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 +template 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(space, - p, - SWEEP_AND_VISIT_LIVE_OBJECTS, - &updating_visitor); + SweepPrecisely( + space, p, &updating_visitor); break; case CODE_SPACE: - SweepPrecisely(space, - p, - SWEEP_AND_VISIT_LIVE_OBJECTS, - &updating_visitor); + SweepPrecisely( + space, p, &updating_visitor); break; default: UNREACHABLE(); @@ -3618,9 +3613,9 @@ void MarkCompactCollector::SweepSpace(PagedSpace* space, } case PRECISE: { if (space->identity() == CODE_SPACE) { - SweepPrecisely(space, p, SWEEP_ONLY, NULL); + SweepPrecisely(space, p, NULL); } else { - SweepPrecisely(space, p, SWEEP_ONLY, NULL); + SweepPrecisely(space, p, NULL); } break; }