commit 37544fc471d5a62c5e366a44ad7aec57941493ec
parent eef7c9c42d19e23925c4d1292422a677f0ebd80f
Author: Tooru Fujisawa <arai_a@mac.com>
Date: Tue, 2 Dec 2025 01:26:25 +0000
Bug 2002781 - Part 2: Report stencils held by the shared script cache. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D274544
Diffstat:
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/js/loader/LoadedScript.cpp b/js/loader/LoadedScript.cpp
@@ -13,9 +13,10 @@
#include "mozilla/dom/ScriptLoadContext.h" // ScriptLoadContext
#include "jsfriendapi.h"
-#include "js/Modules.h" // JS::{Get,Set}ModulePrivate
-#include "LoadContextBase.h" // LoadContextBase
-#include "nsIChannel.h" // nsIChannel
+#include "js/Modules.h" // JS::{Get,Set}ModulePrivate
+#include "js/experimental/JSStencil.h" // JS::SizeOfStencil
+#include "LoadContextBase.h" // LoadContextBase
+#include "nsIChannel.h" // nsIChannel
namespace JS::loader {
@@ -136,7 +137,10 @@ size_t LoadedScript::SizeOfIncludingThis(
bytes += mSRIAndSerializedStencil.sizeOfExcludingThis(aMallocSizeOf);
- // NOTE: Stencil is reported by SpiderMonkey.
+ if (mStencil) {
+ bytes += JS::SizeOfStencil(mStencil, aMallocSizeOf);
+ }
+
return bytes;
}