OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/port.h" | 5 #include "vm/port.h" |
6 | 6 |
7 #include "vm/dart_entry.h" | 7 #include "vm/dart_entry.h" |
8 #include "platform/utils.h" | 8 #include "platform/utils.h" |
9 #include "vm/dart_api_impl.h" | 9 #include "vm/dart_api_impl.h" |
10 #include "vm/isolate.h" | 10 #include "vm/isolate.h" |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 void PortMap::PrintPortsForMessageHandler(MessageHandler* handler, | 306 void PortMap::PrintPortsForMessageHandler(MessageHandler* handler, |
307 JSONStream* stream) { | 307 JSONStream* stream) { |
308 if (!FLAG_support_service) { | 308 if (!FLAG_support_service) { |
309 return; | 309 return; |
310 } | 310 } |
311 JSONObject jsobj(stream); | 311 JSONObject jsobj(stream); |
312 jsobj.AddProperty("type", "_Ports"); | 312 jsobj.AddProperty("type", "_Ports"); |
313 Object& msg_handler = Object::Handle(); | 313 Object& msg_handler = Object::Handle(); |
314 { | 314 { |
315 JSONArray ports(&jsobj, "ports"); | 315 JSONArray ports(&jsobj, "ports"); |
316 MutexLocker ml(mutex_); | 316 SafepointMutexLocker ml(mutex_); |
317 for (intptr_t i = 0; i < capacity_; i++) { | 317 for (intptr_t i = 0; i < capacity_; i++) { |
318 if (map_[i].handler == handler) { | 318 if (map_[i].handler == handler) { |
319 if (map_[i].state == kLivePort) { | 319 if (map_[i].state == kLivePort) { |
320 JSONObject port(&ports); | 320 JSONObject port(&ports); |
321 port.AddProperty("type", "_Port"); | 321 port.AddProperty("type", "_Port"); |
322 port.AddPropertyF("name", "Isolate Port (%" Pd64 ")", map_[i].port); | 322 port.AddPropertyF("name", "Isolate Port (%" Pd64 ")", map_[i].port); |
323 msg_handler = DartLibraryCalls::LookupHandler(map_[i].port); | 323 msg_handler = DartLibraryCalls::LookupHandler(map_[i].port); |
324 port.AddProperty("handler", msg_handler); | 324 port.AddProperty("handler", msg_handler); |
325 } | 325 } |
326 } | 326 } |
327 } | 327 } |
328 } | 328 } |
329 } | 329 } |
330 | 330 |
331 } // namespace dart | 331 } // namespace dart |
OLD | NEW |