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