Пример #1
0
void
js::Nursery::freeHugeSlots(JSRuntime *rt)
{
    for (HugeSlotsSet::Range r = hugeSlots.all(); !r.empty(); r.popFront())
        rt->defaultFreeOp()->free_(r.front());
    hugeSlots.clear();
}
Пример #2
0
void
js::Nursery::sweep(JSRuntime *rt)
{
    /* Free malloced pointers owned by freed things in the nursery. */
    for (HugeSlotsSet::Range r = hugeSlots.all(); !r.empty(); r.popFront())
        rt->defaultFreeOp()->free_(r.front());
    hugeSlots.clear();

#ifdef JS_GC_ZEAL
    /* Poison the nursery contents so touching a freed object will crash. */
    JS_POISON((void *)start(), SweptNursery, NurserySize - sizeof(JSRuntime *));
    for (int i = 0; i < NumNurseryChunks; ++i)
        chunk(i).trailer.runtime = runtime();

    if (rt->gcZeal_ == ZealGenerationalGCValue) {
        /* Undo any grow or shrink the collection may have done. */
        numActiveChunks_ = NumNurseryChunks;

        /* Only reset the alloc point when we are close to the end. */
        if (currentChunk_ + 1 == NumNurseryChunks)
            setCurrentChunk(0);

        /* Set current start position for isEmpty checks. */
        currentStart_ = position();

        return;
    }
#endif

    setCurrentChunk(0);
}
Пример #3
0
void
ForkJoinNursery::sweepHugeSlots()
{
    for (HugeSlotsSet::Range r = hugeSlots[hugeSlotsFrom].all(); !r.empty(); r.popFront())
        js_free(r.front());
    hugeSlots[hugeSlotsFrom].clear();
}
Пример #4
0
void
js::Nursery::freeHugeSlots()
{
    FreeOp *fop = runtime()->defaultFreeOp();
    for (HugeSlotsSet::Range r = hugeSlots.all(); !r.empty(); r.popFront())
        fop->free_(r.front());
    hugeSlots.clear();
}
Пример #5
0
void
js::Nursery::sweep(FreeOp *fop)
{
    for (HugeSlotsSet::Range r = hugeSlots.all(); !r.empty(); r.popFront())
        fop->free_(r.front());
    hugeSlots.clear();

    JS_POISON((void *)start(), SweptNursery, NurserySize - sizeof(JSRuntime *));

    position_ = start();
}
Пример #6
0
void
js::Nursery::sweep(FreeOp *fop)
{
    for (HugeSlotsSet::Range r = hugeSlots.all(); !r.empty(); r.popFront())
        fop->free_(r.front());
    hugeSlots.clear();

#ifdef DEBUG
    JS_POISON((void *)start(), SweptNursery, NurserySize - sizeof(JSRuntime *));
    for (int i = 0; i < NumNurseryChunks; ++i)
        chunk(i).runtime = runtime();
#endif

    setCurrentChunk(0);
}