Bug 730933 - Make IsAboutToBeFinalized indirect; r=billm

This additionally moves the interface into js::gc:: and renames it to
CheckFooMarked.
This commit is contained in:
Terrence Cole
2012-05-23 10:34:29 -07:00
parent 0e13ab9b13
commit 21763adf0c
16 changed files with 224 additions and 118 deletions

View File

@@ -242,15 +242,16 @@ js::SweepAtomState(JSRuntime *rt)
for (AtomSet::Enum e(state->atoms); !e.empty(); e.popFront()) {
AtomStateEntry entry = e.front();
JSAtom *atom = entry.asPtr();
bool isMarked = IsStringMarked(&atom);
if (entry.isTagged()) {
/* Pinned or interned key cannot be finalized. */
JS_ASSERT(!IsAboutToBeFinalized(entry.asPtr()));
continue;
}
/* Pinned or interned key cannot be finalized. */
JS_ASSERT_IF(entry.isTagged(), isMarked);
if (IsAboutToBeFinalized(entry.asPtr()))
if (!isMarked)
e.removeFront();
else
e.rekeyFront(AtomHasher::Lookup(atom), AtomStateEntry(atom, entry.isTagged()));
}
}