Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1002)

Unified Diff: runtime/vm/service.cc

Issue 3003903002: Hide internal classes from Memory Profile (Closed)
Patch Set: Add documentation Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/observatory/tests/observatory_ui/mocks/repositories/allocation_profile.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/service.cc
diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc
index fe24ad50bccec872c066d1292279f343b1873a33..c929b26ba78164cb15a2d7928294c9192ac5d266 100644
--- a/runtime/vm/service.cc
+++ b/runtime/vm/service.cc
@@ -4071,6 +4071,67 @@ static bool SetTraceClassAllocation(Thread* thread, JSONStream* js) {
return true;
}
+static const MethodParameter* get_default_classes_aliases_params[] = {
+ NO_ISOLATE_PARAMETER, NULL,
+};
+
+static bool GetDefaultClassesAliases(Thread* thread, JSONStream* js) {
+ JSONObject jsobj(js);
+ jsobj.AddProperty("type", "ClassesAliasesMap");
+
+ JSONObject map(&jsobj, "map");
+
+#define DEFINE_ADD_VALUE_F(id) internals.AddValueF("classes/%d", id);
+#define DEFINE_ADD_VALUE_F_CID(clazz) DEFINE_ADD_VALUE_F(k##clazz##Cid)
+ {
+ JSONArray internals(&map, "<VM Internals>");
+ for (int32_t id = kClassCid; id <= kMixinAppTypeCid; ++id) {
rmacnak 2017/08/28 22:51:08 intptr_t cid = kClassCid; cid < kInstanceCid; ++ci
+ DEFINE_ADD_VALUE_F(id);
+ }
+ }
rmacnak 2017/08/28 22:51:08 AbstractType, Type, TypeRef, TypeParameter, Bounde
cbernaschina 2017/08/28 23:19:27 Done.
+ {
+ JSONArray internals(&map, "Closure");
+ DEFINE_ADD_VALUE_F_CID(Closure);
rmacnak 2017/08/28 22:51:08 Maybe alias Context to Closure to blame context si
cbernaschina 2017/08/28 23:19:27 Done.
+ }
+ {
+ JSONArray internals(&map, "Int");
+ for (int32_t id = kIntegerCid; id <= kBigintCid; ++id) {
rmacnak 2017/08/28 22:51:08 intptr_t
cbernaschina 2017/08/28 23:19:27 Done.
+ DEFINE_ADD_VALUE_F(id);
+ }
+ }
+ {
+ JSONArray internals(&map, "Double");
+ DEFINE_ADD_VALUE_F_CID(Double);
+ }
+ {
+ JSONArray internals(&map, "String");
+ CLASS_LIST_STRINGS(DEFINE_ADD_VALUE_F_CID)
+ }
+ {
+ JSONArray internals(&map, "List");
+ CLASS_LIST_ARRAYS(DEFINE_ADD_VALUE_F_CID)
+ DEFINE_ADD_VALUE_F_CID(GrowableObjectArray)
+ DEFINE_ADD_VALUE_F_CID(ByteBuffer)
+ }
+ {
+ JSONArray internals(&map, "Map");
+ DEFINE_ADD_VALUE_F_CID(LinkedHashMap)
+ }
+#define DEFINE_ADD_MAP_KEY(clazz) \
+ { \
+ JSONArray internals(&map, #clazz); \
+ DEFINE_ADD_VALUE_F_CID(TypedData##clazz) \
+ DEFINE_ADD_VALUE_F_CID(TypedData##clazz) \
+ DEFINE_ADD_VALUE_F_CID(ExternalTypedData##clazz) \
+ }
+ CLASS_LIST_TYPED_DATA(DEFINE_ADD_MAP_KEY)
+#undef DEFINE_ADD_MAP_KEY
+#undef DEFINE_ADD_VALUE_F_CID
+#undef DEFINE_ADD_VALUE_F
+
+ return true;
+}
+
// clang-format off
static const ServiceMethodDescriptor service_methods_[] = {
{ "_dumpIdZone", DumpIdZone, NULL },
@@ -4190,6 +4251,8 @@ static const ServiceMethodDescriptor service_methods_[] = {
set_vm_timeline_flags_params },
{ "_collectAllGarbage", CollectAllGarbage,
collect_all_garbage_params },
+ { "_getDefaultClassesAliases", GetDefaultClassesAliases,
+ get_default_classes_aliases_params },
};
// clang-format on
« no previous file with comments | « runtime/observatory/tests/observatory_ui/mocks/repositories/allocation_profile.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698