js::Class op are often all null. And when they're not all null, they're often
duplicated among classes. By pulling them out into their own struct, and using a
(possibly null) pointer in js::Class, we can save 114 KiB per process on
64-bit, and half that on 32-bit.
* * *
imported patch separate-ClassOps-2
--HG--
extra : rebase_source : bd751bf247e9491c1966a123dbeffa573657dfb1
This adds the INDIVIDUALS view state to the memory panel, renames "dominator
tree display" to "label display", and adds a view for listing the individual
nodes in a census group and inspecting each nodes' retaining paths.
--HG--
rename : devtools/client/memory/actions/dominator-tree-display.js => devtools/client/memory/actions/label-display.js
rename : devtools/client/memory/reducers/dominator-tree-display.js => devtools/client/memory/reducers/label-display.js
This commit adds the `getCensusIndividuals` utility for getting the individual
node IDs that match the census leaves specified by the given indices in a
pre-order depth-first traversal of a census report generated with the given
breakdown.
MozReview-Commit-ID: A4IRcP82iCC
--HG--
extra : histedit_source : e48cc59b522ce82f649f077b4686cea4715980f1
This commit gives every `CensusTreeNode` instance a `reportLeafIndex` member
that is an index into a pre-order traversal of the census report from which it
was generated. This can be used to get the leaf in the census report
corresponding to a given `CensusTreeNode` instance.
There can be multiple compartments within the same zone, only one of which is a
debuggee. In this scenario, CCWs from other compartments into the debuggee
compartment should be traced and treated as roots. Therefore, dealing with CCWs
at the JS::Zone level is incorrect, and this patch changes the granularity level
to JSCompartments. If you look at the callers and uses of the function, it makes
much more sense now.
Additionally, it renames `JS_TraceIncomingCCWs` to `JS::TraceIncomingCCWs`.
--HG--
rename : devtools/shared/heapsnapshot/tests/gtest/DoesCrossZoneBoundaries.cpp => devtools/shared/heapsnapshot/tests/gtest/DoesCrossCompartmentBoundaries.cpp
rename : devtools/shared/heapsnapshot/tests/gtest/DoesntCrossZoneBoundaries.cpp => devtools/shared/heapsnapshot/tests/gtest/DoesntCrossCompartmentBoundaries.cpp
This commit introduces `{ by: "bucket" }` breakdown type. Similar to `by:
"count"`, this breakdown type is a leaf and doesn't further categorize or filter
nodes that it counts. Instead, it accumulates them in a bucket and reports them
as a array of node IDs.
MozReview-Commit-ID: EeyWlrj9ujf
This commit adds the `computeShortestPaths` method to the `HeapSnapshot` webidl
interface. It implements this new method on the
`mozilla::devtools::HeapSnapshot` class.
--HG--
extra : rebase_source : 1772547b7093afd35918602b15cc52b8e07fc646
When filtering, we were merging total counts and total bytes as we added
matching paths from the unfiltered tree into the new, filtered tree. This was
incorrect, and caused us to double, triple, ... count the totals.
--HG--
extra : rebase_source : 6df8ff346c938e728b912901e01671ba2ad0cc9d
This makes attempts to use the HeapAnalysesClient after the worker has already
been destroyed into an earlier, less quiet error so we can catch more of them
and catch them sooner.
The condition checked when reporting whether there were `moreChildrenAvailable`
when constructing the initial DominatorTreeNode tree from a DominatorTree was
backwards. This commit fixes the condition and adds a test that fails without
the condition fix.
This adds a new test for dominator trees computed from heap snapshots, to make
sure that a node's retained size matches the following:
retainedSize(node) = shallowSize(node) + sum(retainedSize(c) for c in children(node))
This test did not find the bug described in bug 1241221, but seems like a
valuable test to have anyways.
These two tests have been intermittently failing on WinXP because the
`Date.now()` timers only have a granularity of +/- 15 milliseconds on that
platform. This commit ensures that we have a range of at least 30 milliseconds
before and after taking the snapshot to ensure that the snapshot's timestamp
will fit within the range.
This commit adds the `DominatorTreeNode.insert` method to insert new
DominatorTreeNode children that have just been loaded from the
HeapAnalysesWorker into an existing partially complete DominatorTreeNode
tree. This is done in a persistent and immutable fashion so that we can use
=== to differentiate different generations of `DominatorTreeNode` trees but
still share the vast majority of the underlying structure.
As infrastructure for the insertion, HeapAnalysesWorker's
`getImmediatelyDominated` response also returns the path from the root to the
node whose immediately dominated children are being fetched. This makes it much
easier to know where to insert the newly loaded children.
This commit implements the HeapSnapshot.describeNode method which allows chrome
JS code to request a description of a given node as specified by our existing
"breakdown" language. This description can be used to generate a human-readable
label for the node.
This commit defines `DominatorTreeNode`, a JS class representing a node in a
heap snapshot's dominator tree. Three heap analysis client/worker
request/responses request and create these `DominatorTreeNode`s. Unlike
censuses, dominator trees are too big to practically mirror in memory as JS
object structures. Instead, we have one request to get a partial/shallow
representation of the tree starting from the root, and another to get subsequent
children and siblings in the tree. This allows for incremental, lazy, and
bounded mirroring of the dominator tree as `DominatorTreeNode`s.
This commit adds the `getImmediateDominator` method to `DominatorTree` which
returns the id of the immediate dominator of the node associated with the given
id. This enables walking the dominator tree from leaves up parents all the way
to the root of the tree.