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

Unified Diff: runtime/vm/service.cc

Issue 350403005: Include parent field/list index in retaining path. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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
« runtime/vm/object_graph_test.cc ('K') | « runtime/vm/object_graph_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/service.cc
===================================================================
--- runtime/vm/service.cc (revision 37797)
+++ runtime/vm/service.cc (working copy)
@@ -981,19 +981,22 @@
return true;
}
ObjectGraph graph(isolate);
- Array& path = Array::Handle(Array::New(limit));
+ Array& path = Array::Handle(Array::New(limit * 2));
intptr_t length = graph.RetainingPath(obj, path);
JSONObject jsobj(js);
jsobj.AddProperty("type", "RetainingPath");
jsobj.AddProperty("id", "retaining_path");
jsobj.AddProperty("length", length);
JSONArray elements(&jsobj, "elements");
- for (intptr_t i = 0; i < path.Length() && i < length; ++i) {
+ Object& element = Object::Handle();
+ Smi& offset_from_parent = Smi::Handle();
+ for (intptr_t i = 0; i < limit && i < length; ++i) {
JSONObject jselement(&elements);
- Object& element = Object::Handle();
- element = path.At(i);
+ element = path.At(i * 2);
jselement.AddProperty("index", i);
jselement.AddProperty("value", element);
+ offset_from_parent ^= path.At((i * 2) + 1);
+ // TODO(koda): Interpret offset as field, list index or map entry.
}
return true;
}
« runtime/vm/object_graph_test.cc ('K') | « runtime/vm/object_graph_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698