Bug 416439. Using goto error in the interpreter to shrink code size. r,a1.9=brendan

git-svn-id: svn://10.0.0.236/trunk@245966 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
igor%mir2.org
2008-02-19 12:16:26 +00:00
parent 9af971b573
commit 01ce71eccd
4 changed files with 433 additions and 585 deletions

View File

@@ -2111,16 +2111,13 @@ js_TraceStackFrame(JSTracer *trc, JSStackFrame *fp)
JS_CALL_OBJECT_TRACER(trc, fp->varobj, "variables");
if (fp->script) {
js_TraceScript(trc, fp->script);
if (fp->spbase) {
/*
* Don't mark what has not been pushed yet, or what has been
* popped already.
*/
JS_ASSERT(JS_UPTRDIFF(fp->sp, fp->spbase) <=
fp->script->depth * sizeof(jsval));
nslots = (uintN) (fp->sp - fp->spbase);
TRACE_JSVALS(trc, nslots, fp->spbase, "operand");
}
/*
* Don't mark what has not been pushed yet, or what has been
* popped already.
*/
nslots = (uintN) (fp->sp - fp->spbase);
JS_ASSERT(nslots <= fp->script->depth);
TRACE_JSVALS(trc, nslots, fp->spbase, "operand");
}
/* Allow for primitive this parameter due to JSFUN_THISP_* flags. */

File diff suppressed because it is too large Load Diff

View File

@@ -1940,16 +1940,21 @@ js_CloneBlockObject(JSContext *cx, JSObject *proto, JSObject *parent,
* the prototype's scope harder!
*/
JSBool
js_PutBlockObject(JSContext *cx, JSObject *obj, JSBool normalUnwind)
js_PutBlockObject(JSContext *cx, JSBool normalUnwind)
{
JSStackFrame *fp;
JSObject *obj;
uintN depth, slot;
JSScopeProperty *sprop;
fp = cx->fp;
obj = fp->scopeChain;
JS_ASSERT(OBJ_GET_CLASS(cx, obj) == &js_BlockClass);
JS_ASSERT(OBJ_GET_PRIVATE(cx, obj) == cx->fp);
if (normalUnwind) {
fp = (JSStackFrame *) JS_GetPrivate(cx, obj);
JS_ASSERT(fp);
depth = OBJ_BLOCK_DEPTH(cx, obj);
JS_ASSERT(depth >= 0);
JS_ASSERT(fp->spbase + depth <= fp->sp);
for (sprop = OBJ_SCOPE(obj)->lastProp; sprop; sprop = sprop->parent) {
if (sprop->getter != js_BlockClass.getProperty)
continue;
@@ -1977,6 +1982,7 @@ js_PutBlockObject(JSContext *cx, JSObject *obj, JSBool normalUnwind)
out:
/* We must clear the private slot even with errors. */
JS_SetPrivate(cx, obj, NULL);
fp->scopeChain = OBJ_GET_PARENT(cx, obj);
return normalUnwind;
}

View File

@@ -350,7 +350,7 @@ js_CloneBlockObject(JSContext *cx, JSObject *proto, JSObject *parent,
JSStackFrame *fp);
extern JSBool
js_PutBlockObject(JSContext *cx, JSObject *obj, JSBool normalUnwind);
js_PutBlockObject(JSContext *cx, JSBool normalUnwind);
struct JSSharpObjectMap {
jsrefcount depth;