Exemple #1
0
void
WatchpointMap::markAll(JSTracer *trc)
{
    for (Map::Range r = map.all(); !r.empty(); r.popFront()) {
        Map::Entry &e = r.front();
        HeapPtrObject tmpObj(e.key.object);
        MarkObject(trc, &tmpObj, "held Watchpoint object");
        JS_ASSERT(tmpObj == e.key.object);

        const HeapId &id = e.key.id;
        JS_ASSERT(JSID_IS_STRING(id) || JSID_IS_INT(id));
        HeapId tmpId(id.get());
        MarkId(trc, &tmpId, "WatchKey::id");
        JS_ASSERT(tmpId.get() == id.get());

        MarkObject(trc, &e.value.closure, "Watchpoint::closure");
    }
}
Exemple #2
0
/* See the comment on RegExpShared lifetime in RegExpObject.h. */
void
RegExpCompartment::sweep(JSRuntime *rt)
{
#ifdef DEBUG
    for (Map::Range r = map_.all(); !r.empty(); r.popFront())
        JS_ASSERT(inUse_.has(r.front().value()));
#endif

    map_.clear();

    for (PendingSet::Enum e(inUse_); !e.empty(); e.popFront()) {
        RegExpShared *shared = e.front();
        if (shared->activeUseCount == 0 && shared->gcNumberWhenUsed < rt->gcStartNumber) {
            js_delete(shared);
            e.removeFront();
        }
    }
}
Exemple #3
0
/* See the comment on RegExpShared lifetime in RegExpObject.h. */
void
RegExpCompartment::sweep(JSRuntime *rt)
{
#ifdef DEBUG
    for (Map::Range r = map_.all(); !r.empty(); r.popFront())
        JS_ASSERT(inUse_.has(r.front().value()));
#endif

    map_.clear();

    for (PendingSet::Enum e(inUse_); !e.empty(); e.popFront()) {
        RegExpShared *shared = e.front();
        if (shared->activeUseCount == 0 && shared->gcNumberWhenUsed < rt->gcStartNumber) {
            js_delete(shared);
            e.removeFront();
        }
    }

    if (matchResultTemplateObject_ &&
        IsObjectAboutToBeFinalized(matchResultTemplateObject_.unsafeGet()))
    {
        matchResultTemplateObject_ = nullptr;
    }
}