Skip to content

Commit e21e7c2

Browse files
sethbrenithDevtools-frontend LUCI CQ
authored andcommitted
Hide ExternalStringData when possible
With V8's recent change https://crrev.com/c/6235575 , the storage for each external string is now reported in a separate node from the string. This is important for correctness in the case where multiple external strings refer to the same backing storage. However, in the vast majority of cases, the storage has only one owning string, so we can improve the readability of snapshots by subsuming the backing storage size into the string instance. Bug: 41448424 Change-Id: I5f635eae7aa710f583eeb9ba4196d3e513262916 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6234887 Reviewed-by: Simon Zünd <[email protected]> Commit-Queue: Seth Brenith <[email protected]>
1 parent e87f51c commit e21e7c2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3145,7 +3145,7 @@ export class JSHeapSnapshot extends HeapSnapshot {
31453145

31463146
const node = this.createNode(0);
31473147
for (let i = 0; i < nodeCount; ++i) {
3148-
if (node.isHidden() || node.isArray()) {
3148+
if (node.isHidden() || node.isArray() || (node.isNative() && node.rawName() === 'system / ExternalStringData')) {
31493149
owners[i] = kUnvisited;
31503150
} else {
31513151
// The node owns itself.
@@ -3652,6 +3652,10 @@ export class JSHeapSnapshotNode extends HeapSnapshotNode {
36523652
return this.rawType() === this.snapshot.nodeSyntheticType;
36533653
}
36543654

3655+
isNative(): boolean {
3656+
return this.rawType() === this.snapshot.nodeNativeType;
3657+
}
3658+
36553659
override isUserRoot(): boolean {
36563660
return !this.isSynthetic();
36573661
}

0 commit comments

Comments
 (0)