| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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/message.h" | 5 #include "vm/message.h" |
| 6 | 6 |
| 7 #include "vm/dart_entry.h" | 7 #include "vm/dart_entry.h" |
| 8 #include "vm/json_stream.h" | 8 #include "vm/json_stream.h" |
| 9 #include "vm/object.h" | 9 #include "vm/object.h" |
| 10 #include "vm/port.h" | 10 #include "vm/port.h" |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 ASSERT(current != NULL); | 174 ASSERT(current != NULL); |
| 175 if (current->Id() == id) { | 175 if (current->Id() == id) { |
| 176 return current; | 176 return current; |
| 177 } | 177 } |
| 178 } | 178 } |
| 179 return NULL; | 179 return NULL; |
| 180 } | 180 } |
| 181 | 181 |
| 182 | 182 |
| 183 void MessageQueue::PrintJSON(JSONStream* stream) { | 183 void MessageQueue::PrintJSON(JSONStream* stream) { |
| 184 Isolate* isolate = Isolate::Current(); | |
| 185 JSONArray messages(stream); | 184 JSONArray messages(stream); |
| 186 | 185 |
| 187 Object& msg_handler = Object::Handle(isolate); | 186 Object& msg_handler = Object::Handle(); |
| 188 | 187 |
| 189 MessageQueue::Iterator it(this); | 188 MessageQueue::Iterator it(this); |
| 190 intptr_t depth = 0; | 189 intptr_t depth = 0; |
| 191 while (it.HasNext()) { | 190 while (it.HasNext()) { |
| 192 Message* current = it.Next(); | 191 Message* current = it.Next(); |
| 193 JSONObject message(&messages); | 192 JSONObject message(&messages); |
| 194 message.AddProperty("type", "Message"); | 193 message.AddProperty("type", "Message"); |
| 195 message.AddPropertyF("name", "Isolate Message (%" Px ")", current->Id()); | 194 message.AddPropertyF("name", "Isolate Message (%" Px ")", current->Id()); |
| 196 message.AddPropertyF("messageObjectId", "messages/%" Px "", | 195 message.AddPropertyF("messageObjectId", "messages/%" Px "", |
| 197 current->Id()); | 196 current->Id()); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 215 const Script& script = Script::Handle(function.script()); | 214 const Script& script = Script::Handle(function.script()); |
| 216 if (!script.IsNull()) { | 215 if (!script.IsNull()) { |
| 217 message.AddLocation(script, function.token_pos(), | 216 message.AddLocation(script, function.token_pos(), |
| 218 function.end_token_pos()); | 217 function.end_token_pos()); |
| 219 } | 218 } |
| 220 } | 219 } |
| 221 } | 220 } |
| 222 } | 221 } |
| 223 | 222 |
| 224 } // namespace dart | 223 } // namespace dart |
| OLD | NEW |