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

Side by Side Diff: src/heap/spaces.cc

Issue 2868053002: [heap] Verify remembered set for objects in the old generation. (Closed)
Patch Set: remove old to old handling 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 | « src/heap/heap.cc ('k') | 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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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/spaces.h" 5 #include "src/heap/spaces.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/base/platform/platform.h" 10 #include "src/base/platform/platform.h"
(...skipping 1547 matching lines...) Expand 10 before | Expand all | Expand 10 after
1558 Map* map = object->map(); 1558 Map* map = object->map();
1559 CHECK(map->IsMap()); 1559 CHECK(map->IsMap());
1560 CHECK(heap()->map_space()->Contains(map)); 1560 CHECK(heap()->map_space()->Contains(map));
1561 1561
1562 // Perform space-specific object verification. 1562 // Perform space-specific object verification.
1563 VerifyObject(object); 1563 VerifyObject(object);
1564 1564
1565 // The object itself should look OK. 1565 // The object itself should look OK.
1566 object->ObjectVerify(); 1566 object->ObjectVerify();
1567 1567
1568 heap()->VerifyRememberedSetFor(object);
1569
1568 // All the interior pointers should be contained in the heap. 1570 // All the interior pointers should be contained in the heap.
1569 int size = object->Size(); 1571 int size = object->Size();
1570 object->IterateBody(map->instance_type(), size, visitor); 1572 object->IterateBody(map->instance_type(), size, visitor);
1571 if (ObjectMarking::IsBlack(object, MarkingState::Internal(object))) { 1573 if (ObjectMarking::IsBlack(object, MarkingState::Internal(object))) {
1572 black_size += size; 1574 black_size += size;
1573 } 1575 }
1574 1576
1575 CHECK(object->address() + size <= top); 1577 CHECK(object->address() + size <= top);
1576 end_of_previous_object = object->address() + size; 1578 end_of_previous_object = object->address() + size;
1577 } 1579 }
(...skipping 1732 matching lines...) Expand 10 before | Expand all | Expand 10 after
3310 // byte arrays, and free space (right after allocation) in the 3312 // byte arrays, and free space (right after allocation) in the
3311 // large object space. 3313 // large object space.
3312 CHECK(object->IsAbstractCode() || object->IsSeqString() || 3314 CHECK(object->IsAbstractCode() || object->IsSeqString() ||
3313 object->IsExternalString() || object->IsThinString() || 3315 object->IsExternalString() || object->IsThinString() ||
3314 object->IsFixedArray() || object->IsFixedDoubleArray() || 3316 object->IsFixedArray() || object->IsFixedDoubleArray() ||
3315 object->IsByteArray() || object->IsFreeSpace()); 3317 object->IsByteArray() || object->IsFreeSpace());
3316 3318
3317 // The object itself should look OK. 3319 // The object itself should look OK.
3318 object->ObjectVerify(); 3320 object->ObjectVerify();
3319 3321
3322 heap()->VerifyRememberedSetFor(object);
3323
3320 // Byte arrays and strings don't have interior pointers. 3324 // Byte arrays and strings don't have interior pointers.
3321 if (object->IsAbstractCode()) { 3325 if (object->IsAbstractCode()) {
3322 VerifyPointersVisitor code_visitor; 3326 VerifyPointersVisitor code_visitor;
3323 object->IterateBody(map->instance_type(), object->Size(), &code_visitor); 3327 object->IterateBody(map->instance_type(), object->Size(), &code_visitor);
3324 } else if (object->IsFixedArray()) { 3328 } else if (object->IsFixedArray()) {
3325 FixedArray* array = FixedArray::cast(object); 3329 FixedArray* array = FixedArray::cast(object);
3326 for (int j = 0; j < array->length(); j++) { 3330 for (int j = 0; j < array->length(); j++) {
3327 Object* element = array->get(j); 3331 Object* element = array->get(j);
3328 if (element->IsHeapObject()) { 3332 if (element->IsHeapObject()) {
3329 HeapObject* element_object = HeapObject::cast(element); 3333 HeapObject* element_object = HeapObject::cast(element);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
3383 PrintF("\n"); 3387 PrintF("\n");
3384 } 3388 }
3385 printf(" --------------------------------------\n"); 3389 printf(" --------------------------------------\n");
3386 printf(" Marked: %x, LiveCount: %" V8PRIdPTR "\n", mark_size, 3390 printf(" Marked: %x, LiveCount: %" V8PRIdPTR "\n", mark_size,
3387 MarkingState::Internal(this).live_bytes()); 3391 MarkingState::Internal(this).live_bytes());
3388 } 3392 }
3389 3393
3390 #endif // DEBUG 3394 #endif // DEBUG
3391 } // namespace internal 3395 } // namespace internal
3392 } // namespace v8 3396 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/heap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698