Skip to content

Commit b86d7de

Browse files
rmacnak-googleCommit Queue
authored andcommitted
[tools] Tweaks to binary_size.
- Group symbols with no path by C++ namespace. - Fix layout in Firefox. - Don't remove paths containing only one symbol. Change-Id: I951e2df0b46919bc40ae0e1db641f7422310e45d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425153 Reviewed-by: Brian Quinlan <[email protected]> Commit-Queue: Ryan Macnak <[email protected]>
1 parent dbf7f40 commit b86d7de

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

runtime/tools/binary_size

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Symbol {
1616
for (var i = 0; i < children.length; i++) {
1717
children[i] = children[i].compressTrivialPaths();
1818
}
19-
if ((type == "path") && (children.length == 1)) {
19+
if ((type == "path") && (children.length == 1) && (children[0].type == "path")) {
2020
return children[0];
2121
}
2222
return this;
@@ -146,6 +146,17 @@ main(List<String> args) {
146146
var vmSize = int.parse(columns[2]);
147147
var fileSize = int.parse(columns[3]);
148148

149+
if (path.startsWith("[")) {
150+
if (path == name) {
151+
path = "";
152+
} else if (name.contains("::")) {
153+
path = "(no path)/" + name.substring(0, name.lastIndexOf("::")).replaceAll("::", "/");
154+
name = name.substring(name.lastIndexOf("::") + 2);
155+
} else {
156+
path = "(no path)";
157+
}
158+
}
159+
149160
path = prettyPath(path);
150161

151162
var s = new Symbol();
@@ -373,8 +384,12 @@ function createTreemapTile(v, width, height, depth) {
373384
}
374385
375386
function showDominatorTree(v) {
376-
// Add the content div to the document first so the browser will calculate
387+
// Add a filler div to the document first so the browser will calculate
377388
// the available width and height.
389+
let fill = document.createElement("div");
390+
fill.style.width = "100%";
391+
fill.style.height = "100%";
392+
setBody(fill);
378393
let w = document.body.offsetWidth;
379394
let h = document.body.offsetHeight;
380395

0 commit comments

Comments
 (0)