From d8bbc7858622b6d9c278469aab701ca0b609cddf Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 15 May 2024 05:35:49 +0200 Subject: Merging upstream version 126.0. Signed-off-by: Daniel Baumann --- js/src/gc/AtomMarking.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'js/src/gc/AtomMarking.h') diff --git a/js/src/gc/AtomMarking.h b/js/src/gc/AtomMarking.h index e7e97fb389..e5d8ef8418 100644 --- a/js/src/gc/AtomMarking.h +++ b/js/src/gc/AtomMarking.h @@ -19,6 +19,7 @@ class DenseBitmap; namespace gc { class Arena; +class GCRuntime; // This class manages state used for marking atoms during GCs. // See AtomMarking.cpp for details. @@ -42,19 +43,25 @@ class AtomMarkingRuntime { // Mark an arena as no longer holding things in the atoms zone. void unregisterArena(Arena* arena, const AutoLockGC& lock); + // Update the atom marking bitmaps in all collected zones according to the + // atoms zone mark bits. + void refineZoneBitmapsForCollectedZones(GCRuntime* gc, size_t collectedZones); + + // Set any bits in the chunk mark bitmaps for atoms which are marked in any + // uncollected zone in the runtime. + void markAtomsUsedByUncollectedZones(GCRuntime* gc, size_t uncollectedZones); + + private: // Fill |bitmap| with an atom marking bitmap based on the things that are // currently marked in the chunks used by atoms zone arenas. This returns // false on an allocation failure (but does not report an exception). - bool computeBitmapFromChunkMarkBits(JSRuntime* runtime, DenseBitmap& bitmap); + bool computeBitmapFromChunkMarkBits(GCRuntime* gc, DenseBitmap& bitmap); // Update the atom marking bitmap in |zone| according to another // overapproximation of the reachable atoms in |bitmap|. void refineZoneBitmapForCollectedZone(Zone* zone, const DenseBitmap& bitmap); - // Set any bits in the chunk mark bitmaps for atoms which are marked in any - // uncollected zone in the runtime. - void markAtomsUsedByUncollectedZones(JSRuntime* runtime); - + public: // Mark an atom or id as being newly reachable by the context's zone. template void markAtom(JSContext* cx, T* thing); -- cgit v1.2.3