summaryrefslogtreecommitdiffstats
path: root/js/src/vm/EnvironmentObject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/vm/EnvironmentObject.cpp')
-rw-r--r--js/src/vm/EnvironmentObject.cpp22
1 files changed, 12 insertions, 10 deletions
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