Bug 380469: Followup for the previous check in to remove more no longer used close-on-GC code. r=brendan
git-svn-id: svn://10.0.0.236/trunk@229956 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -546,10 +546,8 @@ args_or_call_trace(JSTracer *trc, JSObject *obj)
|
||||
JSStackFrame *fp;
|
||||
|
||||
fp = (JSStackFrame *) JS_GetPrivate(trc->context, obj);
|
||||
if (fp && (fp->flags & JSFRAME_GENERATOR)) {
|
||||
JS_CALL_OBJECT_TRACER(trc, FRAME_TO_GENERATOR(fp)->obj,
|
||||
"FRAME_TO_GENERATOR(fp)->obj");
|
||||
}
|
||||
if (fp && (fp->flags & JSFRAME_GENERATOR))
|
||||
js_TraceGenerator(trc, FRAME_TO_GENERATOR(fp));
|
||||
}
|
||||
#else
|
||||
# define args_or_call_trace NULL
|
||||
|
||||
@@ -670,23 +670,29 @@ generator_finalize(JSContext *cx, JSObject *obj)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
js_TraceGenerator(JSTracer *trc, JSGenerator *gen)
|
||||
{
|
||||
/*
|
||||
* We must trace argv[-2], as js_TraceStackFrame will not. Note that
|
||||
* js_TraceStackFrame will trace thisp (argv[-1]) and actual arguments,
|
||||
* plus any missing formals and local GC roots.
|
||||
*/
|
||||
JS_ASSERT(!JSVAL_IS_PRIMITIVE(gen->frame.argv[-2]));
|
||||
JS_CALL_OBJECT_TRACER(trc, JSVAL_TO_OBJECT(gen->frame.argv[-2]),
|
||||
"generator");
|
||||
js_TraceStackFrame(trc, &gen->frame);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
generator_trace(JSTracer *trc, JSObject *obj)
|
||||
{
|
||||
JSGenerator *gen;
|
||||
|
||||
gen = (JSGenerator *) JS_GetPrivate(trc->context, obj);
|
||||
if (gen) {
|
||||
/*
|
||||
* We must trace argv[-2], as js_TraceStackFrame will not. Note
|
||||
* that js_TraceStackFrame will trace thisp (argv[-1]) and actual
|
||||
* arguments, plus any missing formals and local GC roots.
|
||||
*/
|
||||
JS_ASSERT(!JSVAL_IS_PRIMITIVE(gen->frame.argv[-2]));
|
||||
JS_CALL_OBJECT_TRACER(trc, JSVAL_TO_OBJECT(gen->frame.argv[-2]),
|
||||
"generator");
|
||||
js_TraceStackFrame(trc, &gen->frame);
|
||||
}
|
||||
if (gen)
|
||||
js_TraceGenerator(trc, gen);
|
||||
}
|
||||
|
||||
JSClass js_GeneratorClass = {
|
||||
@@ -733,8 +739,6 @@ js_NewGenerator(JSContext *cx, JSStackFrame *fp)
|
||||
if (!gen)
|
||||
goto bad;
|
||||
|
||||
gen->obj = obj;
|
||||
|
||||
/* Steal away objects reflecting fp and point them at gen->frame. */
|
||||
gen->frame.callobj = fp->callobj;
|
||||
if (fp->callobj) {
|
||||
|
||||
@@ -91,8 +91,6 @@ typedef enum JSGeneratorState {
|
||||
} JSGeneratorState;
|
||||
|
||||
struct JSGenerator {
|
||||
JSGenerator *next;
|
||||
JSObject *obj;
|
||||
JSGeneratorState state;
|
||||
JSStackFrame frame;
|
||||
JSArena arena;
|
||||
@@ -105,6 +103,9 @@ struct JSGenerator {
|
||||
extern JSObject *
|
||||
js_NewGenerator(JSContext *cx, JSStackFrame *fp);
|
||||
|
||||
extern void
|
||||
js_TraceGenerator(JSTracer *trc, JSGenerator *gen);
|
||||
|
||||
#endif
|
||||
|
||||
extern JSClass js_GeneratorClass;
|
||||
|
||||
Reference in New Issue
Block a user