зеркало из https://github.com/mozilla/gecko-dev.git
Bug 797469 - Avoid putting a JSFunction in Objectbox. r=jorendorff, a=bajaj
This commit is contained in:
Родитель
f8ead0f78f
Коммит
b9061e250a
|
@ -150,7 +150,10 @@ frontend::CompileScript(JSContext *cx, HandleObject scopeChain, StackFrame *call
|
|||
* function captured in case it refers to an upvar, and someone
|
||||
* wishes to decompile it while it's running.
|
||||
*/
|
||||
ObjectBox *funbox = parser.newObjectBox(callerFrame->fun());
|
||||
JSFunction *fun = callerFrame->fun();
|
||||
ObjectBox *funbox = parser.newFunctionBox(fun, &pc,
|
||||
fun->inStrictMode() ? StrictMode::STRICT
|
||||
: StrictMode::NOTSTRICT);
|
||||
if (!funbox)
|
||||
return NULL;
|
||||
bce.objectList.add(funbox);
|
||||
|
|
|
@ -797,6 +797,15 @@ ObjectBox::ObjectBox(JSObject *object, ObjectBox* traceLink)
|
|||
traceLink(traceLink),
|
||||
emitLink(NULL)
|
||||
{
|
||||
JS_ASSERT(!object->isFunction());
|
||||
}
|
||||
|
||||
ObjectBox::ObjectBox(JSFunction *function, ObjectBox* traceLink)
|
||||
: object(function),
|
||||
traceLink(traceLink),
|
||||
emitLink(NULL)
|
||||
{
|
||||
JS_ASSERT(object->isFunction());
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -1471,6 +1471,8 @@ class ObjectBox {
|
|||
|
||||
ObjectBox *traceLink;
|
||||
ObjectBox *emitLink;
|
||||
|
||||
ObjectBox(JSFunction *function, ObjectBox *traceLink);
|
||||
};
|
||||
|
||||
} /* namespace frontend */
|
||||
|
|
|
@ -222,7 +222,6 @@ class FunctionBox : public ObjectBox, public SharedContext
|
|||
funCxFlags.definitelyNeedsArgsObj = true; }
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* NB: If you add a new type of statement that is a scope, add it between
|
||||
* STMT_WITH and STMT_CATCH, or you will break StmtInfoBase::linksScope. If you
|
||||
|
|
Загрузка…
Ссылка в новой задаче