Merge backout of 7cd22106e8d9

This commit is contained in:
Josh Aas 2009-05-16 21:11:13 -04:00
commit 1126a8783f
3 changed files with 24 additions and 7 deletions

View File

@ -1843,17 +1843,34 @@ EmitEnterBlock(JSContext *cx, JSParseNode *pn, JSCodeGenerator *cg)
static bool
MakeUpvarForEval(JSParseNode *pn, JSCodeGenerator *cg)
{
JSContext *cx = cg->compiler->context;
JSFunction *fun = cg->compiler->callerFrame->fun;
uintN upvarLevel = fun->u.i.script->staticLevel;
JSFunctionBox *funbox = cg->funbox;
while (funbox && funbox->level >= upvarLevel) {
if (funbox->node->pn_dflags & PND_FUNARG)
if (funbox) {
/*
* Treat top-level function definitions as escaping (i.e., as funargs),
* required since we compile each such top level function or statement
* and throw away the AST, so we can't yet see all funarg uses of this
* function being compiled (cg->funbox->object). See bug 493177.
*/
if (funbox->level == fun->u.i.script->staticLevel + 1U &&
!(((JSFunction *) funbox->object)->flags & JSFUN_LAMBDA)) {
JS_ASSERT_IF(cx->options & JSOPTION_ANONFUNFIX,
((JSFunction *) funbox->object)->atom);
return true;
funbox = funbox->parent;
}
while (funbox->level >= upvarLevel) {
if (funbox->node->pn_dflags & PND_FUNARG)
return true;
funbox = funbox->parent;
if (!funbox)
break;
}
}
JSContext *cx = cg->compiler->context;
JSAtom *atom = pn->pn_atom;
uintN index;

View File

@ -256,7 +256,7 @@ struct VMSideExit : public nanojit::SideExit
* Ordinarily 0. If a slow native function is atop the stack, the 1 bit is
* set if constructing and the other bits are a pointer to the funobj.
*/
uintN nativeCalleeWord;
uintptr_t nativeCalleeWord;
JSObject * nativeCallee() {
return (JSObject *) (nativeCalleeWord & ~1);
@ -267,7 +267,7 @@ struct VMSideExit : public nanojit::SideExit
}
void setNativeCallee(JSObject *callee, bool constructing) {
nativeCalleeWord = uintN(callee) | constructing;
nativeCalleeWord = uintptr_t(callee) | (constructing ? 1 : 0);
}
};

View File

@ -95,7 +95,7 @@ nsBulletFrame::Destroy()
{
// Stop image loading first
if (mImageRequest) {
mImageRequest->Cancel(NS_ERROR_FAILURE);
mImageRequest->CancelAndForgetObserver(NS_ERROR_FAILURE);
mImageRequest = nsnull;
}