Ejemplo n.º 1
0
void
nsXPCWrappedJS::TraceJS(JSTracer* trc)
{
    NS_ASSERTION(mRefCnt >= 2 && IsValid(), "must be strongly referenced");
    JS_SET_TRACING_DETAILS(trc, PrintTraceName, this, 0);
    JS_CallTracer(trc, GetJSObjectPreserveColor(), JSTRACE_OBJECT);
}
Ejemplo n.º 2
0
void XPCTraceableVariant::TraceJS(JSTracer* trc)
{
    jsval val = GetJSValPreserveColor();

    NS_ASSERTION(JSVAL_IS_TRACEABLE(val), "Must be traceable");
    JS_SET_TRACING_DETAILS(trc, PrintTraceName, this, 0);
    JS_CallTracer(trc, JSVAL_TO_TRACEABLE(val), JSVAL_TRACE_KIND(val));
}
Ejemplo n.º 3
0
void
traceValue(JSTracer* tracer,
           jsval val)
{
  JS_SET_TRACING_DETAILS(tracer, printTraceName, NULL, 0);
  if (JSVAL_IS_TRACEABLE(val)) {
    uint32 kind = JSVAL_TRACE_KIND(val);
    JS_CallTracer(tracer, JSVAL_TO_TRACEABLE(val), kind);
  }
}
Ejemplo n.º 4
0
static void
trace_foreach(void *key,
              void *value,
              void *data)
{
    Child *child = value;
    JSTracer *tracer = data;

    if (child->child != NULL) {
        JS_SET_TRACING_DETAILS(tracer, NULL, "keep-alive", 0);
        JS_CallTracer(tracer, child->child, JSTRACE_OBJECT);
    }
}
Ejemplo n.º 5
0
static void
trace_foreach(void *key,
              void *value,
              void *data)
{
    Child *child = value;
    JSTracer *tracer = data;

    if (child->child != NULL) {
        jsval val;
        JS_SET_TRACING_DETAILS(tracer, NULL, "keep-alive", 0);
        val = OBJECT_TO_JSVAL(child->child);
        JS_CallTracer(tracer, JSVAL_TO_TRACEABLE (val), JSTRACE_OBJECT);
    }
}
Ejemplo n.º 6
0
static JSDHashOperator
js_locked_atom_tracer(JSDHashTable *table, JSDHashEntryHdr *hdr,
                      uint32 number, void *arg)
{
    JSAtomHashEntry *entry = TO_ATOM_ENTRY(hdr);
    JSTracer *trc = (JSTracer *)arg;

    if (entry->keyAndFlags == 0) {
        /* Ignore uninitialized entries during tracing. */
        return JS_DHASH_NEXT;
    }
    JS_SET_TRACING_INDEX(trc, "locked_atom", (size_t)number);
    JS_CallTracer(trc, ATOM_ENTRY_KEY(entry),
                  IS_STRING_TABLE(table) ? JSTRACE_STRING : JSTRACE_DOUBLE);
    return JS_DHASH_NEXT;
}
Ejemplo n.º 7
0
static JSDHashOperator
js_pinned_atom_tracer(JSDHashTable *table, JSDHashEntryHdr *hdr,
                        uint32 number, void *arg)
{
    JSAtomHashEntry *entry = TO_ATOM_ENTRY(hdr);
    JSTracer *trc = (JSTracer *)arg;
    uintN flags = ATOM_ENTRY_FLAGS(entry);

    JS_ASSERT(IS_STRING_TABLE(table));
    if (flags & (ATOM_PINNED | ATOM_INTERNED)) {
        JS_SET_TRACING_INDEX(trc,
                             flags & ATOM_PINNED
                             ? "pinned_atom"
                             : "interned_atom",
                             (size_t)number);
        JS_CallTracer(trc, ATOM_ENTRY_KEY(entry), JSTRACE_STRING);
    }
    return JS_DHASH_NEXT;
}
Ejemplo n.º 8
0
void XPCTraceableVariant::TraceJS(JSTracer* trc)
{
    NS_ASSERTION(JSVAL_IS_TRACEABLE(mJSVal), "Must be traceable");
    JS_SET_TRACING_DETAILS(trc, PrintTraceName, this, 0);
    JS_CallTracer(trc, JSVAL_TO_TRACEABLE(mJSVal), JSVAL_TRACE_KIND(mJSVal));
}