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

Unified Diff: src/heap/spaces.cc

Issue 2720133005: [heap] Remove Marking::MarkBlack and some minor cleanups. (Closed)
Patch Set: fix failures Created 3 years, 10 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/heap/marking.h ('k') | test/unittests/heap/marking-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/spaces.cc
diff --git a/src/heap/spaces.cc b/src/heap/spaces.cc
index c2a51e44fbf8fa52f0c4c8c54eb67f1812378afc..22833852067709f14d5da187636d124b0e004f38 100644
--- a/src/heap/spaces.cc
+++ b/src/heap/spaces.cc
@@ -3062,14 +3062,15 @@ LargePage* LargeObjectSpace::FindPage(Address a) {
void LargeObjectSpace::ClearMarkingStateOfLiveObjects() {
- LargePage* current = first_page_;
- while (current != NULL) {
- HeapObject* object = current->GetObject();
- DCHECK(ObjectMarking::IsBlack(object));
- ObjectMarking::ClearMarkBit(object);
- Page::FromAddress(object->address())->ResetProgressBar();
- Page::FromAddress(object->address())->ResetLiveBytes();
- current = current->next_page();
+ LargeObjectIterator it(this);
+ for (HeapObject* obj = it.Next(); obj != NULL; obj = it.Next()) {
+ if (ObjectMarking::IsBlackOrGrey(obj)) {
+ ObjectMarking::ClearMarkBit(obj);
+ MemoryChunk* chunk = MemoryChunk::FromAddress(obj->address());
+ chunk->ResetProgressBar();
+ chunk->ResetLiveBytes();
+ }
+ DCHECK(ObjectMarking::IsWhite(obj));
}
}
« no previous file with comments | « src/heap/marking.h ('k') | test/unittests/heap/marking-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698