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

Unified Diff: runtime/vm/pages.cc

Issue 204103009: Add class and address information to heap map; display on hover. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 9 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 | « runtime/vm/pages.h ('k') | runtime/vm/service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/pages.cc
===================================================================
--- runtime/vm/pages.cc (revision 34193)
+++ runtime/vm/pages.cc (working copy)
@@ -441,7 +441,7 @@
};
-void PageSpace::PrintHeapMapToJSONStream(JSONStream* stream) {
+void PageSpace::PrintHeapMapToJSONStream(Isolate* isolate, JSONStream* stream) {
JSONObject heap_map(stream);
heap_map.AddProperty("type", "HeapMap");
heap_map.AddProperty("id", "heapmap");
@@ -449,12 +449,20 @@
static_cast<intptr_t>(kFreeListElement));
heap_map.AddProperty("unit_size_bytes",
static_cast<intptr_t>(kObjectAlignment));
+ heap_map.AddProperty("page_size_bytes", kPageSizeInWords * kWordSize);
{
- // "pages" is an array [page0, page1, ..., pageN], each page an array
- // [size, class id, size, class id, ...] (size unit is kObjectAlignment).
+ JSONObject class_list(&heap_map, "class_list");
+ isolate->class_table()->PrintToJSONObject(&class_list);
+ }
+ {
+ // "pages" is an array [page0, page1, ..., pageN], each page of the form
+ // {"object_start": "0x...", "objects": [size, class id, size, ...]}
JSONArray all_pages(&heap_map, "pages");
for (HeapPage* page = pages_; page != NULL; page = page->next()) {
- JSONArray page_map(&all_pages);
+ JSONObject page_container(&all_pages);
+ page_container.AddPropertyF("object_start",
+ "0x%" Px "", page->object_start());
+ JSONArray page_map(&page_container, "objects");
HeapMapAsJSONVisitor printer(&page_map);
page->VisitObjects(&printer);
}
« no previous file with comments | « runtime/vm/pages.h ('k') | runtime/vm/service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698