From 8f264319ae4e83166c4972d290c0d9bf771b554c Mon Sep 17 00:00:00 2001 From: win7-7 Date: Mon, 5 Jan 2026 06:07:35 +0200 Subject: [PATCH] More fixes this almost compiles.. need cherry pick one more change. More fixes this almost compiles.. need cherry pick one more change. --- js/src/jsgc.cpp | 2 +- js/src/vm/Caches.h | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/js/src/jsgc.cpp b/js/src/jsgc.cpp index aa05542133..7834d9b434 100644 --- a/js/src/jsgc.cpp +++ b/js/src/jsgc.cpp @@ -3647,7 +3647,7 @@ class MOZ_RAII js::gc::AutoRunParallelTask : public GCParallelTask }; void -GCRuntime::purgeRuntimeForMinorGC(AutoLockForExclusiveAccess& lock) +GCRuntime::purgeRuntimeForMinorGC() { // If external strings become nursery allocable, remember to call // zone->externalStringCache().purge() (and delete this assert.) diff --git a/js/src/vm/Caches.h b/js/src/vm/Caches.h index dd5e3666d2..c00e86a561 100644 --- a/js/src/vm/Caches.h +++ b/js/src/vm/Caches.h @@ -93,7 +93,7 @@ struct EvalCacheHashPolicy static bool match(const EvalCacheEntry& entry, const EvalCacheLookup& l); }; -typedef HashSet EvalCache; +typedef GCHashSet EvalCache; struct LazyScriptHashPolicy { @@ -315,6 +315,25 @@ class ContextCaches js::MathCache* maybeGetMathCache() { return mathCache_.get(); } + + void purgeForMinorGC(JSRuntime* rt) { + newObjectCache.clearNurseryObjects(rt); + evalCache.sweep(); + } + + void purgeForCompaction() { + newObjectCache.purge(); + if (evalCache.initialized()) + evalCache.clear(); + } + + void purge() { + purgeForCompaction(); + gsnCache.purge(); + envCoordinateNameCache.purge(); + nativeIterCache.purge(); + uncompressedSourceCache.purge(); + } }; } // namespace js