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

Unified Diff: src/heap/heap.cc

Issue 1113233002: Adding api to get last gc object statistics for chrome://tracing. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixing the comment with NumberOfTrackedHeapObjectTypes. Created 5 years, 7 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/heap.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index bfd1fb50958ee8288422606051700c4324438775..25de95411df40b3011409ad67f90087765fe6127 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -6501,5 +6501,43 @@ void Heap::UnregisterStrongRoots(Object** start) {
list = next;
}
}
+
+
+bool Heap::GetObjectTypeName(size_t index, const char** object_type,
+ const char** object_sub_type) {
+ if (index >= OBJECT_STATS_COUNT) return false;
+
+ switch (static_cast<int>(index)) {
+#define COMPARE_AND_RETURN_NAME(name) \
+ case name: \
+ *object_type = #name; \
+ *object_sub_type = ""; \
+ return true;
+ INSTANCE_TYPE_LIST(COMPARE_AND_RETURN_NAME)
+#undef COMPARE_AND_RETURN_NAME
+#define COMPARE_AND_RETURN_NAME(name) \
+ case FIRST_CODE_KIND_SUB_TYPE + Code::name: \
+ *object_type = "CODE_TYPE"; \
+ *object_sub_type = "CODE_KIND/" #name; \
+ return true;
+ CODE_KIND_LIST(COMPARE_AND_RETURN_NAME)
+#undef COMPARE_AND_RETURN_NAME
+#define COMPARE_AND_RETURN_NAME(name) \
+ case FIRST_FIXED_ARRAY_SUB_TYPE + name: \
+ *object_type = "FIXED_ARRAY_TYPE"; \
+ *object_sub_type = #name; \
+ return true;
+ FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(COMPARE_AND_RETURN_NAME)
+#undef COMPARE_AND_RETURN_NAME
+#define COMPARE_AND_RETURN_NAME(name) \
+ case FIRST_CODE_AGE_SUB_TYPE + Code::k##name##CodeAge - Code::kFirstCodeAge: \
+ *object_type = "CODE_TYPE"; \
+ *object_sub_type = "CODE_AGE/" #name; \
+ return true;
+ CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME)
+#undef COMPARE_AND_RETURN_NAME
+ }
+ return false;
+}
}
} // namespace v8::internal
« no previous file with comments | « src/heap/heap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698