Index: runtime/vm/thread.cc |
diff --git a/runtime/vm/thread.cc b/runtime/vm/thread.cc |
index 709d735156f35122f439b1abe52a1709a25d7ee9..c09a9f02593c1a6907ba2468cc90bb15dccd5026 100644 |
--- a/runtime/vm/thread.cc |
+++ b/runtime/vm/thread.cc |
@@ -8,6 +8,7 @@ |
#include "vm/dart_api_state.h" |
#include "vm/growable_array.h" |
#include "vm/isolate.h" |
+#include "vm/json_stream.h" |
#include "vm/lockers.h" |
#include "vm/log.h" |
#include "vm/message_handler.h" |
@@ -205,6 +206,25 @@ void Thread::InitVMConstants() { |
} |
+#ifndef PRODUCT |
+// Collect information about each individual zone associated with this thread. |
+void Thread::PrintJSON(JSONStream* stream) const { |
+ JSONObject jsobj(stream); |
+ jsobj.AddProperty("type", "_Thread"); |
+ jsobj.AddPropertyF("id", "threads/%" Pd64 "", os_thread()->trace_id()); |
+ Zone* zone = zone_; |
+ { |
+ JSONArray zone_info_array(&jsobj, "zones"); |
+ zone = zone_; |
+ while (zone != NULL) { |
+ zone_info_array.AddValue(zone); |
+ zone = zone->previous(); |
+ } |
+ } |
+} |
+#endif |
+ |
+ |
RawGrowableObjectArray* Thread::pending_functions() { |
if (pending_functions_ == GrowableObjectArray::null()) { |
pending_functions_ = GrowableObjectArray::New(Heap::kOld); |