Bug 727281 - Make JSObject* for Root and Barriered marking indirect; r=billm

This will allow us to move HeapPtr and rooted objects when tracing.
This commit is contained in:
Terrence Cole
2012-02-14 15:19:55 -08:00
parent 3353476ebb
commit d5bba64499
22 changed files with 152 additions and 103 deletions

View File

@@ -386,15 +386,20 @@ js_TraceAtomState(JSTracer *trc)
JSAtomState *state = &rt->atomState;
if (rt->gcKeepAtoms) {
for (AtomSet::Range r = state->atoms.all(); !r.empty(); r.popFront())
MarkStringRoot(trc, r.front().asPtr(), "locked_atom");
for (AtomSet::Range r = state->atoms.all(); !r.empty(); r.popFront()) {
JSAtom *tmp = r.front().asPtr();
MarkStringRoot(trc, &tmp, "locked_atom");
JS_ASSERT(tmp == r.front().asPtr());
}
} else {
for (AtomSet::Range r = state->atoms.all(); !r.empty(); r.popFront()) {
AtomStateEntry entry = r.front();
if (!entry.isTagged())
continue;
MarkStringRoot(trc, entry.asPtr(), "interned_atom");
JSAtom *tmp = entry.asPtr();
MarkStringRoot(trc, &tmp, "interned_atom");
JS_ASSERT(tmp == entry.asPtr());
}
}
}