From 59203c63bb777a3bacec32fb8830fba33540e809 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 07:35:29 +0200 Subject: Adding upstream version 127.0. Signed-off-by: Daniel Baumann --- js/src/vm/EnvironmentObject.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'js/src/vm/EnvironmentObject.cpp') diff --git a/js/src/vm/EnvironmentObject.cpp b/js/src/vm/EnvironmentObject.cpp index 008cfca260..0d5f214f53 100644 --- a/js/src/vm/EnvironmentObject.cpp +++ b/js/src/vm/EnvironmentObject.cpp @@ -2613,18 +2613,20 @@ void DebugEnvironments::checkHashTablesAfterMovingGC() { * This is called at the end of StoreBuffer::mark() to check that our * postbarriers have worked and that no hashtable keys (or values) are left * pointing into the nursery. + * + * |proxiedEnvs| is checked automatically because it is a WeakMap. */ - proxiedEnvs.checkAfterMovingGC(); - for (MissingEnvironmentMap::Range r = missingEnvs.all(); !r.empty(); - r.popFront()) { - CheckGCThingAfterMovingGC(r.front().key().scope()); + CheckTableAfterMovingGC(missingEnvs, [this](const auto& entry) { + CheckGCThingAfterMovingGC(entry.key().scope(), zone()); // Use unbarrieredGet() to prevent triggering read barrier while collecting. - CheckGCThingAfterMovingGC(r.front().value().unbarrieredGet()); - } - for (LiveEnvironmentMap::Range r = liveEnvs.all(); !r.empty(); r.popFront()) { - CheckGCThingAfterMovingGC(r.front().key()); - CheckGCThingAfterMovingGC(r.front().value().scope_.get()); - } + CheckGCThingAfterMovingGC(entry.value().unbarrieredGet(), zone()); + return entry.key(); + }); + CheckTableAfterMovingGC(liveEnvs, [this](const auto& entry) { + CheckGCThingAfterMovingGC(entry.key(), zone()); + CheckGCThingAfterMovingGC(entry.value().scope_.get(), zone()); + return entry.key().unbarrieredGet(); + }); } #endif -- cgit v1.2.3