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.

--HG--
extra : rebase_source : b4448f7fde8990a727bf2893e53688690e170535
This commit is contained in:
Terrence Cole 2012-01-24 15:21:44 -08:00
parent 420e738e86
commit 9f235d9fdf
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");
}
}
}

View File

@ -1447,7 +1447,7 @@ JSFunction::trace(JSTracer *trc)
}
if (atom)
MarkAtom(trc, atom, "atom");
MarkStringUnbarriered(trc, atom, "atom");
if (isInterpreted()) {
if (script())

View File

@ -162,20 +162,6 @@ MarkString(JSTracer *trc, const MarkablePtr<JSString> &str, const char *name)
MarkStringUnbarriered(trc, str.value, name);
}
void
MarkAtom(JSTracer *trc, JSAtom *atom)
{
JS_ASSERT(trc);
JS_ASSERT(atom);
Mark(trc, atom);
}
void
MarkAtom(JSTracer *trc, JSAtom *atom, const char *name)
{
MarkStringUnbarriered(trc, atom, name);
}
void
MarkObjectUnbarriered(JSTracer *trc, JSObject *obj, const char *name)
{

View File

@ -51,12 +51,6 @@
namespace js {
namespace gc {
void
MarkAtom(JSTracer *trc, JSAtom *str);
void
MarkAtom(JSTracer *trc, JSAtom *str, const char *name);
void
MarkObjectUnbarriered(JSTracer *trc, JSObject *obj, const char *name);