| 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 3784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3795 jsobj.AddProperty("targetCPU", CPU::Id()); | 3795 jsobj.AddProperty("targetCPU", CPU::Id()); |
| 3796 jsobj.AddProperty("hostCPU", HostCPUFeatures::hardware()); | 3796 jsobj.AddProperty("hostCPU", HostCPUFeatures::hardware()); |
| 3797 jsobj.AddProperty("version", Version::String()); | 3797 jsobj.AddProperty("version", Version::String()); |
| 3798 jsobj.AddProperty("_profilerMode", FLAG_profile_vm ? "VM" : "Dart"); | 3798 jsobj.AddProperty("_profilerMode", FLAG_profile_vm ? "VM" : "Dart"); |
| 3799 jsobj.AddProperty("_nativeZoneMemoryUsage", | 3799 jsobj.AddProperty("_nativeZoneMemoryUsage", |
| 3800 ApiNativeScope::current_memory_usage()); | 3800 ApiNativeScope::current_memory_usage()); |
| 3801 jsobj.AddProperty64("pid", OS::ProcessId()); | 3801 jsobj.AddProperty64("pid", OS::ProcessId()); |
| 3802 jsobj.AddProperty64("_maxRSS", OS::MaxRSS()); | 3802 jsobj.AddProperty64("_maxRSS", OS::MaxRSS()); |
| 3803 jsobj.AddPropertyTimeMillis( | 3803 jsobj.AddPropertyTimeMillis( |
| 3804 "startTime", OS::GetCurrentTimeMillis() - Dart::UptimeMillis()); | 3804 "startTime", OS::GetCurrentTimeMillis() - Dart::UptimeMillis()); |
| 3805 if (MallocHooks::Initialized()) { | 3805 MallocHooks::PrintToJSONObject(&jsobj); |
| 3806 jsobj.AddProperty("_heapAllocatedMemoryUsage", | |
| 3807 MallocHooks::heap_allocated_memory_in_bytes()); | |
| 3808 jsobj.AddProperty("_heapAllocationCount", MallocHooks::allocation_count()); | |
| 3809 } | |
| 3810 // Construct the isolate list. | 3806 // Construct the isolate list. |
| 3811 { | 3807 { |
| 3812 JSONArray jsarr(&jsobj, "isolates"); | 3808 JSONArray jsarr(&jsobj, "isolates"); |
| 3813 ServiceIsolateVisitor visitor(&jsarr); | 3809 ServiceIsolateVisitor visitor(&jsarr); |
| 3814 Isolate::VisitIsolates(&visitor); | 3810 Isolate::VisitIsolates(&visitor); |
| 3815 } | 3811 } |
| 3816 } | 3812 } |
| 3817 | 3813 |
| 3818 | 3814 |
| 3819 static bool GetVM(Thread* thread, JSONStream* js) { | 3815 static bool GetVM(Thread* thread, JSONStream* js) { |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4135 if (strcmp(method_name, method.name) == 0) { | 4131 if (strcmp(method_name, method.name) == 0) { |
| 4136 return &method; | 4132 return &method; |
| 4137 } | 4133 } |
| 4138 } | 4134 } |
| 4139 return NULL; | 4135 return NULL; |
| 4140 } | 4136 } |
| 4141 | 4137 |
| 4142 #endif // !PRODUCT | 4138 #endif // !PRODUCT |
| 4143 | 4139 |
| 4144 } // namespace dart | 4140 } // namespace dart |
| OLD | NEW |