| Index: src/heap.cc
|
| ===================================================================
|
| --- src/heap.cc (revision 5189)
|
| +++ src/heap.cc (working copy)
|
| @@ -4111,7 +4111,7 @@
|
| }
|
|
|
|
|
| -void Heap::RecordStats(HeapStats* stats) {
|
| +void Heap::RecordStats(HeapStats* stats, bool take_snapshot) {
|
| *stats->start_marker = 0xDECADE00;
|
| *stats->end_marker = 0xDECADE01;
|
| *stats->new_space_size = new_space_.Size();
|
| @@ -4128,6 +4128,23 @@
|
| *stats->cell_space_capacity = cell_space_->Capacity();
|
| *stats->lo_space_size = lo_space_->Size();
|
| GlobalHandles::RecordStats(stats);
|
| + *stats->memory_allocator_size = MemoryAllocator::Size();
|
| + *stats->memory_allocator_capacity =
|
| + MemoryAllocator::Size() + MemoryAllocator::Available();
|
| + if (take_snapshot) {
|
| + HeapIterator iterator;
|
| + for (HeapObject* obj = iterator.next();
|
| + obj != NULL;
|
| + obj = iterator.next()) {
|
| + // Note: snapshot won't be precise because IsFreeListNode returns true
|
| + // for any bytearray.
|
| + if (FreeListNode::IsFreeListNode(obj)) continue;
|
| + InstanceType type = obj->map()->instance_type();
|
| + ASSERT(0 <= type && type <= LAST_TYPE);
|
| + stats->objects_per_type[type]++;
|
| + stats->size_per_type[type] += obj->Size();
|
| + }
|
| + }
|
| }
|
|
|
|
|
|
|