| 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/service_event.h" | 5 #include "vm/service_event.h" |
| 6 | 6 |
| 7 namespace dart { | 7 namespace dart { |
| 8 | 8 |
| 9 // Translate from the legacy DebugEvent to a ServiceEvent. | 9 // Translate from the legacy DebugEvent to a ServiceEvent. |
| 10 static ServiceEvent::EventKind TranslateEventKind( | 10 static ServiceEvent::EventKind TranslateEventKind( |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 } | 159 } |
| 160 if (top_frame() != NULL) { | 160 if (top_frame() != NULL) { |
| 161 JSONObject jsFrame(&jsobj, "topFrame"); | 161 JSONObject jsFrame(&jsobj, "topFrame"); |
| 162 top_frame()->PrintToJSONObject(&jsFrame); | 162 top_frame()->PrintToJSONObject(&jsFrame); |
| 163 intptr_t index = 0; // Avoid ambiguity in call to AddProperty. | 163 intptr_t index = 0; // Avoid ambiguity in call to AddProperty. |
| 164 jsFrame.AddProperty("index", index); | 164 jsFrame.AddProperty("index", index); |
| 165 } | 165 } |
| 166 if (exception() != NULL) { | 166 if (exception() != NULL) { |
| 167 jsobj.AddProperty("exception", *(exception())); | 167 jsobj.AddProperty("exception", *(exception())); |
| 168 } | 168 } |
| 169 if (async_continuation() != NULL) { | 169 if (async_continuation() != NULL && !async_continuation()->IsNull()) { |
| 170 jsobj.AddProperty("_asyncContinuation", *(async_continuation())); | 170 jsobj.AddProperty("_asyncContinuation", *(async_continuation())); |
| 171 } | 171 } |
| 172 if (inspectee() != NULL) { | 172 if (inspectee() != NULL) { |
| 173 jsobj.AddProperty("inspectee", *(inspectee())); | 173 jsobj.AddProperty("inspectee", *(inspectee())); |
| 174 } | 174 } |
| 175 if (gc_stats() != NULL) { | 175 if (gc_stats() != NULL) { |
| 176 jsobj.AddProperty("reason", Heap::GCReasonToString(gc_stats()->reason_)); | 176 jsobj.AddProperty("reason", Heap::GCReasonToString(gc_stats()->reason_)); |
| 177 isolate()->heap()->PrintToJSONObject(Heap::kNew, &jsobj); | 177 isolate()->heap()->PrintToJSONObject(Heap::kNew, &jsobj); |
| 178 isolate()->heap()->PrintToJSONObject(Heap::kOld, &jsobj); | 178 isolate()->heap()->PrintToJSONObject(Heap::kOld, &jsobj); |
| 179 } | 179 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 195 | 195 |
| 196 | 196 |
| 197 void ServiceEvent::PrintJSONHeader(JSONObject* jsobj) const { | 197 void ServiceEvent::PrintJSONHeader(JSONObject* jsobj) const { |
| 198 ASSERT(jsobj != NULL); | 198 ASSERT(jsobj != NULL); |
| 199 jsobj->AddProperty("type", "Event"); | 199 jsobj->AddProperty("type", "Event"); |
| 200 jsobj->AddProperty("kind", KindAsCString()); | 200 jsobj->AddProperty("kind", KindAsCString()); |
| 201 jsobj->AddProperty("isolate", isolate()); | 201 jsobj->AddProperty("isolate", isolate()); |
| 202 } | 202 } |
| 203 | 203 |
| 204 } // namespace dart | 204 } // namespace dart |
| OLD | NEW |