| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/service.h" | 5 #include "vm/service.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 #include "include/dart_native_api.h" | 8 #include "include/dart_native_api.h" |
| 9 #include "platform/globals.h" | 9 #include "platform/globals.h" |
| 10 | 10 |
| (...skipping 1273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1284 intptr_t num_frames = stack->Length(); | 1284 intptr_t num_frames = stack->Length(); |
| 1285 for (intptr_t i = 0; i < num_frames; i++) { | 1285 for (intptr_t i = 0; i < num_frames; i++) { |
| 1286 ActivationFrame* frame = stack->FrameAt(i); | 1286 ActivationFrame* frame = stack->FrameAt(i); |
| 1287 JSONObject jsobj(&jsarr); | 1287 JSONObject jsobj(&jsarr); |
| 1288 frame->PrintToJSONObject(&jsobj, full); | 1288 frame->PrintToJSONObject(&jsobj, full); |
| 1289 jsobj.AddProperty("index", i); | 1289 jsobj.AddProperty("index", i); |
| 1290 } | 1290 } |
| 1291 } | 1291 } |
| 1292 | 1292 |
| 1293 { | 1293 { |
| 1294 MessageHandler::AcquiredQueues aq; | 1294 MessageHandler::AcquiredQueues aq(isolate->message_handler()); |
| 1295 isolate->message_handler()->AcquireQueues(&aq); | |
| 1296 jsobj.AddProperty("messages", aq.queue()); | 1295 jsobj.AddProperty("messages", aq.queue()); |
| 1297 } | 1296 } |
| 1298 | 1297 |
| 1299 return true; | 1298 return true; |
| 1300 } | 1299 } |
| 1301 | 1300 |
| 1302 | 1301 |
| 1303 static bool HandleCommonEcho(JSONObject* jsobj, JSONStream* js) { | 1302 static bool HandleCommonEcho(JSONObject* jsobj, JSONStream* js) { |
| 1304 jsobj->AddProperty("type", "_EchoResponse"); | 1303 jsobj->AddProperty("type", "_EchoResponse"); |
| 1305 if (js->HasParam("text")) { | 1304 if (js->HasParam("text")) { |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1672 | 1671 |
| 1673 static RawObject* LookupHeapObjectMessage(Thread* thread, | 1672 static RawObject* LookupHeapObjectMessage(Thread* thread, |
| 1674 char** parts, int num_parts) { | 1673 char** parts, int num_parts) { |
| 1675 if (num_parts != 2) { | 1674 if (num_parts != 2) { |
| 1676 return Object::sentinel().raw(); | 1675 return Object::sentinel().raw(); |
| 1677 } | 1676 } |
| 1678 uword message_id = 0; | 1677 uword message_id = 0; |
| 1679 if (!GetUnsignedIntegerId(parts[1], &message_id, 16)) { | 1678 if (!GetUnsignedIntegerId(parts[1], &message_id, 16)) { |
| 1680 return Object::sentinel().raw(); | 1679 return Object::sentinel().raw(); |
| 1681 } | 1680 } |
| 1682 MessageHandler::AcquiredQueues aq; | 1681 MessageHandler::AcquiredQueues aq(thread->isolate()->message_handler()); |
| 1683 thread->isolate()->message_handler()->AcquireQueues(&aq); | |
| 1684 Message* message = aq.queue()->FindMessageById(message_id); | 1682 Message* message = aq.queue()->FindMessageById(message_id); |
| 1685 if (message == NULL) { | 1683 if (message == NULL) { |
| 1686 // The user may try to load an expired message. | 1684 // The user may try to load an expired message. |
| 1687 return Object::sentinel().raw(); | 1685 return Object::sentinel().raw(); |
| 1688 } | 1686 } |
| 1689 if (message->len() > 0) { | 1687 if (message->len() > 0) { |
| 1690 MessageSnapshotReader reader(message->data(), | 1688 MessageSnapshotReader reader(message->data(), |
| 1691 message->len(), | 1689 message->len(), |
| 1692 thread); | 1690 thread); |
| 1693 return reader.ReadObject(); | 1691 return reader.ReadObject(); |
| (...skipping 2404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4098 if (strcmp(method_name, method.name) == 0) { | 4096 if (strcmp(method_name, method.name) == 0) { |
| 4099 return &method; | 4097 return &method; |
| 4100 } | 4098 } |
| 4101 } | 4099 } |
| 4102 return NULL; | 4100 return NULL; |
| 4103 } | 4101 } |
| 4104 | 4102 |
| 4105 #endif // !PRODUCT | 4103 #endif // !PRODUCT |
| 4106 | 4104 |
| 4107 } // namespace dart | 4105 } // namespace dart |
| OLD | NEW |