ptrdiff_t offset, delta;
js_FinishTakingSrcNotes(JSContext *cx, JSCodeGenerator *cg, jssrcnote *notes){    uintN prologCount, mainCount, totalCount;    ptrdiff_t offset, delta;    JS_ASSERT(cg->current == &cg->main);    prologCount = cg->prolog.noteCount;    if (prologCount && cg->prolog.currentLine != cg->firstLine) {        CG_SWITCH_TO_PROLOG(cg);        if (js_NewSrcNote2(cx, cg, SRC_SETLINE, (ptrdiff_t)cg->firstLine) < 0)            return JS_FALSE;        prologCount = cg->prolog.noteCount;        CG_SWITCH_TO_MAIN(cg);    } else {        /*         * Either no prolog srcnotes, or no line number change over prolog.         * We don't need a SRC_SETLINE, but we may need to adjust the offset         * of the first main note, by adding to its delta and possibly even         * prepending SRC_XDELTA notes to it.         */        offset = CG_PROLOG_OFFSET(cg) - cg->prolog.lastNoteOffset;        JS_ASSERT(offset >= 0);        while (offset > 0) {            delta = JS_MIN(offset, SN_XDELTA_MASK);            if (!js_AddToSrcNoteDelta(cx, cg, cg->main.notes, delta))                return JS_FALSE;            offset -= delta;        }    }    mainCount = cg->main.noteCount;    totalCount = prologCount + mainCount;    if (prologCount)        memcpy(notes, cg->prolog.notes, SRCNOTE_SIZE(prologCount));    memcpy(notes + prologCount, cg->main.notes, SRCNOTE_SIZE(mainCount));    SN_MAKE_TERMINATOR(&notes[totalCount]);#ifdef DEBUG_brendan  { int bin = JS_CeilingLog2(totalCount);    if (bin >= NBINS)        bin = NBINS - 1;    ++hist[bin];  }#endif    return JS_TRUE;}