More fixes this almost compiles.. need cherry pick one more change.

More fixes this almost compiles.. need cherry pick one more change.
This commit is contained in:
win7-7 2026-01-05 06:07:35 +02:00 committed by wuggy
commit 8f264319ae
2 changed files with 21 additions and 2 deletions

View file

@ -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.)

View file

@ -93,7 +93,7 @@ struct EvalCacheHashPolicy
static bool match(const EvalCacheEntry& entry, const EvalCacheLookup& l);
};
typedef HashSet<EvalCacheEntry, EvalCacheHashPolicy, SystemAllocPolicy> EvalCache;
typedef GCHashSet<EvalCacheEntry, EvalCacheHashPolicy, SystemAllocPolicy> 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