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