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 2587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2598 JSONObject jsobj(js); | 2598 JSONObject jsobj(js); |
2599 jsobj.AddProperty("type", "VM"); | 2599 jsobj.AddProperty("type", "VM"); |
2600 jsobj.AddProperty("architectureBits", static_cast<intptr_t>(kBitsPerWord)); | 2600 jsobj.AddProperty("architectureBits", static_cast<intptr_t>(kBitsPerWord)); |
2601 jsobj.AddProperty("targetCPU", CPU::Id()); | 2601 jsobj.AddProperty("targetCPU", CPU::Id()); |
2602 jsobj.AddProperty("hostCPU", HostCPUFeatures::hardware()); | 2602 jsobj.AddProperty("hostCPU", HostCPUFeatures::hardware()); |
2603 jsobj.AddProperty("version", Version::String()); | 2603 jsobj.AddProperty("version", Version::String()); |
2604 // Send pid as a string because it allows us to avoid any issues with | 2604 // Send pid as a string because it allows us to avoid any issues with |
2605 // pids > 53-bits (when consumed by JavaScript). | 2605 // pids > 53-bits (when consumed by JavaScript). |
2606 // TODO(johnmccutchan): Codify how integers are sent across the service. | 2606 // TODO(johnmccutchan): Codify how integers are sent across the service. |
2607 jsobj.AddPropertyF("pid", "%" Pd "", OS::ProcessId()); | 2607 jsobj.AddPropertyF("pid", "%" Pd "", OS::ProcessId()); |
2608 jsobj.AddProperty("_assertsEnabled", isolate->AssertsEnabled()); | 2608 jsobj.AddProperty("_assertsEnabled", isolate->flags().asserts()); |
2609 jsobj.AddProperty("_typeChecksEnabled", isolate->TypeChecksEnabled()); | 2609 jsobj.AddProperty("_typeChecksEnabled", isolate->flags().type_checks()); |
2610 int64_t start_time_millis = (Dart::vm_isolate()->start_time() / | 2610 int64_t start_time_millis = (Dart::vm_isolate()->start_time() / |
2611 kMicrosecondsPerMillisecond); | 2611 kMicrosecondsPerMillisecond); |
2612 jsobj.AddProperty64("startTime", start_time_millis); | 2612 jsobj.AddProperty64("startTime", start_time_millis); |
2613 // Construct the isolate list. | 2613 // Construct the isolate list. |
2614 { | 2614 { |
2615 JSONArray jsarr(&jsobj, "isolates"); | 2615 JSONArray jsarr(&jsobj, "isolates"); |
2616 ServiceIsolateVisitor visitor(&jsarr); | 2616 ServiceIsolateVisitor visitor(&jsarr); |
2617 Isolate::VisitIsolates(&visitor); | 2617 Isolate::VisitIsolates(&visitor); |
2618 } | 2618 } |
2619 return true; | 2619 return true; |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2798 ServiceMethodDescriptor& method = service_methods_[i]; | 2798 ServiceMethodDescriptor& method = service_methods_[i]; |
2799 if (strcmp(method_name, method.name) == 0) { | 2799 if (strcmp(method_name, method.name) == 0) { |
2800 return &method; | 2800 return &method; |
2801 } | 2801 } |
2802 } | 2802 } |
2803 return NULL; | 2803 return NULL; |
2804 } | 2804 } |
2805 | 2805 |
2806 | 2806 |
2807 } // namespace dart | 2807 } // namespace dart |
OLD | NEW |