/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// This is a worker which reads offline heap snapshots into memory and performs // heavyweight analyses on them without blocking the main thread. A // HeapAnalysesWorker is owned and communicated with by a HeapAnalysesClient // instance. See HeapAnalysesClient.js.
/** * The set of HeapSnapshot instances this worker has read into memory. Keyed by * snapshot file path.
*/ const snapshots = Object.create(null);
/** * The set of `DominatorTree`s that have been computed, mapped by their id (aka * the index into this array). * * @see /dom/webidl/DominatorTree.webidl
*/ const dominatorTrees = [];
/** * The i^th HeapSnapshot in this array is the snapshot used to generate the i^th * dominator tree in `dominatorTrees` above. This lets us map from a dominator * tree id to the snapshot it came from.
*/ const dominatorTreeSnapshots = [];
const dominatorTree = dominatorTrees[dominatorTreeId]; if (!dominatorTree) { thrownew Error(
`There does not exist a DominatorTree with the id ${dominatorTreeId}`
);
}
if (!snapshots[firstSnapshotFilePath]) { thrownew Error(`No known heap snapshot for'${firstSnapshotFilePath}'`);
}
if (!snapshots[secondSnapshotFilePath]) { thrownew Error(`No known heap snapshot for'${secondSnapshotFilePath}'`);
}
const first = snapshots[firstSnapshotFilePath].takeCensus(censusOptions); const second = snapshots[secondSnapshotFilePath].takeCensus(censusOptions);
let delta = CensusUtils.diff(censusOptions.breakdown, first, second);
let parentMap;
if (!(dominatorTreeId >= 0 && dominatorTreeId < dominatorTrees.length)) { thrownew Error(
`There does not exist a DominatorTree with the id ${dominatorTreeId}`
);
}
if (!(dominatorTreeId >= 0 && dominatorTreeId < dominatorTrees.length)) { thrownew Error(
`There does not exist a DominatorTree with the id ${dominatorTreeId}`
);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.