ok = js_Emit1(cx, cg, JSOP_STOP) >= 0;
ok = JS_TRUE;
js_CompileTokenStream(JSContext *cx, JSObject *chain, JSTokenStream *ts,                      JSCodeGenerator *cg){    JSStackFrame *fp, frame;    uint32 flags;    JSParseNode *pn;    JSBool ok;#ifdef METER_PARSENODES    void *sbrk(ptrdiff_t), *before = sbrk(0);#endif    /*     * Push a compiler frame if we have no frames, or if the top frame is a     * lightweight function activation, or if its scope chain doesn't match     * the one passed to us.     */    fp = cx->fp;    if (!fp || !fp->varobj || fp->scopeChain != chain) {        memset(&frame, 0, sizeof frame);        frame.varobj = frame.scopeChain = chain;        if (cx->options & JSOPTION_VAROBJFIX) {            while ((chain = JS_GetParent(cx, chain)) != NULL)                frame.varobj = chain;        }        frame.down = fp;        if (fp)            frame.flags = fp->flags & (JSFRAME_SPECIAL | JSFRAME_COMPILE_N_GO);        cx->fp = &frame;    }    flags = cx->fp->flags;    cx->fp->flags = flags |                    (JS_HAS_COMPILE_N_GO_OPTION(cx)                     ? JSFRAME_COMPILING | JSFRAME_COMPILE_N_GO                     : JSFRAME_COMPILING);    /* Prevent GC activation while compiling. */    JS_KEEP_ATOMS(cx->runtime);    pn = Statements(cx, ts, &cg->treeContext);    if (!pn) {        ok = JS_FALSE;    } else if (!js_MatchToken(cx, ts, TOK_EOF)) {        js_ReportCompileErrorNumber(cx, ts, JSREPORT_TS | JSREPORT_ERROR,                                    JSMSG_SYNTAX_ERROR);        ok = JS_FALSE;    } else {#ifdef METER_PARSENODES        printf("Parser growth: %d (%u nodes, %u max, %u unrecycled)\n",               (char *)sbrk(0) - (char *)before,               parsenodes,               maxparsenodes,               parsenodes - recyclednodes);        before = sbrk(0);#endif        /*         * No need to emit bytecode here -- Statements already has, for each         * statement in turn.  Search for TCF_COMPILING in Statements, below.         * That flag is set for every tc == &cg->treeContext, and it implies         * that the tc can be downcast to a cg and used to emit code during         * parsing, rather than at the end of the parse phase.         *         * Update: the threaded interpreter needs a stop instruction, so we         * do have to emit that here.         */        JS_ASSERT(cg->treeContext.flags & TCF_COMPILING);        ok = js_Emit1(cx, cg, JSOP_STOP) >= 0;    }#ifdef METER_PARSENODES    printf("Code-gen growth: %d (%u bytecodes, %u srcnotes)\n",           (char *)sbrk(0) - (char *)before, CG_OFFSET(cg), cg->noteCount);#endif#ifdef JS_ARENAMETER    JS_DumpArenaStats(stdout);#endif    JS_UNKEEP_ATOMS(cx->runtime);    cx->fp->flags = flags;    cx->fp = fp;    return ok;}