Beispiel #1
0
 explicit Lookup(SavedFrame& savedFrame)
   : source(savedFrame.getSource()),
     line(savedFrame.getLine()),
     column(savedFrame.getColumn()),
     functionDisplayName(savedFrame.getFunctionDisplayName()),
     asyncCause(savedFrame.getAsyncCause()),
     parent(savedFrame.getParent()),
     principals(savedFrame.getPrincipals()),
     framePtr(Nothing()),
     pc(nullptr),
     activation(nullptr)
 {
     MOZ_ASSERT(source);
 }
Beispiel #2
0
void
SavedStacks::sweep(JSRuntime *rt)
{
    if (frames.initialized()) {
        for (SavedFrame::Set::Enum e(frames); !e.empty(); e.popFront()) {
            JSObject *obj = e.front().unbarrieredGet();
            JSObject *temp = obj;

            if (IsObjectAboutToBeFinalizedFromAnyThread(&obj)) {
                e.removeFront();
            } else {
                SavedFrame *frame = &obj->as<SavedFrame>();
                bool parentMoved = frame->parentMoved();

                if (parentMoved) {
                    frame->updatePrivateParent();
                }

                if (obj != temp || parentMoved) {
                    e.rekeyFront(SavedFrame::Lookup(frame->getSource(),
                                                    frame->getLine(),
                                                    frame->getColumn(),
                                                    frame->getFunctionDisplayName(),
                                                    frame->getParent(),
                                                    frame->getPrincipals()),
                                 ReadBarriered<SavedFrame *>(frame));
                }
            }
        }
    }

    sweepPCLocationMap();

    if (savedFrameProto.unbarrieredGet() &&
        IsObjectAboutToBeFinalizedFromAnyThread(savedFrameProto.unsafeGet()))
    {
        savedFrameProto.set(nullptr);
    }
}
Beispiel #3
0
void
SavedStacks::sweep(JSRuntime *rt)
{
    if (frames.initialized()) {
        for (SavedFrame::Set::Enum e(frames); !e.empty(); e.popFront()) {
            JSObject *obj = static_cast<JSObject *>(e.front());
            JSObject *temp = obj;

            if (IsObjectAboutToBeFinalized(&obj)) {
                e.removeFront();
            } else {
                SavedFrame *frame = &obj->as<SavedFrame>();
                bool parentMoved = frame->parentMoved();

                if (parentMoved) {
                    frame->updatePrivateParent();
                }

                if (obj != temp || parentMoved) {
                    Rooted<SavedFrame*> parent(rt, frame->getParent());
                    e.rekeyFront(SavedFrame::Lookup(frame->getSource(),
                                                    frame->getLine(),
                                                    frame->getColumn(),
                                                    frame->getFunctionDisplayName(),
                                                    parent,
                                                    frame->getPrincipals()),
                                 frame);
                }
            }
        }
    }

    if (savedFrameProto && IsObjectAboutToBeFinalized(&savedFrameProto)) {
        savedFrameProto = nullptr;
    }
}