Ejemplo n.º 1
0
    void trace(JSTracer* trc) override {
        CrossCompartmentKey prior = key;
        if (key.debugger)
            TraceManuallyBarrieredEdge(trc, &key.debugger, "CCW debugger");
        if (key.kind == CrossCompartmentKey::ObjectWrapper ||
            key.kind == CrossCompartmentKey::DebuggerObject ||
            key.kind == CrossCompartmentKey::DebuggerEnvironment ||
            key.kind == CrossCompartmentKey::DebuggerSource)
        {
            MOZ_ASSERT(IsInsideNursery(key.wrapped) ||
                       key.wrapped->asTenured().getTraceKind() == JS::TraceKind::Object);
            TraceManuallyBarrieredEdge(trc, reinterpret_cast<JSObject**>(&key.wrapped),
                                       "CCW wrapped object");
        }
        if (key.debugger == prior.debugger && key.wrapped == prior.wrapped)
            return;

        /* Look for the original entry, which might have been removed. */
        WrapperMap::Ptr p = map->lookup(prior);
        if (!p)
            return;

        /* Rekey the entry. */
        map->rekeyAs(prior, key, key);
    }
Ejemplo n.º 2
0
    void trace(JSTracer* trc) override {
        CrossCompartmentKey prior = key;
        key.applyToWrapped(TraceFunctor(trc, "ccw wrapped"));
        key.applyToDebugger(TraceFunctor(trc, "ccw debugger"));
        if (key == prior)
            return;

        /* Look for the original entry, which might have been removed. */
        WrapperMap::Ptr p = map->lookup(prior);
        if (!p)
            return;

        /* Rekey the entry. */
        map->rekeyAs(prior, key, key);
    }
Ejemplo n.º 3
0
    void mark(JSTracer *trc) {
        CrossCompartmentKey prior = key;
        if (key.debugger)
            Mark(trc, &key.debugger, "CCW debugger");
        if (key.kind != CrossCompartmentKey::StringWrapper)
            Mark(trc, reinterpret_cast<JSObject**>(&key.wrapped), "CCW wrapped object");
        if (key.debugger == prior.debugger && key.wrapped == prior.wrapped)
            return;

        /* Look for the original entry, which might have been removed. */
        WrapperMap::Ptr p = map->lookup(prior);
        if (!p)
            return;

        /* Rekey the entry. */
        map->rekeyAs(prior, key, key);
    }