mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-18 15:55:36 +00:00
Bug 922406 - Ion-compile global scripts that use 'this'. r=shu
This commit is contained in:
parent
ddbd50b2c1
commit
0b2970741e
@ -1993,6 +1993,9 @@ IonBuilder::inspectOpcode(JSOp op)
|
||||
case JSOP_FUNCTIONTHIS:
|
||||
return jsop_functionthis();
|
||||
|
||||
case JSOP_GLOBALTHIS:
|
||||
return jsop_globalthis();
|
||||
|
||||
case JSOP_CALLEE: {
|
||||
MDefinition* callee = getCallee();
|
||||
current->push(callee);
|
||||
@ -12920,6 +12923,20 @@ IonBuilder::jsop_functionthis()
|
||||
return resumeAfter(thisObj);
|
||||
}
|
||||
|
||||
bool
|
||||
IonBuilder::jsop_globalthis()
|
||||
{
|
||||
if (script()->hasNonSyntacticScope()) {
|
||||
// Ion does not compile global scripts with a non-syntactic scope, but
|
||||
// we can end up here when we're compiling an arrow function.
|
||||
return abort("JSOP_GLOBALTHIS in script with non-syntactic scope");
|
||||
}
|
||||
|
||||
ClonedBlockObject* globalLexical = &script()->global().lexicalScope();
|
||||
pushConstant(globalLexical->thisValue());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
IonBuilder::jsop_typeof()
|
||||
{
|
||||
|
@ -720,6 +720,7 @@ class IonBuilder
|
||||
bool jsop_lambda(JSFunction* fun);
|
||||
bool jsop_lambda_arrow(JSFunction* fun);
|
||||
bool jsop_functionthis();
|
||||
bool jsop_globalthis();
|
||||
bool jsop_typeof();
|
||||
bool jsop_toid();
|
||||
bool jsop_iter(uint8_t flags);
|
||||
|
Loading…
Reference in New Issue
Block a user