Bug 720840 - Call MarkStringUnbarriered directly; r=billm

We have a special marker function for handling the Atom list because we need to
call JS_SET_TRACING_INDEX externally to avoid clobbering the index.  However,
nobody cares about the index here and if they do, they can add custom debug
code.  It is better at this point to have a consistent and correct interface,
thus we remove the specialized atomized string marking in favor of the existing
markers.  Additionally, this is only used during root marking so we can switch
to using MarkRoot for the extra assertions.
This commit is contained in:
Terrence Cole
2012-01-24 15:21:44 -08:00
parent b99fccf404
commit 188f53b520
4 changed files with 3 additions and 29 deletions

View File

@@ -385,14 +385,9 @@ js_TraceAtomState(JSTracer *trc)
JSRuntime *rt = trc->runtime;
JSAtomState *state = &rt->atomState;
#ifdef DEBUG
size_t number = 0;
#endif
if (rt->gcKeepAtoms) {
for (AtomSet::Range r = state->atoms.all(); !r.empty(); r.popFront()) {
JS_SET_TRACING_INDEX(trc, "locked_atom", number++);
MarkAtom(trc, r.front().asPtr());
MarkRoot(trc, r.front().asPtr(), "locked_atom");
}
} else {
for (AtomSet::Range r = state->atoms.all(); !r.empty(); r.popFront()) {
@@ -400,8 +395,7 @@ js_TraceAtomState(JSTracer *trc)
if (!entry.isTagged())
continue;
JS_SET_TRACING_INDEX(trc, "interned_atom", number++);
MarkAtom(trc, entry.asPtr());
MarkRoot(trc, entry.asPtr(), "interned_atom");
}
}
}