summaryrefslogtreecommitdiffstats
path: root/devtools/shared/heapsnapshot
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
commit40a355a42d4a9444dc753c04c6608dade2f06a23 (patch)
tree871fc667d2de662f171103ce5ec067014ef85e61 /devtools/shared/heapsnapshot
parentAdding upstream version 124.0.1. (diff)
downloadfirefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz
firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/shared/heapsnapshot')
-rw-r--r--devtools/shared/heapsnapshot/CensusUtils.js16
-rw-r--r--devtools/shared/heapsnapshot/DominatorTreeNode.js6
-rw-r--r--devtools/shared/heapsnapshot/HeapSnapshot.cpp5
-rw-r--r--devtools/shared/heapsnapshot/census-tree-node.js4
-rw-r--r--devtools/shared/heapsnapshot/tests/xpcshell/Census.sys.mjs1
-rw-r--r--devtools/shared/heapsnapshot/tests/xpcshell/dominator-tree-worker.js2
-rw-r--r--devtools/shared/heapsnapshot/tests/xpcshell/heap-snapshot-worker.js2
7 files changed, 18 insertions, 18 deletions
diff --git a/devtools/shared/heapsnapshot/CensusUtils.js b/devtools/shared/heapsnapshot/CensusUtils.js
index 3af68d3b57..e96d878873 100644
--- a/devtools/shared/heapsnapshot/CensusUtils.js
+++ b/devtools/shared/heapsnapshot/CensusUtils.js
@@ -29,7 +29,7 @@ exports.Visitor = Visitor;
* The edge leading to this sub-report. The edge is null if (but not iff!
* eg, null allocation stack edges) we are entering the root report.
*/
-Visitor.prototype.enter = function (breakdown, report, edge) {};
+Visitor.prototype.enter = function () {};
/**
* The `exit` method is called when traversal of a sub-report has finished.
@@ -44,7 +44,7 @@ Visitor.prototype.enter = function (breakdown, report, edge) {};
* The edge leading to this sub-report. The edge is null if (but not iff!
* eg, null allocation stack edges) we are entering the root report.
*/
-Visitor.prototype.exit = function (breakdown, report, edge) {};
+Visitor.prototype.exit = function () {};
/**
* The `count` method is called when leaf nodes (reports whose breakdown is
@@ -60,17 +60,17 @@ Visitor.prototype.exit = function (breakdown, report, edge) {};
* The edge leading to this count report. The edge is null if we are
* entering the root report.
*/
-Visitor.prototype.count = function (breakdown, report, edge) {};
+Visitor.prototype.count = function () {};
/** * getReportEdges *********************************************************/
const EDGES = Object.create(null);
-EDGES.count = function (breakdown, report) {
+EDGES.count = function () {
return [];
};
-EDGES.bucket = function (breakdown, report) {
+EDGES.bucket = function () {
return [];
};
@@ -277,7 +277,7 @@ DiffVisitor.prototype.enter = function (breakdown, report, edge) {
/**
* @overrides Visitor.prototype.exit
*/
-DiffVisitor.prototype.exit = function (breakdown, report, edge) {
+DiffVisitor.prototype.exit = function (breakdown) {
// Find all the edges in the other census report that were not traversed and
// add them to the results directly.
const other = this._otherCensusStack[this._otherCensusStack.length - 1];
@@ -300,7 +300,7 @@ DiffVisitor.prototype.exit = function (breakdown, report, edge) {
/**
* @overrides Visitor.prototype.count
*/
-DiffVisitor.prototype.count = function (breakdown, report, edge) {
+DiffVisitor.prototype.count = function (breakdown, report) {
const other = this._otherCensusStack[this._otherCensusStack.length - 1];
const results = this._resultsStack[this._resultsStack.length - 1];
@@ -447,7 +447,7 @@ GetLeavesVisitor.prototype = Object.create(Visitor.prototype);
/**
* @overrides Visitor.prototype.enter
*/
-GetLeavesVisitor.prototype.enter = function (breakdown, report, edge) {
+GetLeavesVisitor.prototype.enter = function (breakdown, report) {
this._index++;
if (this._targetIndices.has(this._index)) {
this._leaves.push(report);
diff --git a/devtools/shared/heapsnapshot/DominatorTreeNode.js b/devtools/shared/heapsnapshot/DominatorTreeNode.js
index 9fe5cf1032..a42670bc2d 100644
--- a/devtools/shared/heapsnapshot/DominatorTreeNode.js
+++ b/devtools/shared/heapsnapshot/DominatorTreeNode.js
@@ -127,11 +127,7 @@ LabelAndShallowSizeVisitor.prototype.exit = function (breakdown, report, edge) {
/**
* @overrides Visitor.prototype.count
*/
-LabelAndShallowSizeVisitor.prototype.count = function (
- breakdown,
- report,
- edge
-) {
+LabelAndShallowSizeVisitor.prototype.count = function (breakdown, report) {
if (report.count === 0) {
return;
}
diff --git a/devtools/shared/heapsnapshot/HeapSnapshot.cpp b/devtools/shared/heapsnapshot/HeapSnapshot.cpp
index ce0eec2d5c..0869f255a8 100644
--- a/devtools/shared/heapsnapshot/HeapSnapshot.cpp
+++ b/devtools/shared/heapsnapshot/HeapSnapshot.cpp
@@ -36,6 +36,7 @@
#include "jsapi.h"
#include "jsfriendapi.h"
+#include "js/GCVector.h"
#include "js/MapAndSet.h"
#include "js/Object.h" // JS::GetCompartment
#include "nsComponentManagerUtils.h" // do_CreateInstance
@@ -482,7 +483,9 @@ void HeapSnapshot::DescribeNode(JSContext* cx, JS::Handle<JSObject*> breakdown,
ErrorResult& rv) {
MOZ_ASSERT(breakdown);
JS::Rooted<JS::Value> breakdownVal(cx, JS::ObjectValue(*breakdown));
- JS::ubi::CountTypePtr rootType = JS::ubi::ParseBreakdown(cx, breakdownVal);
+ JS::Rooted<JS::GCVector<JSLinearString*>> seen(cx, cx);
+ JS::ubi::CountTypePtr rootType =
+ JS::ubi::ParseBreakdown(cx, breakdownVal, &seen);
if (NS_WARN_IF(!rootType)) {
rv.Throw(NS_ERROR_UNEXPECTED);
return;
diff --git a/devtools/shared/heapsnapshot/census-tree-node.js b/devtools/shared/heapsnapshot/census-tree-node.js
index 82f5929370..73dbe391ad 100644
--- a/devtools/shared/heapsnapshot/census-tree-node.js
+++ b/devtools/shared/heapsnapshot/census-tree-node.js
@@ -332,7 +332,7 @@ function isNonEmpty(node) {
*
* @overrides Visitor.prototype.exit
*/
-CensusTreeNodeVisitor.prototype.exit = function (breakdown, report, edge) {
+CensusTreeNodeVisitor.prototype.exit = function () {
// Ensure all children are sorted and have their counts/bytes aggregated. We
// only need to consider cache children here, because other children
// correspond to other sub-reports and we already fixed them up in an earlier
@@ -370,7 +370,7 @@ CensusTreeNodeVisitor.prototype.exit = function (breakdown, report, edge) {
/**
* @overrides Visitor.prototype.count
*/
-CensusTreeNodeVisitor.prototype.count = function (breakdown, report, edge) {
+CensusTreeNodeVisitor.prototype.count = function (breakdown, report) {
const node = this._nodeStack[this._nodeStack.length - 1];
node.reportLeafIndex = this._index;
diff --git a/devtools/shared/heapsnapshot/tests/xpcshell/Census.sys.mjs b/devtools/shared/heapsnapshot/tests/xpcshell/Census.sys.mjs
index 0e86f8b055..93f35a83a3 100644
--- a/devtools/shared/heapsnapshot/tests/xpcshell/Census.sys.mjs
+++ b/devtools/shared/heapsnapshot/tests/xpcshell/Census.sys.mjs
@@ -148,6 +148,7 @@ function ok(val) {
throw new Error("Census mismatch: expected truthy, got " + val);
}
}
+/* eslint-disable mozilla/no-comparison-or-assignment-inside-ok */
// Return a walker that checks that the subject census has at least as many
// items of each category as |basis|.
diff --git a/devtools/shared/heapsnapshot/tests/xpcshell/dominator-tree-worker.js b/devtools/shared/heapsnapshot/tests/xpcshell/dominator-tree-worker.js
index c636226101..1d69c66420 100644
--- a/devtools/shared/heapsnapshot/tests/xpcshell/dominator-tree-worker.js
+++ b/devtools/shared/heapsnapshot/tests/xpcshell/dominator-tree-worker.js
@@ -7,7 +7,7 @@
console.log("Initializing worker.");
-self.onmessage = e => {
+self.onmessage = () => {
console.log("Starting test.");
try {
const path = ChromeUtils.saveHeapSnapshot({ runtime: true });
diff --git a/devtools/shared/heapsnapshot/tests/xpcshell/heap-snapshot-worker.js b/devtools/shared/heapsnapshot/tests/xpcshell/heap-snapshot-worker.js
index a79f442193..dc70046562 100644
--- a/devtools/shared/heapsnapshot/tests/xpcshell/heap-snapshot-worker.js
+++ b/devtools/shared/heapsnapshot/tests/xpcshell/heap-snapshot-worker.js
@@ -7,7 +7,7 @@
console.log("Initializing worker.");
-self.onmessage = ex => {
+self.onmessage = () => {
console.log("Starting test.");
try {
ok(ChromeUtils, "Should have access to ChromeUtils in a worker.");