void WeakMapBase::restoreCompartmentWeakMapLists(WeakMapVector &vector) { for (WeakMapBase **p = vector.begin(); p != vector.end(); p++) { WeakMapBase *m = *p; JS_ASSERT(m->next == WeakMapNotInList); JSCompartment *c = m->compartment; m->next = c->gcWeakMapList; c->gcWeakMapList = m; } }
void WeakMapBase::restoreWeakMapList(JSRuntime *rt, WeakMapVector &vector) { JS_ASSERT(!rt->gcWeakMapList); for (WeakMapBase **p = vector.begin(); p != vector.end(); p++) { WeakMapBase *m = *p; JS_ASSERT(m->next == WeakMapNotInList); m->next = rt->gcWeakMapList; rt->gcWeakMapList = m; } }