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

Unified Diff: src/heap/object-stats.h

Issue 2147693004: [heap] ObjectStats: Fix accounting for fixed array subtypes (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: More fixed array types Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/marking.h ('k') | src/heap/object-stats.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/object-stats.h
diff --git a/src/heap/object-stats.h b/src/heap/object-stats.h
index 54dc833e01f217e8b9ac9d8b434650e1c11c832b..cf28104382cdd78972f06205dd6f87d32ab43e81 100644
--- a/src/heap/object-stats.h
+++ b/src/heap/object-stats.h
@@ -5,6 +5,8 @@
#ifndef V8_HEAP_OBJECT_STATS_H_
#define V8_HEAP_OBJECT_STATS_H_
+#include <set>
+
#include "src/base/ieee754.h"
#include "src/heap/heap.h"
#include "src/heap/objects-visiting.h"
@@ -58,8 +60,10 @@ class ObjectStats {
size_histogram_[code_age_index][idx]++;
}
- void RecordFixedArraySubTypeStats(int array_sub_type, size_t size,
- size_t over_allocated) {
+ void RecordFixedArraySubTypeStats(FixedArrayBase* array, int array_sub_type,
+ size_t size, size_t over_allocated) {
+ auto it = visited_fixed_array_sub_types_.insert(array);
+ if (!it.second) return;
DCHECK(array_sub_type <= LAST_FIXED_ARRAY_SUB_TYPE);
object_counts_[FIRST_FIXED_ARRAY_SUB_TYPE + array_sub_type]++;
object_sizes_[FIRST_FIXED_ARRAY_SUB_TYPE + array_sub_type] += size;
@@ -107,6 +111,8 @@ class ObjectStats {
// Detailed histograms by InstanceType.
size_t size_histogram_[OBJECT_STATS_COUNT][kNumberOfBuckets];
size_t over_allocated_histogram_[OBJECT_STATS_COUNT][kNumberOfBuckets];
+
+ std::set<FixedArrayBase*> visited_fixed_array_sub_types_;
};
class ObjectStatsCollector {
@@ -126,6 +132,11 @@ class ObjectStatsCollector {
JSObject* object);
static void RecordJSWeakCollectionDetails(ObjectStats* stats, Heap* heap,
JSWeakCollection* obj);
+ static void RecordScriptDetails(ObjectStats* stats, Heap* heap, Script* obj);
+
+ static void RecordFixedArrayHelper(ObjectStats* stats, Heap* heap,
+ HeapObject* parent, FixedArray* array,
+ int subtype, size_t overhead);
};
} // namespace internal
« no previous file with comments | « src/heap/marking.h ('k') | src/heap/object-stats.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698