| 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 "include/dart_native_api.h" | 8 #include "include/dart_native_api.h" |
| 9 #include "platform/globals.h" | 9 #include "platform/globals.h" |
| 10 | 10 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 #include "vm/unicode.h" | 38 #include "vm/unicode.h" |
| 39 #include "vm/version.h" | 39 #include "vm/version.h" |
| 40 | 40 |
| 41 namespace dart { | 41 namespace dart { |
| 42 | 42 |
| 43 #define Z (T->zone()) | 43 #define Z (T->zone()) |
| 44 | 44 |
| 45 | 45 |
| 46 DECLARE_FLAG(bool, trace_service); | 46 DECLARE_FLAG(bool, trace_service); |
| 47 DECLARE_FLAG(bool, trace_service_pause_events); | 47 DECLARE_FLAG(bool, trace_service_pause_events); |
| 48 DECLARE_FLAG(bool, profile_vm); |
| 48 DEFINE_FLAG(charp, vm_name, "vm", | 49 DEFINE_FLAG(charp, vm_name, "vm", |
| 49 "The default name of this vm as reported by the VM service " | 50 "The default name of this vm as reported by the VM service " |
| 50 "protocol"); | 51 "protocol"); |
| 51 | 52 |
| 52 DEFINE_FLAG(bool, warn_on_pause_with_no_debugger, false, | 53 DEFINE_FLAG(bool, warn_on_pause_with_no_debugger, false, |
| 53 "Print a message when an isolate is paused but there is no " | 54 "Print a message when an isolate is paused but there is no " |
| 54 "debugger attached."); | 55 "debugger attached."); |
| 55 | 56 |
| 56 #ifndef PRODUCT | 57 #ifndef PRODUCT |
| 57 // The name of this of this vm as reported by the VM service protocol. | 58 // The name of this of this vm as reported by the VM service protocol. |
| (...skipping 3577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3635 jsobj.AddProperty("type", (ref ? "@VM" : "VM")); | 3636 jsobj.AddProperty("type", (ref ? "@VM" : "VM")); |
| 3636 jsobj.AddProperty("name", GetVMName()); | 3637 jsobj.AddProperty("name", GetVMName()); |
| 3637 if (ref) { | 3638 if (ref) { |
| 3638 return; | 3639 return; |
| 3639 } | 3640 } |
| 3640 Isolate* vm_isolate = Dart::vm_isolate(); | 3641 Isolate* vm_isolate = Dart::vm_isolate(); |
| 3641 jsobj.AddProperty("architectureBits", static_cast<intptr_t>(kBitsPerWord)); | 3642 jsobj.AddProperty("architectureBits", static_cast<intptr_t>(kBitsPerWord)); |
| 3642 jsobj.AddProperty("targetCPU", CPU::Id()); | 3643 jsobj.AddProperty("targetCPU", CPU::Id()); |
| 3643 jsobj.AddProperty("hostCPU", HostCPUFeatures::hardware()); | 3644 jsobj.AddProperty("hostCPU", HostCPUFeatures::hardware()); |
| 3644 jsobj.AddProperty("version", Version::String()); | 3645 jsobj.AddProperty("version", Version::String()); |
| 3646 jsobj.AddProperty("_profilerMode", FLAG_profile_vm ? "VM" : "Dart"); |
| 3645 jsobj.AddProperty64("pid", OS::ProcessId()); | 3647 jsobj.AddProperty64("pid", OS::ProcessId()); |
| 3646 int64_t start_time_millis = (vm_isolate->start_time() / | 3648 int64_t start_time_millis = (vm_isolate->start_time() / |
| 3647 kMicrosecondsPerMillisecond); | 3649 kMicrosecondsPerMillisecond); |
| 3648 jsobj.AddPropertyTimeMillis("startTime", start_time_millis); | 3650 jsobj.AddPropertyTimeMillis("startTime", start_time_millis); |
| 3649 // Construct the isolate list. | 3651 // Construct the isolate list. |
| 3650 { | 3652 { |
| 3651 JSONArray jsarr(&jsobj, "isolates"); | 3653 JSONArray jsarr(&jsobj, "isolates"); |
| 3652 ServiceIsolateVisitor visitor(&jsarr); | 3654 ServiceIsolateVisitor visitor(&jsarr); |
| 3653 Isolate::VisitIsolates(&visitor); | 3655 Isolate::VisitIsolates(&visitor); |
| 3654 } | 3656 } |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3976 if (strcmp(method_name, method.name) == 0) { | 3978 if (strcmp(method_name, method.name) == 0) { |
| 3977 return &method; | 3979 return &method; |
| 3978 } | 3980 } |
| 3979 } | 3981 } |
| 3980 return NULL; | 3982 return NULL; |
| 3981 } | 3983 } |
| 3982 | 3984 |
| 3983 #endif // !PRODUCT | 3985 #endif // !PRODUCT |
| 3984 | 3986 |
| 3985 } // namespace dart | 3987 } // namespace dart |
| OLD | NEW |