mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 901178 - IonMonkey: Avoid parsing unused lambda functions. r=bhackett
This commit is contained in:
parent
1ad4e6db16
commit
2b33645d2e
@ -739,9 +739,22 @@ CodeGenerator::emitLambdaInit(const Register &output, const Register &scopeChain
|
||||
|
||||
JS_STATIC_ASSERT(offsetof(JSFunction, flags) == offsetof(JSFunction, nargs) + 2);
|
||||
masm.store32(Imm32(u.word), Address(output, offsetof(JSFunction, nargs)));
|
||||
masm.storePtr(ImmGCPtr(fun->nonLazyScript()),
|
||||
Address(output, JSFunction::offsetOfNativeOrScript()));
|
||||
|
||||
// Initialize the JSFunction union with the script / native / lazyScript
|
||||
// corresponding to the flag.
|
||||
ImmGCPtr scriptOrLazyScript(NULL);
|
||||
if (fun->isInterpretedLazy())
|
||||
scriptOrLazyScript = ImmGCPtr(fun->lazyScriptOrNull());
|
||||
else
|
||||
scriptOrLazyScript = ImmGCPtr(fun->nonLazyScript());
|
||||
|
||||
masm.storePtr(scriptOrLazyScript, Address(output, JSFunction::offsetOfNativeOrScript()));
|
||||
|
||||
// Lambda scripted functions are given the scope chain as the environment in
|
||||
// which the caller was at the time of the creation of the lambda.
|
||||
masm.storePtr(scopeChain, Address(output, JSFunction::offsetOfEnvironment()));
|
||||
|
||||
// Copy the name of the function used for diagnostics.
|
||||
masm.storePtr(ImmGCPtr(fun->displayAtom()), Address(output, JSFunction::offsetOfAtom()));
|
||||
}
|
||||
|
||||
|
@ -8248,9 +8248,6 @@ IonBuilder::jsop_object(JSObject *obj)
|
||||
bool
|
||||
IonBuilder::jsop_lambda(JSFunction *fun)
|
||||
{
|
||||
if (fun->isInterpreted() && !fun->getOrCreateScript(cx))
|
||||
return false;
|
||||
|
||||
JS_ASSERT(script()->analysis()->usesScopeChain());
|
||||
if (fun->isArrow())
|
||||
return abort("bound arrow function");
|
||||
|
@ -322,6 +322,7 @@ class JSFunction : public JSObject
|
||||
}
|
||||
|
||||
static unsigned offsetOfNativeOrScript() {
|
||||
JS_STATIC_ASSERT(offsetof(U, n.native) == offsetof(U, i.s.lazy_));
|
||||
JS_STATIC_ASSERT(offsetof(U, n.native) == offsetof(U, i.s.script_));
|
||||
JS_STATIC_ASSERT(offsetof(U, n.native) == offsetof(U, nativeOrScript));
|
||||
return offsetof(JSFunction, u.nativeOrScript);
|
||||
|
Loading…
Reference in New Issue
Block a user