本文整理汇总了C++中AtomStateEntry::isTagged方法的典型用法代码示例。如果您正苦于以下问题:C++ AtomStateEntry::isTagged方法的具体用法?C++ AtomStateEntry::isTagged怎么用?C++ AtomStateEntry::isTagged使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AtomStateEntry
的用法示例。
在下文中一共展示了AtomStateEntry::isTagged方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MarkString
void
js_TraceAtomState(JSTracer *trc)
{
JSRuntime *rt = trc->context->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++);
MarkString(trc, r.front().asPtr());
}
} else {
for (AtomSet::Range r = state->atoms.all(); !r.empty(); r.popFront()) {
AtomStateEntry entry = r.front();
if (!entry.isTagged())
continue;
JS_SET_TRACING_INDEX(trc, "interned_atom", number++);
MarkString(trc, entry.asPtr());
}
}
}
示例2: fprintf
js_DumpAtoms(JSContext *cx, FILE *fp)
{
JSAtomState *state = &cx->runtime->atomState;
fprintf(fp, "atoms table contents:\n");
unsigned number = 0;
for (AtomSet::Range r = state->atoms.all(); !r.empty(); r.popFront()) {
AtomStateEntry entry = r.front();
fprintf(fp, "%3u ", number++);
JSAtom *key = entry.asPtr();
FileEscapedString(fp, key, '"');
if (entry.isTagged())
fputs(" interned", fp);
putc('\n', fp);
}
putc('\n', fp);
}
示例3:
void
js_SweepAtomState(JSContext *cx)
{
JSAtomState *state = &cx->runtime->atomState;
for (AtomSet::Enum e(state->atoms); !e.empty(); e.popFront()) {
AtomStateEntry entry = e.front();
if (entry.isTagged()) {
/* Pinned or interned key cannot be finalized. */
JS_ASSERT(!IsAboutToBeFinalized(cx, entry.asPtr()));
continue;
}
if (IsAboutToBeFinalized(cx, entry.asPtr()))
e.removeFront();
}
}
示例4: IsStringAboutToBeFinalizedFromAnyThread
void
JSRuntime::sweepAtoms()
{
if (!atoms_)
return;
for (AtomSet::Enum e(*atoms_); !e.empty(); e.popFront()) {
AtomStateEntry entry = e.front();
JSAtom *atom = entry.asPtr();
bool isDying = IsStringAboutToBeFinalizedFromAnyThread(&atom);
/* Pinned or interned key cannot be finalized. */
MOZ_ASSERT_IF(hasContexts() && entry.isTagged(), !isDying);
if (isDying)
e.removeFront();
}
}