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 3844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3855 | 3855 |
3856 static const MethodParameter* get_vm_params[] = { | 3856 static const MethodParameter* get_vm_params[] = { |
3857 NO_ISOLATE_PARAMETER, NULL, | 3857 NO_ISOLATE_PARAMETER, NULL, |
3858 }; | 3858 }; |
3859 | 3859 |
3860 void Service::PrintJSONForEmbedderInformation(JSONObject *jsobj) { | 3860 void Service::PrintJSONForEmbedderInformation(JSONObject *jsobj) { |
3861 if (embedder_information_callback_ != NULL) { | 3861 if (embedder_information_callback_ != NULL) { |
3862 Dart_EmbedderInformation info = { | 3862 Dart_EmbedderInformation info = { |
3863 0, // version | 3863 0, // version |
3864 NULL, // name | 3864 NULL, // name |
3865 0, // max_rss | 3865 -1, // max_rss |
3866 0 // current_rss | 3866 -1 // current_rss |
3867 }; | 3867 }; |
3868 embedder_information_callback_(&info); | 3868 embedder_information_callback_(&info); |
3869 ASSERT(info.version == DART_EMBEDDER_INFORMATION_CURRENT_VERSION); | 3869 ASSERT(info.version == DART_EMBEDDER_INFORMATION_CURRENT_VERSION); |
3870 if (info.name != NULL) { | 3870 if (info.name != NULL) { |
3871 jsobj->AddProperty("_embedder", info.name); | 3871 jsobj->AddProperty("_embedder", info.name); |
3872 } | 3872 } |
3873 if (info.max_rss > 0) { | 3873 if (info.max_rss >= 0) { |
3874 jsobj->AddProperty64("_maxRSS", info.max_rss); | 3874 jsobj->AddProperty64("_maxRSS", info.max_rss); |
3875 } | 3875 } |
3876 if (info.max_rss > 0) { | 3876 if (info.current_rss >= 0) { |
3877 jsobj->AddProperty64("_currentRSS", info.current_rss); | 3877 jsobj->AddProperty64("_currentRSS", info.current_rss); |
3878 } | 3878 } |
3879 } | 3879 } |
3880 } | 3880 } |
3881 | 3881 |
3882 void Service::PrintJSONForVM(JSONStream* js, bool ref) { | 3882 void Service::PrintJSONForVM(JSONStream* js, bool ref) { |
3883 JSONObject jsobj(js); | 3883 JSONObject jsobj(js); |
3884 jsobj.AddProperty("type", (ref ? "@VM" : "VM")); | 3884 jsobj.AddProperty("type", (ref ? "@VM" : "VM")); |
3885 jsobj.AddProperty("name", GetVMName()); | 3885 jsobj.AddProperty("name", GetVMName()); |
3886 if (ref) { | 3886 if (ref) { |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4200 if (strcmp(method_name, method.name) == 0) { | 4200 if (strcmp(method_name, method.name) == 0) { |
4201 return &method; | 4201 return &method; |
4202 } | 4202 } |
4203 } | 4203 } |
4204 return NULL; | 4204 return NULL; |
4205 } | 4205 } |
4206 | 4206 |
4207 #endif // !PRODUCT | 4207 #endif // !PRODUCT |
4208 | 4208 |
4209 } // namespace dart | 4209 } // namespace dart |
OLD | NEW |