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; } }
bool WeakMapBase::saveCompartmentWeakMapList(JSCompartment *c, WeakMapVector &vector) { WeakMapBase *m = c->gcWeakMapList; while (m) { if (!vector.append(m)) return false; m = m->next; } return true; }
bool WeakMapBase::saveWeakMapList(JSRuntime *rt, WeakMapVector &vector) { WeakMapBase *m = rt->gcWeakMapList; while (m) { if (!vector.append(m)) return false; m = m->next; } return true; }