| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 781 strings.increment_number(info[type].number()); \ | 781 strings.increment_number(info[type].number()); \ |
| 782 strings.increment_bytes(info[type].bytes()); | 782 strings.increment_bytes(info[type].bytes()); |
| 783 STRING_TYPE_LIST(INCREMENT_SIZE); | 783 STRING_TYPE_LIST(INCREMENT_SIZE); |
| 784 #undef INCREMENT_SIZE | 784 #undef INCREMENT_SIZE |
| 785 } | 785 } |
| 786 | 786 |
| 787 | 787 |
| 788 void AggregatedHeapSnapshotGenerator::CollectStats(HeapObject* obj) { | 788 void AggregatedHeapSnapshotGenerator::CollectStats(HeapObject* obj) { |
| 789 InstanceType type = obj->map()->instance_type(); | 789 InstanceType type = obj->map()->instance_type(); |
| 790 ASSERT(0 <= type && type <= LAST_TYPE); | 790 ASSERT(0 <= type && type <= LAST_TYPE); |
| 791 if (!FreeListNode::IsFreeListNode(obj)) { | 791 agg_snapshot_->info()[type].increment_number(1); |
| 792 agg_snapshot_->info()[type].increment_number(1); | 792 agg_snapshot_->info()[type].increment_bytes(obj->Size()); |
| 793 agg_snapshot_->info()[type].increment_bytes(obj->Size()); | |
| 794 } | |
| 795 } | 793 } |
| 796 | 794 |
| 797 | 795 |
| 798 void AggregatedHeapSnapshotGenerator::GenerateSnapshot() { | 796 void AggregatedHeapSnapshotGenerator::GenerateSnapshot() { |
| 799 HeapIterator iterator; | 797 HeapIterator iterator(HeapIterator::kPreciseFiltering); |
| 800 for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) { | 798 for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) { |
| 801 CollectStats(obj); | 799 CollectStats(obj); |
| 802 agg_snapshot_->js_cons_profile()->CollectStats(obj); | 800 agg_snapshot_->js_cons_profile()->CollectStats(obj); |
| 803 agg_snapshot_->js_retainer_profile()->CollectStats(obj); | 801 agg_snapshot_->js_retainer_profile()->CollectStats(obj); |
| 804 } | 802 } |
| 805 CalculateStringsStats(); | 803 CalculateStringsStats(); |
| 806 agg_snapshot_->js_retainer_profile()->CoarseAndAggregate(); | 804 agg_snapshot_->js_retainer_profile()->CoarseAndAggregate(); |
| 807 } | 805 } |
| 808 | 806 |
| 809 | 807 |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1088 GlobalHandles::MakeWeak(handle.location(), | 1086 GlobalHandles::MakeWeak(handle.location(), |
| 1089 static_cast<void*>(stack.start()), | 1087 static_cast<void*>(stack.start()), |
| 1090 StackWeakReferenceCallback); | 1088 StackWeakReferenceCallback); |
| 1091 } | 1089 } |
| 1092 | 1090 |
| 1093 | 1091 |
| 1094 #endif // ENABLE_LOGGING_AND_PROFILING | 1092 #endif // ENABLE_LOGGING_AND_PROFILING |
| 1095 | 1093 |
| 1096 | 1094 |
| 1097 } } // namespace v8::internal | 1095 } } // namespace v8::internal |
| OLD | NEW |