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

Unified Diff: runtime/vm/service.cc

Issue 1212933003: Observatory improvements for exploring compiled code. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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
« no previous file with comments | « runtime/vm/object.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
diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc
index 25de978a1f27f1f953df77fde8f2dc7294e240e8..0be8022e28c9a0b01c5edca6dd56d13b532d1392 100644
--- a/runtime/vm/service.cc
+++ b/runtime/vm/service.cc
@@ -1521,6 +1521,8 @@ static bool GetRetainedSize(Isolate* isolate, JSONStream* js) {
}
return true;
}
+ // TODO(rmacnak): There is no way to get the size retained by a class object.
+ // SizeRetainedByClass should be a separate RPC.
if (obj.IsClass()) {
const Class& cls = Class::Cast(obj);
ObjectGraph graph(isolate);
@@ -1529,18 +1531,11 @@ static bool GetRetainedSize(Isolate* isolate, JSONStream* js) {
result.PrintJSON(js, true);
return true;
}
- if (obj.IsInstance() || obj.IsNull()) {
- // We don't use Instance::Cast here because it doesn't allow null.
- ObjectGraph graph(isolate);
- intptr_t retained_size = graph.SizeRetainedByInstance(obj);
- const Object& result = Object::Handle(Integer::New(retained_size));
- result.PrintJSON(js, true);
- return true;
- }
- js->PrintError(kInvalidParams,
- "%s: invalid 'targetId' parameter: "
- "id '%s' does not correspond to a "
- "library, class, or instance", js->method(), target_id);
+
+ ObjectGraph graph(isolate);
+ intptr_t retained_size = graph.SizeRetainedByInstance(obj);
+ const Object& result = Object::Handle(Integer::New(retained_size));
+ result.PrintJSON(js, true);
return true;
}
« no previous file with comments | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698