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

Unified Diff: src/incremental-marking.cc

Issue 7712026: Clear mark bits while sweeping and not explicitly. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Correctly handle incremental marking as well. Created 9 years, 4 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/incremental-marking.h ('k') | src/mark-compact.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/incremental-marking.cc
diff --git a/src/incremental-marking.cc b/src/incremental-marking.cc
index 39e240dbe891b94c8c1e1fe85d8a0d7665190702..48784315ba58252ed0a3ca4e9cd0d95e59a5bdf9 100644
--- a/src/incremental-marking.cc
+++ b/src/incremental-marking.cc
@@ -230,34 +230,31 @@ void IncrementalMarking::DeactivateIncrementalWriteBarrier() {
}
-void IncrementalMarking::ClearMarkbits(PagedSpace* space) {
+void IncrementalMarking::ActivateIncrementalWriteBarrier(PagedSpace* space) {
PageIterator it(space);
while (it.has_next()) {
Page* p = it.next();
- Bitmap::Clear(p);
SetOldSpacePageFlags(p, true);
}
}
-void IncrementalMarking::ClearMarkbits(NewSpace* space) {
+void IncrementalMarking::ActivateIncrementalWriteBarrier(NewSpace* space) {
NewSpacePageIterator it(space->ToSpaceStart(), space->ToSpaceEnd());
while (it.has_next()) {
NewSpacePage* p = it.next();
- Bitmap::Clear(p);
SetNewSpacePageFlags(p, true);
}
}
-void IncrementalMarking::ClearMarkbits() {
- // TODO(gc): Clear the mark bits in the sweeper.
- ClearMarkbits(heap_->old_pointer_space());
- ClearMarkbits(heap_->old_data_space());
- ClearMarkbits(heap_->cell_space());
- ClearMarkbits(heap_->map_space());
- ClearMarkbits(heap_->code_space());
- ClearMarkbits(heap_->new_space());
+void IncrementalMarking::ActivateIncrementalWriteBarrier() {
+ ActivateIncrementalWriteBarrier(heap_->old_pointer_space());
+ ActivateIncrementalWriteBarrier(heap_->old_data_space());
+ ActivateIncrementalWriteBarrier(heap_->cell_space());
+ ActivateIncrementalWriteBarrier(heap_->map_space());
+ ActivateIncrementalWriteBarrier(heap_->code_space());
+ ActivateIncrementalWriteBarrier(heap_->new_space());
LargePage* lop = heap_->lo_space()->first_page();
while (lop->is_valid()) {
@@ -267,38 +264,6 @@ void IncrementalMarking::ClearMarkbits() {
}
-#ifdef DEBUG
-void IncrementalMarking::VerifyMarkbitsAreClean(PagedSpace* space) {
- PageIterator it(space);
-
- while (it.has_next()) {
- Page* p = it.next();
- ASSERT(p->markbits()->IsClean());
- }
-}
-
-
-void IncrementalMarking::VerifyMarkbitsAreClean(NewSpace* space) {
- NewSpacePageIterator it(space->ToSpaceStart(), space->ToSpaceEnd());
-
- while (it.has_next()) {
- NewSpacePage* p = it.next();
- ASSERT(p->markbits()->IsClean());
- }
-}
-
-
-void IncrementalMarking::VerifyMarkbitsAreClean() {
- VerifyMarkbitsAreClean(heap_->old_pointer_space());
- VerifyMarkbitsAreClean(heap_->old_data_space());
- VerifyMarkbitsAreClean(heap_->code_space());
- VerifyMarkbitsAreClean(heap_->cell_space());
- VerifyMarkbitsAreClean(heap_->map_space());
- VerifyMarkbitsAreClean(heap_->new_space());
-}
-#endif
-
-
bool IncrementalMarking::WorthActivating() {
#ifndef DEBUG
static const intptr_t kActivationThreshold = 8 * MB;
@@ -408,11 +373,11 @@ void IncrementalMarking::StartMarking() {
if (FLAG_force_marking_deque_overflows) size = 64 * kPointerSize;
marking_deque_.Initialize(addr, addr + size);
- // Clear markbits.
- ClearMarkbits();
+ ActivateIncrementalWriteBarrier();
#ifdef DEBUG
- VerifyMarkbitsAreClean();
+ // Marking bits are cleared by the sweeper.
+ heap_->mark_compact_collector()->VerifyMarkbitsAreClean();
#endif
// Mark strong roots grey.
« no previous file with comments | « src/incremental-marking.h ('k') | src/mark-compact.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698