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

Unified Diff: runtime/vm/service.cc

Issue 2574643003: Added ability to request zone memory information for all isolates through the VM service and added … (Closed)
Patch Set: Created 4 years 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
Index: runtime/vm/service.cc
diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc
index 3cbf8fc24a693d5eaa0a8d2dc16e6c80589293b5..71e83f20ae9ed6cb533144f342634a518708fb9b 100644
--- a/runtime/vm/service.cc
+++ b/runtime/vm/service.cc
@@ -2946,6 +2946,41 @@ static bool GetVMTimelineFlags(Thread* thread, JSONStream* js) {
}
+class ServiceIsolateVisitor : public IsolateVisitor {
+ public:
+ explicit ServiceIsolateVisitor(JSONArray* jsarr, bool ref = true)
zra 2016/12/13 23:37:02 Since there are still only a small number of uses
bkonyi 2016/12/13 23:48:45 Done.
+ : jsarr_(jsarr), ref_(ref) {}
+ virtual ~ServiceIsolateVisitor() {}
+
+ void VisitIsolate(Isolate* isolate) {
+ if (!IsVMInternalIsolate(isolate)) {
+ jsarr_->AddValue(isolate, ref_);
+ }
+ }
+
+ private:
+ JSONArray* jsarr_;
+ bool ref_;
+};
+
+
+static const MethodParameter* get_zone_memory_info_params[] = {
+ NO_ISOLATE_PARAMETER, NULL,
+};
+
+
+static bool GetZoneMemoryInfo(Thread* thread, JSONStream* js) {
Cutch 2016/12/14 17:18:15 This is the same as getVM but with the full Isolat
+ JSONObject jsobj(js);
+ jsobj.AddProperty("type", "_ZoneMemoryInfo");
bkonyi 2016/12/13 22:37:48 There's probably a better name for this type, but
zra 2016/12/13 23:37:02 _AllIsolatesInfo? Not sure if this matches with th
+ {
+ JSONArray jsarr(&jsobj, "isolates");
+ ServiceIsolateVisitor visitor(&jsarr, false);
+ Isolate::VisitIsolates(&visitor);
+ }
+ return true;
+}
+
+
static const MethodParameter* clear_vm_timeline_params[] = {
NO_ISOLATE_PARAMETER, NULL,
};
@@ -3756,22 +3791,6 @@ static bool GetVersion(Thread* thread, JSONStream* js) {
}
-class ServiceIsolateVisitor : public IsolateVisitor {
- public:
- explicit ServiceIsolateVisitor(JSONArray* jsarr) : jsarr_(jsarr) {}
- virtual ~ServiceIsolateVisitor() {}
-
- void VisitIsolate(Isolate* isolate) {
- if (!IsVMInternalIsolate(isolate)) {
- jsarr_->AddValue(isolate);
- }
- }
-
- private:
- JSONArray* jsarr_;
-};
-
-
static const MethodParameter* get_vm_params[] = {
NO_ISOLATE_PARAMETER, NULL,
};
@@ -4085,6 +4104,8 @@ static const ServiceMethodDescriptor service_methods_[] = {
get_vm_timeline_params },
{ "_getVMTimelineFlags", GetVMTimelineFlags,
get_vm_timeline_flags_params },
+ { "_getZoneMemoryInfo", GetZoneMemoryInfo,
bkonyi 2016/12/13 22:37:48 I'm not sure if this is the best name since what's
zra 2016/12/13 23:37:02 If there isn't already something like that, then t
+ get_zone_memory_info_params },
{ "pause", Pause,
pause_params },
{ "removeBreakpoint", RemoveBreakpoint,

Powered by Google App Engine
This is Rietveld 408576698