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

Side by Side Diff: src/heap/mark-compact.cc

Issue 2634033003: [heap] Fix live object iterator to skip grey filler objects. (Closed)
Patch Set: include Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/heap/mark-compact-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/heap/mark-compact.h" 5 #include "src/heap/mark-compact.h"
6 6
7 #include "src/base/atomicops.h" 7 #include "src/base/atomicops.h"
8 #include "src/base/bits.h" 8 #include "src/base/bits.h"
9 #include "src/base/sys-info.h" 9 #include "src/base/sys-info.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 Heap* heap_; 97 Heap* heap_;
98 }; 98 };
99 99
100 100
101 static void VerifyMarking(Heap* heap, Address bottom, Address top) { 101 static void VerifyMarking(Heap* heap, Address bottom, Address top) {
102 VerifyMarkingVisitor visitor(heap); 102 VerifyMarkingVisitor visitor(heap);
103 HeapObject* object; 103 HeapObject* object;
104 Address next_object_must_be_here_or_later = bottom; 104 Address next_object_must_be_here_or_later = bottom;
105 for (Address current = bottom; current < top;) { 105 for (Address current = bottom; current < top;) {
106 object = HeapObject::FromAddress(current); 106 object = HeapObject::FromAddress(current);
107 if (MarkCompactCollector::IsMarked(object)) { 107 // One word fillers at the end of a black area can be grey.
108 if (MarkCompactCollector::IsMarked(object) &&
109 object->map() != heap->one_pointer_filler_map()) {
108 CHECK(Marking::IsBlack(ObjectMarking::MarkBitFrom(object))); 110 CHECK(Marking::IsBlack(ObjectMarking::MarkBitFrom(object)));
109 CHECK(current >= next_object_must_be_here_or_later); 111 CHECK(current >= next_object_must_be_here_or_later);
110 object->Iterate(&visitor); 112 object->Iterate(&visitor);
111 next_object_must_be_here_or_later = current + object->Size(); 113 next_object_must_be_here_or_later = current + object->Size();
112 // The object is either part of a black area of black allocation or a 114 // The object is either part of a black area of black allocation or a
113 // regular black object 115 // regular black object
114 Page* page = Page::FromAddress(current); 116 Page* page = Page::FromAddress(current);
115 CHECK( 117 CHECK(
116 page->markbits()->AllBitsSetInRange( 118 page->markbits()->AllBitsSetInRange(
117 page->AddressToMarkbitIndex(current), 119 page->AddressToMarkbitIndex(current),
(...skipping 3964 matching lines...) Expand 10 before | Expand all | Expand 10 after
4082 // The target is always in old space, we don't have to record the slot in 4084 // The target is always in old space, we don't have to record the slot in
4083 // the old-to-new remembered set. 4085 // the old-to-new remembered set.
4084 DCHECK(!heap()->InNewSpace(target)); 4086 DCHECK(!heap()->InNewSpace(target));
4085 RecordRelocSlot(host, &rinfo, target); 4087 RecordRelocSlot(host, &rinfo, target);
4086 } 4088 }
4087 } 4089 }
4088 } 4090 }
4089 4091
4090 } // namespace internal 4092 } // namespace internal
4091 } // namespace v8 4093 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/heap/mark-compact-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698