OLD | NEW |
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 1551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1562 Map* map = object->map(); | 1562 Map* map = object->map(); |
1563 CHECK(map->IsMap()); | 1563 CHECK(map->IsMap()); |
1564 CHECK(heap()->map_space()->Contains(map)); | 1564 CHECK(heap()->map_space()->Contains(map)); |
1565 | 1565 |
1566 // Perform space-specific object verification. | 1566 // Perform space-specific object verification. |
1567 VerifyObject(object); | 1567 VerifyObject(object); |
1568 | 1568 |
1569 // The object itself should look OK. | 1569 // The object itself should look OK. |
1570 object->ObjectVerify(); | 1570 object->ObjectVerify(); |
1571 | 1571 |
| 1572 heap()->VerifyRememberedSetFor(object); |
| 1573 |
1572 // All the interior pointers should be contained in the heap. | 1574 // All the interior pointers should be contained in the heap. |
1573 int size = object->Size(); | 1575 int size = object->Size(); |
1574 object->IterateBody(map->instance_type(), size, visitor); | 1576 object->IterateBody(map->instance_type(), size, visitor); |
1575 if (ObjectMarking::IsBlack(object, MarkingState::Internal(object))) { | 1577 if (ObjectMarking::IsBlack(object, MarkingState::Internal(object))) { |
1576 black_size += size; | 1578 black_size += size; |
1577 } | 1579 } |
1578 | 1580 |
1579 CHECK(object->address() + size <= top); | 1581 CHECK(object->address() + size <= top); |
1580 end_of_previous_object = object->address() + size; | 1582 end_of_previous_object = object->address() + size; |
1581 } | 1583 } |
(...skipping 1732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3314 // byte arrays, and free space (right after allocation) in the | 3316 // byte arrays, and free space (right after allocation) in the |
3315 // large object space. | 3317 // large object space. |
3316 CHECK(object->IsAbstractCode() || object->IsSeqString() || | 3318 CHECK(object->IsAbstractCode() || object->IsSeqString() || |
3317 object->IsExternalString() || object->IsThinString() || | 3319 object->IsExternalString() || object->IsThinString() || |
3318 object->IsFixedArray() || object->IsFixedDoubleArray() || | 3320 object->IsFixedArray() || object->IsFixedDoubleArray() || |
3319 object->IsByteArray() || object->IsFreeSpace()); | 3321 object->IsByteArray() || object->IsFreeSpace()); |
3320 | 3322 |
3321 // The object itself should look OK. | 3323 // The object itself should look OK. |
3322 object->ObjectVerify(); | 3324 object->ObjectVerify(); |
3323 | 3325 |
| 3326 heap()->VerifyRememberedSetFor(object); |
| 3327 |
3324 // Byte arrays and strings don't have interior pointers. | 3328 // Byte arrays and strings don't have interior pointers. |
3325 if (object->IsAbstractCode()) { | 3329 if (object->IsAbstractCode()) { |
3326 VerifyPointersVisitor code_visitor; | 3330 VerifyPointersVisitor code_visitor; |
3327 object->IterateBody(map->instance_type(), object->Size(), &code_visitor); | 3331 object->IterateBody(map->instance_type(), object->Size(), &code_visitor); |
3328 } else if (object->IsFixedArray()) { | 3332 } else if (object->IsFixedArray()) { |
3329 FixedArray* array = FixedArray::cast(object); | 3333 FixedArray* array = FixedArray::cast(object); |
3330 for (int j = 0; j < array->length(); j++) { | 3334 for (int j = 0; j < array->length(); j++) { |
3331 Object* element = array->get(j); | 3335 Object* element = array->get(j); |
3332 if (element->IsHeapObject()) { | 3336 if (element->IsHeapObject()) { |
3333 HeapObject* element_object = HeapObject::cast(element); | 3337 HeapObject* element_object = HeapObject::cast(element); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3387 PrintF("\n"); | 3391 PrintF("\n"); |
3388 } | 3392 } |
3389 printf(" --------------------------------------\n"); | 3393 printf(" --------------------------------------\n"); |
3390 printf(" Marked: %x, LiveCount: %" V8PRIdPTR "\n", mark_size, | 3394 printf(" Marked: %x, LiveCount: %" V8PRIdPTR "\n", mark_size, |
3391 MarkingState::Internal(this).live_bytes()); | 3395 MarkingState::Internal(this).live_bytes()); |
3392 } | 3396 } |
3393 | 3397 |
3394 #endif // DEBUG | 3398 #endif // DEBUG |
3395 } // namespace internal | 3399 } // namespace internal |
3396 } // namespace v8 | 3400 } // namespace v8 |
OLD | NEW |