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

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

Issue 2846683003: [heap] Verify that new space objects are in to space after evacuation (Closed)
Patch Set: Add missing heap getter Created 3 years, 7 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 | no next file » | 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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 VerifyPointers(start, end); 223 VerifyPointers(start, end);
224 } 224 }
225 225
226 void VisitRootPointers(Root root, Object** start, Object** end) override { 226 void VisitRootPointers(Root root, Object** start, Object** end) override {
227 VerifyPointers(start, end); 227 VerifyPointers(start, end);
228 } 228 }
229 229
230 protected: 230 protected:
231 explicit EvacuationVerifier(Heap* heap) : heap_(heap) {} 231 explicit EvacuationVerifier(Heap* heap) : heap_(heap) {}
232 232
233 inline Heap* heap() { return heap_; }
234
233 virtual void VerifyPointers(Object** start, Object** end) = 0; 235 virtual void VerifyPointers(Object** start, Object** end) = 0;
234 236
235 void VerifyRoots(VisitMode mode); 237 void VerifyRoots(VisitMode mode);
236 void VerifyEvacuationOnPage(Address start, Address end); 238 void VerifyEvacuationOnPage(Address start, Address end);
237 void VerifyEvacuation(NewSpace* new_space); 239 void VerifyEvacuation(NewSpace* new_space);
238 void VerifyEvacuation(PagedSpace* paged_space); 240 void VerifyEvacuation(PagedSpace* paged_space);
239 241
240 Heap* heap_; 242 Heap* heap_;
241 }; 243 };
242 244
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 VerifyEvacuation(heap_->old_space()); 288 VerifyEvacuation(heap_->old_space());
287 VerifyEvacuation(heap_->code_space()); 289 VerifyEvacuation(heap_->code_space());
288 VerifyEvacuation(heap_->map_space()); 290 VerifyEvacuation(heap_->map_space());
289 } 291 }
290 292
291 protected: 293 protected:
292 void VerifyPointers(Object** start, Object** end) override { 294 void VerifyPointers(Object** start, Object** end) override {
293 for (Object** current = start; current < end; current++) { 295 for (Object** current = start; current < end; current++) {
294 if ((*current)->IsHeapObject()) { 296 if ((*current)->IsHeapObject()) {
295 HeapObject* object = HeapObject::cast(*current); 297 HeapObject* object = HeapObject::cast(*current);
298 if (heap()->InNewSpace(object)) {
299 CHECK(heap()->InToSpace(object));
300 }
296 CHECK(!MarkCompactCollector::IsOnEvacuationCandidate(object)); 301 CHECK(!MarkCompactCollector::IsOnEvacuationCandidate(object));
297 } 302 }
298 } 303 }
299 } 304 }
300 }; 305 };
301 306
302 } // namespace 307 } // namespace
303 #endif // VERIFY_HEAP 308 #endif // VERIFY_HEAP
304 309
305 // ============================================================================= 310 // =============================================================================
(...skipping 3903 matching lines...) Expand 10 before | Expand all | Expand 10 after
4209 // The target is always in old space, we don't have to record the slot in 4214 // The target is always in old space, we don't have to record the slot in
4210 // the old-to-new remembered set. 4215 // the old-to-new remembered set.
4211 DCHECK(!heap()->InNewSpace(target)); 4216 DCHECK(!heap()->InNewSpace(target));
4212 RecordRelocSlot(host, &rinfo, target); 4217 RecordRelocSlot(host, &rinfo, target);
4213 } 4218 }
4214 } 4219 }
4215 } 4220 }
4216 4221
4217 } // namespace internal 4222 } // namespace internal
4218 } // namespace v8 4223 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698