| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/thread.h" | 5 #include "vm/thread.h" |
| 6 | 6 |
| 7 #include "vm/compiler_stats.h" | 7 #include "vm/compiler_stats.h" |
| 8 #include "vm/dart_api_state.h" | 8 #include "vm/dart_api_state.h" |
| 9 #include "vm/growable_array.h" | 9 #include "vm/growable_array.h" |
| 10 #include "vm/isolate.h" | 10 #include "vm/isolate.h" |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 | 223 |
| 224 #ifndef PRODUCT | 224 #ifndef PRODUCT |
| 225 // Collect information about each individual zone associated with this thread. | 225 // Collect information about each individual zone associated with this thread. |
| 226 void Thread::PrintJSON(JSONStream* stream) const { | 226 void Thread::PrintJSON(JSONStream* stream) const { |
| 227 JSONObject jsobj(stream); | 227 JSONObject jsobj(stream); |
| 228 jsobj.AddProperty("type", "_Thread"); | 228 jsobj.AddProperty("type", "_Thread"); |
| 229 jsobj.AddPropertyF("id", "threads/%" Pd "", | 229 jsobj.AddPropertyF("id", "threads/%" Pd "", |
| 230 OSThread::ThreadIdToIntPtr(os_thread()->trace_id())); | 230 OSThread::ThreadIdToIntPtr(os_thread()->trace_id())); |
| 231 jsobj.AddProperty("kind", TaskKindToCString(task_kind())); | 231 jsobj.AddProperty("kind", TaskKindToCString(task_kind())); |
| 232 jsobj.AddPropertyF("_memoryHighWatermark", "%" Pu "", memory_high_watermark_); | 232 jsobj.AddPropertyF("_memoryHighWatermark", "%" Pu "", memory_high_watermark_); |
| 233 Zone* zone = zone_; | |
| 234 { | |
| 235 JSONArray zone_info_array(&jsobj, "zones"); | |
| 236 zone = zone_; | |
| 237 while (zone != NULL) { | |
| 238 zone_info_array.AddValue(zone); | |
| 239 zone = zone->previous(); | |
| 240 } | |
| 241 } | |
| 242 } | 233 } |
| 243 #endif | 234 #endif |
| 244 | 235 |
| 245 | 236 |
| 246 RawGrowableObjectArray* Thread::pending_functions() { | 237 RawGrowableObjectArray* Thread::pending_functions() { |
| 247 if (pending_functions_ == GrowableObjectArray::null()) { | 238 if (pending_functions_ == GrowableObjectArray::null()) { |
| 248 pending_functions_ = GrowableObjectArray::New(Heap::kOld); | 239 pending_functions_ = GrowableObjectArray::New(Heap::kOld); |
| 249 } | 240 } |
| 250 return pending_functions_; | 241 return pending_functions_; |
| 251 } | 242 } |
| (...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 908 | 899 |
| 909 DisableThreadInterruptsScope::~DisableThreadInterruptsScope() { | 900 DisableThreadInterruptsScope::~DisableThreadInterruptsScope() { |
| 910 if (thread() != NULL) { | 901 if (thread() != NULL) { |
| 911 OSThread* os_thread = thread()->os_thread(); | 902 OSThread* os_thread = thread()->os_thread(); |
| 912 ASSERT(os_thread != NULL); | 903 ASSERT(os_thread != NULL); |
| 913 os_thread->EnableThreadInterrupts(); | 904 os_thread->EnableThreadInterrupts(); |
| 914 } | 905 } |
| 915 } | 906 } |
| 916 | 907 |
| 917 } // namespace dart | 908 } // namespace dart |
| OLD | NEW |