OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |