1
0
mirror of https://github.com/dart-lang/sdk synced 2024-07-01 07:14:29 +00:00

[dart2wasm] Skip synthetic mixin class names in type name list

Reduces optimized binary size (with names section) of devtools from
10,322,431 to 10,153,197 bytes (-1.6%).

Change-Id: Ife9f803846a054cfbe3910008dc62d51d7a2c7bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340564
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
This commit is contained in:
Ömer Sinan Ağacan 2023-12-09 09:44:44 +00:00 committed by Commit Queue
parent 6b42951a94
commit 2f1506822c

View File

@ -209,8 +209,12 @@ class Types {
// class ID. If we ever change that logic, we will need to change this code.
List<String> typeNames = [];
for (ClassInfo classInfo in translator.classes) {
String className = classInfo.cls?.name ?? '';
typeNames.add(className);
Class? cls = classInfo.cls;
if (cls == null || cls.isAnonymousMixin) {
typeNames.add("");
} else {
typeNames.add(cls.name);
}
}
return typeNames;
}