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 1649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1660 } | 1660 } |
1661 if (js->HasOption("gc")) { | 1661 if (js->HasOption("gc")) { |
1662 if (js->OptionIs("gc", "full")) { | 1662 if (js->OptionIs("gc", "full")) { |
1663 should_collect = true; | 1663 should_collect = true; |
1664 } else { | 1664 } else { |
1665 PrintError(js, "Unrecognized gc option '%s'", js->LookupOption("gc")); | 1665 PrintError(js, "Unrecognized gc option '%s'", js->LookupOption("gc")); |
1666 return true; | 1666 return true; |
1667 } | 1667 } |
1668 } | 1668 } |
1669 if (should_reset_accumulator) { | 1669 if (should_reset_accumulator) { |
1670 isolate->timestampLastAllocationProfileAccumulatorReset(); | |
1670 isolate->class_table()->ResetAllocationAccumulators(); | 1671 isolate->class_table()->ResetAllocationAccumulators(); |
1671 } | 1672 } |
1672 if (should_collect) { | 1673 if (should_collect) { |
1674 isolate->timestampLastAllocationProfileGC(); | |
1673 isolate->heap()->CollectAllGarbage(); | 1675 isolate->heap()->CollectAllGarbage(); |
1674 } | 1676 } |
1675 isolate->class_table()->AllocationProfilePrintJSON(js); | 1677 isolate->class_table()->AllocationProfilePrintJSON(js); |
1676 return true; | 1678 return true; |
1677 } | 1679 } |
1678 | 1680 |
1679 | 1681 |
1680 static bool HandleTypeArguments(Isolate* isolate, JSONStream* js) { | 1682 static bool HandleTypeArguments(Isolate* isolate, JSONStream* js) { |
1681 ObjectStore* object_store = isolate->object_store(); | 1683 ObjectStore* object_store = isolate->object_store(); |
1682 const Array& table = Array::Handle(object_store->canonical_type_arguments()); | 1684 const Array& table = Array::Handle(object_store->canonical_type_arguments()); |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1931 JSONArray* jsarr_; | 1933 JSONArray* jsarr_; |
1932 }; | 1934 }; |
1933 | 1935 |
1934 | 1936 |
1935 static bool HandleVM(JSONStream* js) { | 1937 static bool HandleVM(JSONStream* js) { |
1936 JSONObject jsobj(js); | 1938 JSONObject jsobj(js); |
1937 jsobj.AddProperty("type", "VM"); | 1939 jsobj.AddProperty("type", "VM"); |
1938 jsobj.AddProperty("id", "vm"); | 1940 jsobj.AddProperty("id", "vm"); |
1939 jsobj.AddProperty("targetCPU", CPU::Id()); | 1941 jsobj.AddProperty("targetCPU", CPU::Id()); |
1940 jsobj.AddProperty("hostCPU", HostCPUFeatures::hardware()); | 1942 jsobj.AddProperty("hostCPU", HostCPUFeatures::hardware()); |
1943 jsobj.AddPropertyF("date", "%" Pd64 "", OS::GetCurrentTimeMillis()); | |
koda
2014/06/17 21:04:07
It's potentially confusing that 'date' is in milli
| |
1941 jsobj.AddProperty("version", Version::String()); | 1944 jsobj.AddProperty("version", Version::String()); |
1942 jsobj.AddProperty("assertsEnabled", FLAG_enable_asserts); | 1945 jsobj.AddProperty("assertsEnabled", FLAG_enable_asserts); |
1943 jsobj.AddProperty("typeChecksEnabled", FLAG_enable_type_checks); | 1946 jsobj.AddProperty("typeChecksEnabled", FLAG_enable_type_checks); |
1944 int64_t start_time_micros = Dart::vm_isolate()->start_time(); | 1947 int64_t start_time_micros = Dart::vm_isolate()->start_time(); |
1945 int64_t uptime_micros = (OS::GetCurrentTimeMicros() - start_time_micros); | 1948 int64_t uptime_micros = (OS::GetCurrentTimeMicros() - start_time_micros); |
1946 double seconds = (static_cast<double>(uptime_micros) / | 1949 double seconds = (static_cast<double>(uptime_micros) / |
1947 static_cast<double>(kMicrosecondsPerSecond)); | 1950 static_cast<double>(kMicrosecondsPerSecond)); |
1948 jsobj.AddProperty("uptime", seconds); | 1951 jsobj.AddProperty("uptime", seconds); |
1949 | 1952 |
1950 // Construct the isolate list. | 1953 // Construct the isolate list. |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2106 while (current != NULL) { | 2109 while (current != NULL) { |
2107 if (strcmp(name, current->name()) == 0) { | 2110 if (strcmp(name, current->name()) == 0) { |
2108 return current; | 2111 return current; |
2109 } | 2112 } |
2110 current = current->next(); | 2113 current = current->next(); |
2111 } | 2114 } |
2112 return NULL; | 2115 return NULL; |
2113 } | 2116 } |
2114 | 2117 |
2115 } // namespace dart | 2118 } // namespace dart |
OLD | NEW |