Index: runtime/vm/thread.cc |
diff --git a/runtime/vm/thread.cc b/runtime/vm/thread.cc |
index 709d735156f35122f439b1abe52a1709a25d7ee9..aa8634e4a440d2aa010a7a959effe97d57908f8f 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() { |
} |
+#if defined(DEBUG) |
zra
2016/12/08 18:54:13
#ifndef PRODUCT?
bkonyi
2016/12/08 20:58:32
Done.
|
+// Collect information about each individual zone associated with this thread. |
+void Thread::PrintJSON(JSONStream* stream, bool ref) const { |
zra
2016/12/08 18:54:13
ref is unused.
bkonyi
2016/12/08 20:58:32
Removed ref.
|
+ 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); |