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

Unified Diff: runtime/vm/zone.cc

Issue 2554983002: Created methods to surface zone memory information for each isolate and thread in JSON. (Closed)
Patch Set: Created methods to surface zone memory information for each isolate and thread in JSON. 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/zone.cc
diff --git a/runtime/vm/zone.cc b/runtime/vm/zone.cc
index 45314dcfe32d7887d91f82978eaecdfa50cdbce5..1103d56bfadc2cb16c12255bbbab162edfc90598 100644
--- a/runtime/vm/zone.cc
+++ b/runtime/vm/zone.cc
@@ -260,6 +260,15 @@ char* Zone::VPrint(const char* format, va_list args) {
}
+#ifndef PRODUCT
+void Zone::PrintToJSONObject(JSONObject* obj) const {
+ const Zone* zone = this;
+ intptr_t size = SizeInBytes();
+ obj->AddPropertyF("address", "0x%" Px "", reinterpret_cast<uword>(zone));
Cutch 2016/12/06 19:11:15 don't forget "type" and "id" fields.
+ obj->AddProperty("size", size);
+}
+#endif
+
StackZone::StackZone(Thread* thread) : StackResource(thread), zone_() {
if (FLAG_trace_zones) {
OS::PrintErr("*** Starting a new Stack zone 0x%" Px "(0x%" Px ")\n",

Powered by Google App Engine
This is Rietveld 408576698