Followup to last checkin to better comment the dependency I missed.

This commit is contained in:
brendan%mozilla.org 2003-08-14 01:17:27 +00:00
Родитель 9ee6171b3e
Коммит 68fcf03cb1
2 изменённых файлов: 13 добавлений и 7 удалений

Просмотреть файл

@ -4300,6 +4300,12 @@ void DumpSrcNoteSizeHist()
}
#endif
/*
* Fill in the storage at notes with prolog and main srcnotes; the space at
* notes was allocated using the CG_COUNT_FINAL_SRCNOTES macro from jsemit.h.
* SO DON'T CHANGE THIS FUNCTION WITHOUT AT LEAST CHECKING WHETHER jsemit.h's
* CG_COUNT_FINAL_SRCNOTES MACRO NEEDS CORRESPONDING CHANGES!
*/
JSBool
js_FinishTakingSrcNotes(JSContext *cx, JSCodeGenerator *cg, jssrcnote *notes)
{

Просмотреть файл

@ -476,7 +476,8 @@ js_SetSrcNoteOffset(JSContext *cx, JSCodeGenerator *cg, uintN index,
*
* To compute the number of JSSrcNotes to allocate and pass in via notes, use
* the CG_COUNT_FINAL_SRCNOTES macro. This macro knows a lot about details of
* js_FinishTakingSrcNotes.
* js_FinishTakingSrcNotes, SO DON'T CHANGE jsemit.c's js_FinishTakingSrcNotes
* FUNCTION WITHOUT CHECKING WHETHER THIS MACRO NEEDS CORRESPONDING CHANGES!
*/
#define CG_COUNT_FINAL_SRCNOTES(cg, cnt) \
JS_BEGIN_MACRO \
@ -487,15 +488,14 @@ js_SetSrcNoteOffset(JSContext *cx, JSCodeGenerator *cg, uintN index,
if (diff_ > SN_DELTA_MASK) \
cnt += JS_HOWMANY(diff_ - SN_DELTA_MASK, SN_XDELTA_MASK); \
cnt += 2 + (((cg)->firstLine > SN_3BYTE_OFFSET_MASK) << 1); \
} else { \
} else if (diff_ > 0) { \
if (cg->main.noteCount) { \
jssrcnote *sn_ = (cg)->main.notes; \
ptrdiff_t delta_ = SN_IS_XDELTA(sn_) \
? SN_XDELTA_MASK - (*sn_ & SN_XDELTA_MASK) \
: SN_DELTA_MASK - (*sn_ & SN_DELTA_MASK); \
diff_ -= JS_MIN(delta_, diff_); \
diff_ -= SN_IS_XDELTA(sn_) \
? SN_XDELTA_MASK - (*sn_ & SN_XDELTA_MASK) \
: SN_DELTA_MASK - (*sn_ & SN_DELTA_MASK); \
} \
if (diff_) \
if (diff_ > 0) \
cnt += JS_HOWMANY(diff_, SN_XDELTA_MASK); \
} \
JS_END_MACRO