Squeeze a few instructions out of the noSuchMethod special case, and restore needed arena metering (followup to 196097, r=sparky).

This commit is contained in:
brendan%mozilla.org 2003-11-03 05:07:41 +00:00
Родитель 04d569bcdd
Коммит 1156b9ae73
1 изменённых файлов: 7 добавлений и 4 удалений

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

@ -681,6 +681,7 @@ js_Invoke(JSContext *cx, uintN argc, uintN flags)
jsatomid atomIndex; jsatomid atomIndex;
JSAtom *atom; JSAtom *atom;
JSObject *argsobj; JSObject *argsobj;
JSArena *a;
if (!fp->script || (flags & JSINVOKE_INTERNAL)) if (!fp->script || (flags & JSINVOKE_INTERNAL))
goto bad; goto bad;
@ -706,8 +707,8 @@ js_Invoke(JSContext *cx, uintN argc, uintN flags)
sp = vp + 4; sp = vp + 4;
if (argc < 2) { if (argc < 2) {
limit = (jsval *) cx->stackPool.current->limit; a = cx->stackPool.current;
if (sp > limit) { if ((jsuword)sp > a->limit) {
/* /*
* Arguments must be contiguous, and must include argv[-1] * Arguments must be contiguous, and must include argv[-1]
* and argv[-2], so allocate more stack, advance sp, and * and argv[-2], so allocate more stack, advance sp, and
@ -722,8 +723,10 @@ js_Invoke(JSContext *cx, uintN argc, uintN flags)
newsp[1] = OBJECT_TO_JSVAL(thisp); newsp[1] = OBJECT_TO_JSVAL(thisp);
sp = newsp + 4; sp = newsp + 4;
} else { } else {
if (cx->stackPool.current->avail < (jsuword)sp) if (a->avail < (jsuword)sp) {
cx->stackPool.current->avail = (jsuword)sp; JS_ArenaCountAllocation(pool, (jsuword)sp - a->avail);
a->avail = (jsuword)sp;
}
} }
} }