| 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 "platform/globals.h" | 8 #include "platform/globals.h" |
| 9 | 9 |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #include "vm/port.h" | 24 #include "vm/port.h" |
| 25 #include "vm/profiler.h" | 25 #include "vm/profiler.h" |
| 26 #include "vm/stack_frame.h" | 26 #include "vm/stack_frame.h" |
| 27 #include "vm/symbols.h" | 27 #include "vm/symbols.h" |
| 28 #include "vm/version.h" | 28 #include "vm/version.h" |
| 29 | 29 |
| 30 | 30 |
| 31 namespace dart { | 31 namespace dart { |
| 32 | 32 |
| 33 DEFINE_FLAG(bool, trace_service, false, "Trace VM service requests."); | 33 DEFINE_FLAG(bool, trace_service, false, "Trace VM service requests."); |
| 34 DECLARE_FLAG(bool, enable_type_checks); |
| 35 DECLARE_FLAG(bool, enable_asserts); |
| 34 | 36 |
| 35 struct ResourcesEntry { | 37 struct ResourcesEntry { |
| 36 const char* path_; | 38 const char* path_; |
| 37 const char* resource_; | 39 const char* resource_; |
| 38 int length_; | 40 int length_; |
| 39 }; | 41 }; |
| 40 | 42 |
| 41 extern ResourcesEntry __service_resources_[]; | 43 extern ResourcesEntry __service_resources_[]; |
| 42 | 44 |
| 43 class Resources { | 45 class Resources { |
| (...skipping 1717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1761 JSONArray* jsarr_; | 1763 JSONArray* jsarr_; |
| 1762 }; | 1764 }; |
| 1763 | 1765 |
| 1764 | 1766 |
| 1765 static bool HandleVM(JSONStream* js) { | 1767 static bool HandleVM(JSONStream* js) { |
| 1766 JSONObject jsobj(js); | 1768 JSONObject jsobj(js); |
| 1767 jsobj.AddProperty("type", "VM"); | 1769 jsobj.AddProperty("type", "VM"); |
| 1768 jsobj.AddProperty("id", "vm"); | 1770 jsobj.AddProperty("id", "vm"); |
| 1769 jsobj.AddProperty("architecture", CPU::Id()); | 1771 jsobj.AddProperty("architecture", CPU::Id()); |
| 1770 jsobj.AddProperty("version", Version::String()); | 1772 jsobj.AddProperty("version", Version::String()); |
| 1771 | 1773 jsobj.AddProperty("assertsEnabled", FLAG_enable_asserts); |
| 1774 jsobj.AddProperty("typeChecksEnabled", FLAG_enable_type_checks); |
| 1772 int64_t start_time_micros = Dart::vm_isolate()->start_time(); | 1775 int64_t start_time_micros = Dart::vm_isolate()->start_time(); |
| 1773 int64_t uptime_micros = (OS::GetCurrentTimeMicros() - start_time_micros); | 1776 int64_t uptime_micros = (OS::GetCurrentTimeMicros() - start_time_micros); |
| 1774 double seconds = (static_cast<double>(uptime_micros) / | 1777 double seconds = (static_cast<double>(uptime_micros) / |
| 1775 static_cast<double>(kMicrosecondsPerSecond)); | 1778 static_cast<double>(kMicrosecondsPerSecond)); |
| 1776 jsobj.AddProperty("uptime", seconds); | 1779 jsobj.AddProperty("uptime", seconds); |
| 1777 | 1780 |
| 1778 // Construct the isolate list. | 1781 // Construct the isolate list. |
| 1779 { | 1782 { |
| 1780 JSONArray jsarr(&jsobj, "isolates"); | 1783 JSONArray jsarr(&jsobj, "isolates"); |
| 1781 ServiceIsolateVisitor visitor(&jsarr); | 1784 ServiceIsolateVisitor visitor(&jsarr); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1896 while (current != NULL) { | 1899 while (current != NULL) { |
| 1897 if (strcmp(name, current->name()) == 0) { | 1900 if (strcmp(name, current->name()) == 0) { |
| 1898 return current; | 1901 return current; |
| 1899 } | 1902 } |
| 1900 current = current->next(); | 1903 current = current->next(); |
| 1901 } | 1904 } |
| 1902 return NULL; | 1905 return NULL; |
| 1903 } | 1906 } |
| 1904 | 1907 |
| 1905 } // namespace dart | 1908 } // namespace dart |
| OLD | NEW |