Esempio 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);
}
Esempio 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));
}
Esempio n. 3
0
void
MarkObjectSlots(JSTracer *trc, JSObject *obj, uint32_t start, uint32_t nslots)
{
    JS_ASSERT(obj->isNative());
    for (uint32_t i = start; i < (start + nslots); ++i) {
        JS_SET_TRACING_DETAILS(trc, js_PrintObjectSlotName, obj, i);
        MarkValueInternal(trc, obj->nativeGetSlotRef(i).unsafeGet());
    }
}
Esempio n. 4
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);
  }
}
Esempio n. 5
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);
    }
}
Esempio n. 6
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);
    }
}
Esempio n. 7
0
static void
trace_foreach(void *key,
              void *value,
              void *data)
{
    Child *child = (Child *) value;
    JSTracer *tracer = (JSTracer *) data;

    if (child->child != NULL) {
        jsval val;
        JS_SET_TRACING_DETAILS(tracer, NULL, "keep-alive", 0);
        val = OBJECT_TO_JSVAL(child->child);
        g_assert (JSVAL_TO_TRACEABLE (val));
        JS_CallValueTracer(tracer, &val, "keep-alive::val");
    }
}
Esempio 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));
}