Merge and undo js_AllocateLoopTableSlot reparam.

This commit is contained in:
Brendan Eich 2008-06-02 17:28:39 -07:00
Родитель 54fecffe96 471c5598d7
Коммит f1b8321466
3 изменённых файлов: 13 добавлений и 2 удалений

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

@ -3906,7 +3906,7 @@ EmitLoopHeader(JSContext *cx, JSCodeGenerator *cg)
if (off < 0) if (off < 0)
return JS_FALSE; return JS_FALSE;
pc = CG_CODE(cg, off); pc = CG_CODE(cg, off);
uint32 slot = js_AllocateLoopTableSlot(cx); uint32 slot = js_AllocateLoopTableSlot(cx->runtime);
SET_UINT24(pc, slot); SET_UINT24(pc, slot);
return JS_TRUE; return JS_TRUE;
} }

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

@ -535,6 +535,17 @@ js_XDRScript(JSXDRState *xdr, JSScript **scriptp, JSBool *hasMagic)
if (!ok) if (!ok)
goto error; goto error;
jsbytecode *pc = code;
jsbytecode *end = pc + length;
while (pc < end) {
/* Assign a new loop table slot for every JSOP_HEADER opcode. */
if ((JSOp)*pc == JSOP_HEADER) {
uint32 slot = js_AllocateLoopTableSlot(cx->runtime);
SET_UINT24(pc, slot);
}
pc += js_OpLength(pc);
}
if (!JS_XDRBytes(xdr, (char *)notes, nsrcnotes * sizeof(jssrcnote)) || if (!JS_XDRBytes(xdr, (char *)notes, nsrcnotes * sizeof(jssrcnote)) ||
!JS_XDRCStringOrNull(xdr, (char **)&script->filename) || !JS_XDRCStringOrNull(xdr, (char **)&script->filename) ||
!JS_XDRUint32(xdr, &lineno) || !JS_XDRUint32(xdr, &lineno) ||

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

@ -62,7 +62,7 @@ struct JSTraceMonitor {
#define TRACE_THRESHOLD 10 #define TRACE_THRESHOLD 10
JSBool js_InitTracer(JSRuntime *rt); JSBool js_InitTracer(JSRuntime *rt);
uint32 js_AllocateLoopTableSlot(JSContext *cx); uint32 js_AllocateLoopTableSlot(JSRuntime *rt);
JSBool js_GrowLoopTable(JSContext *cx, uint32 index); JSBool js_GrowLoopTable(JSContext *cx, uint32 index);
#endif /* jstracer_h___ */ #endif /* jstracer_h___ */