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/isolate.h" | 5 #include "vm/isolate.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "platform/json.h" | 9 #include "platform/json.h" |
10 #include "lib/mirrors.h" | 10 #include "lib/mirrors.h" |
(...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
927 " \"capacity\": %" Pd "\n" | 927 " \"capacity\": %" Pd "\n" |
928 " },\n" | 928 " },\n" |
929 " \"oldspace\": {\n" | 929 " \"oldspace\": {\n" |
930 " \"used\": %" Pd ",\n" | 930 " \"used\": %" Pd ",\n" |
931 " \"capacity\": %" Pd "\n" | 931 " \"capacity\": %" Pd "\n" |
932 " }\n" | 932 " }\n" |
933 "}"; | 933 "}"; |
934 char buffer[300]; | 934 char buffer[300]; |
935 int64_t address = reinterpret_cast<int64_t>(this); | 935 int64_t address = reinterpret_cast<int64_t>(this); |
936 int n = OS::SNPrint(buffer, 300, format, address, name(), main_port(), | 936 int n = OS::SNPrint(buffer, 300, format, address, name(), main_port(), |
937 (start_time() / 1000L), saved_stack_limit(), | 937 start_time() / 1000L, saved_stack_limit(), |
938 heap()->Used(Heap::kNew) / KB, | 938 RoundWordsToKB(heap()->UsedInWords(Heap::kNew)), |
939 heap()->Capacity(Heap::kNew) / KB, | 939 RoundWordsToKB(heap()->CapacityInWords(Heap::kNew)), |
940 heap()->Used(Heap::kOld) / KB, | 940 RoundWordsToKB(heap()->UsedInWords(Heap::kOld)), |
941 heap()->Capacity(Heap::kOld) / KB); | 941 RoundWordsToKB(heap()->CapacityInWords(Heap::kOld))); |
942 ASSERT(n < 300); | 942 ASSERT(n < 300); |
943 return strdup(buffer); | 943 return strdup(buffer); |
944 } | 944 } |
945 | 945 |
946 | 946 |
947 char* Isolate::GetStatus(const char* request) { | 947 char* Isolate::GetStatus(const char* request) { |
948 char* p = const_cast<char*>(request); | 948 char* p = const_cast<char*>(request); |
949 const char* service_type = "/isolate/"; | 949 const char* service_type = "/isolate/"; |
950 ASSERT(!strncmp(p, service_type, strlen(service_type))); | 950 ASSERT(!strncmp(p, service_type, strlen(service_type))); |
951 p += strlen(service_type); | 951 p += strlen(service_type); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1060 return func.raw(); | 1060 return func.raw(); |
1061 } | 1061 } |
1062 | 1062 |
1063 | 1063 |
1064 void IsolateSpawnState::Cleanup() { | 1064 void IsolateSpawnState::Cleanup() { |
1065 SwitchIsolateScope switch_scope(isolate()); | 1065 SwitchIsolateScope switch_scope(isolate()); |
1066 Dart::ShutdownIsolate(); | 1066 Dart::ShutdownIsolate(); |
1067 } | 1067 } |
1068 | 1068 |
1069 } // namespace dart | 1069 } // namespace dart |
OLD | NEW |