| 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/isolate.h" | 5 #include "vm/isolate.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/assert.h" | 9 #include "platform/assert.h" |
| 10 #include "platform/json.h" | 10 #include "platform/json.h" |
| (...skipping 1804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1815 } | 1815 } |
| 1816 | 1816 |
| 1817 | 1817 |
| 1818 void Isolate::VisitPrologueWeakPersistentHandles(HandleVisitor* visitor) { | 1818 void Isolate::VisitPrologueWeakPersistentHandles(HandleVisitor* visitor) { |
| 1819 if (api_state() != NULL) { | 1819 if (api_state() != NULL) { |
| 1820 api_state()->VisitPrologueWeakHandles(visitor); | 1820 api_state()->VisitPrologueWeakHandles(visitor); |
| 1821 } | 1821 } |
| 1822 } | 1822 } |
| 1823 | 1823 |
| 1824 | 1824 |
| 1825 static const char* ExceptionPauseInfoToServiceEnum(Dart_ExceptionPauseInfo pi) { |
| 1826 switch (pi) { |
| 1827 case kPauseOnAllExceptions: |
| 1828 return "All"; |
| 1829 case kNoPauseOnExceptions: |
| 1830 return "None"; |
| 1831 case kPauseOnUnhandledExceptions: |
| 1832 return "Unhandled"; |
| 1833 default: |
| 1834 UNIMPLEMENTED(); |
| 1835 return NULL; |
| 1836 } |
| 1837 } |
| 1838 |
| 1839 |
| 1825 void Isolate::PrintJSON(JSONStream* stream, bool ref) { | 1840 void Isolate::PrintJSON(JSONStream* stream, bool ref) { |
| 1826 JSONObject jsobj(stream); | 1841 JSONObject jsobj(stream); |
| 1827 jsobj.AddProperty("type", (ref ? "@Isolate" : "Isolate")); | 1842 jsobj.AddProperty("type", (ref ? "@Isolate" : "Isolate")); |
| 1828 jsobj.AddFixedServiceId("isolates/%" Pd "", | 1843 jsobj.AddFixedServiceId("isolates/%" Pd "", |
| 1829 static_cast<intptr_t>(main_port())); | 1844 static_cast<intptr_t>(main_port())); |
| 1830 | 1845 |
| 1831 jsobj.AddProperty("name", debugger_name()); | 1846 jsobj.AddProperty("name", debugger_name()); |
| 1832 jsobj.AddPropertyF("number", "%" Pd "", | 1847 jsobj.AddPropertyF("number", "%" Pd "", |
| 1833 static_cast<intptr_t>(main_port())); | 1848 static_cast<intptr_t>(main_port())); |
| 1834 if (ref) { | 1849 if (ref) { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 1862 ServiceEvent pause_event(this, ServiceEvent::kResume); | 1877 ServiceEvent pause_event(this, ServiceEvent::kResume); |
| 1863 | 1878 |
| 1864 // TODO(turnidge): Don't compute a full stack trace. | 1879 // TODO(turnidge): Don't compute a full stack trace. |
| 1865 DebuggerStackTrace* stack = debugger()->StackTrace(); | 1880 DebuggerStackTrace* stack = debugger()->StackTrace(); |
| 1866 if (stack->Length() > 0) { | 1881 if (stack->Length() > 0) { |
| 1867 pause_event.set_top_frame(stack->FrameAt(0)); | 1882 pause_event.set_top_frame(stack->FrameAt(0)); |
| 1868 } | 1883 } |
| 1869 jsobj.AddProperty("pauseEvent", &pause_event); | 1884 jsobj.AddProperty("pauseEvent", &pause_event); |
| 1870 } | 1885 } |
| 1871 | 1886 |
| 1887 jsobj.AddProperty("exceptionPauseMode", |
| 1888 ExceptionPauseInfoToServiceEnum(debugger()->GetExceptionPauseInfo())); |
| 1889 |
| 1872 const Library& lib = | 1890 const Library& lib = |
| 1873 Library::Handle(object_store()->root_library()); | 1891 Library::Handle(object_store()->root_library()); |
| 1874 if (!lib.IsNull()) { | 1892 if (!lib.IsNull()) { |
| 1875 jsobj.AddProperty("rootLib", lib); | 1893 jsobj.AddProperty("rootLib", lib); |
| 1876 } | 1894 } |
| 1877 | 1895 |
| 1878 { | 1896 { |
| 1879 JSONObject tagCounters(&jsobj, "_tagCounters"); | 1897 JSONObject tagCounters(&jsobj, "_tagCounters"); |
| 1880 vm_tag_counters()->PrintToJSONObject(&tagCounters); | 1898 vm_tag_counters()->PrintToJSONObject(&tagCounters); |
| 1881 } | 1899 } |
| (...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2599 serialized_message_, serialized_message_len_); | 2617 serialized_message_, serialized_message_len_); |
| 2600 } | 2618 } |
| 2601 | 2619 |
| 2602 | 2620 |
| 2603 void IsolateSpawnState::Cleanup() { | 2621 void IsolateSpawnState::Cleanup() { |
| 2604 SwitchIsolateScope switch_scope(I); | 2622 SwitchIsolateScope switch_scope(I); |
| 2605 Dart::ShutdownIsolate(); | 2623 Dart::ShutdownIsolate(); |
| 2606 } | 2624 } |
| 2607 | 2625 |
| 2608 } // namespace dart | 2626 } // namespace dart |
| OLD | NEW |