Bug 1216140 - Load the global lexical scope for the BINDGNAME Baseline IC when the script doesn't have a non-syntactic scope chain. (r=jandem)

This commit is contained in:
Shu-yu Guo 2015-10-30 12:43:37 -07:00
parent 51b1f5f510
commit b5b1acc555
2 changed files with 10 additions and 1 deletions

View File

@ -0,0 +1,6 @@
function newFunc(x) Function(x)()
newFunc(`
var BUGNUMBER = 8[ anonymous = true ]--;
() => BUGNUMBER;
`);

View File

@ -2436,7 +2436,10 @@ BaselineCompiler::emit_JSOP_BINDNAME()
{
frame.syncStack(0);
masm.loadPtr(frame.addressOfScopeChain(), R0.scratchReg());
if (*pc == JSOP_BINDGNAME && !script->hasNonSyntacticScope())
masm.movePtr(ImmGCPtr(&script->global().lexicalScope()), R0.scratchReg());
else
masm.loadPtr(frame.addressOfScopeChain(), R0.scratchReg());
// Call IC.
ICBindName_Fallback::Compiler stubCompiler(cx);