Backout ad1ee5f59a6e (bug 817343) for orange

This commit is contained in:
Bill McCloskey
2012-12-03 14:01:05 -08:00
parent ce38cbff01
commit bd6887ac1e
3 changed files with 69 additions and 61 deletions

View File

@@ -76,6 +76,30 @@ WeakMapBase::resetCompartmentWeakMapList(JSCompartment *c)
}
}
bool
WeakMapBase::saveCompartmentWeakMapList(JSCompartment *c, WeakMapVector &vector)
{
WeakMapBase *m = c->gcWeakMapList;
while (m) {
if (!vector.append(m))
return false;
m = m->next;
}
return true;
}
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::removeWeakMapFromList(WeakMapBase *weakmap)
{