| 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 #ifndef PRODUCT |
| 184 if (!FLAG_support_service) { | 185 if (!FLAG_support_service) { |
| 185 return; | 186 return; |
| 186 } | 187 } |
| 187 JSONArray messages(stream); | 188 JSONArray messages(stream); |
| 188 | 189 |
| 189 Object& msg_handler = Object::Handle(); | 190 Object& msg_handler = Object::Handle(); |
| 190 | 191 |
| 191 MessageQueue::Iterator it(this); | 192 MessageQueue::Iterator it(this); |
| 192 intptr_t depth = 0; | 193 intptr_t depth = 0; |
| 193 while (it.HasNext()) { | 194 while (it.HasNext()) { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 214 const Function& function = Function::Cast(msg_handler); | 215 const Function& function = Function::Cast(msg_handler); |
| 215 message.AddProperty("handler", function); | 216 message.AddProperty("handler", function); |
| 216 | 217 |
| 217 const Script& script = Script::Handle(function.script()); | 218 const Script& script = Script::Handle(function.script()); |
| 218 if (!script.IsNull()) { | 219 if (!script.IsNull()) { |
| 219 message.AddLocation(script, function.token_pos(), | 220 message.AddLocation(script, function.token_pos(), |
| 220 function.end_token_pos()); | 221 function.end_token_pos()); |
| 221 } | 222 } |
| 222 } | 223 } |
| 223 } | 224 } |
| 225 #endif // !PRODUCT |
| 224 } | 226 } |
| 225 | 227 |
| 226 } // namespace dart | 228 } // namespace dart |
| OLD | NEW |