mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1019181 - Don't use JSPROP_PERMANENT for JSOP_DEFCONST (r=jorendorff)
This commit is contained in:
parent
21b58e5735
commit
53f07d07b2
@ -2195,10 +2195,10 @@ BaselineCompiler::emit_JSOP_DEFVAR()
|
||||
frame.syncStack(0);
|
||||
|
||||
unsigned attrs = JSPROP_ENUMERATE;
|
||||
if (!script->isForEval())
|
||||
attrs |= JSPROP_PERMANENT;
|
||||
if (JSOp(*pc) == JSOP_DEFCONST)
|
||||
attrs |= JSPROP_READONLY;
|
||||
else if (!script->isForEval())
|
||||
attrs |= JSPROP_PERMANENT;
|
||||
JS_ASSERT(attrs <= UINT32_MAX);
|
||||
|
||||
masm.loadPtr(frame.addressOfScopeChain(), R0.scratchReg());
|
||||
|
@ -9733,9 +9733,12 @@ IonBuilder::jsop_defvar(uint32_t index)
|
||||
PropertyName *name = script()->getName(index);
|
||||
|
||||
// Bake in attrs.
|
||||
unsigned attrs = JSPROP_ENUMERATE | JSPROP_PERMANENT;
|
||||
unsigned attrs = JSPROP_ENUMERATE;
|
||||
if (JSOp(*pc) == JSOP_DEFCONST)
|
||||
attrs |= JSPROP_READONLY;
|
||||
else
|
||||
attrs |= JSPROP_PERMANENT;
|
||||
JS_ASSERT(!script()->isForEval());
|
||||
|
||||
// Pass the ScopeChain.
|
||||
JS_ASSERT(analysis().usesScopeChain());
|
||||
|
@ -2910,10 +2910,10 @@ CASE(JSOP_DEFVAR)
|
||||
{
|
||||
/* ES5 10.5 step 8 (with subsequent errata). */
|
||||
unsigned attrs = JSPROP_ENUMERATE;
|
||||
if (!REGS.fp()->isEvalFrame())
|
||||
attrs |= JSPROP_PERMANENT;
|
||||
if (*REGS.pc == JSOP_DEFCONST)
|
||||
attrs |= JSPROP_READONLY;
|
||||
else if (!REGS.fp()->isEvalFrame())
|
||||
attrs |= JSPROP_PERMANENT;
|
||||
|
||||
/* Step 8b. */
|
||||
RootedObject &obj = rootObject0;
|
||||
|
@ -1138,8 +1138,9 @@
|
||||
macro(JSOP_DEFFUN, 127,"deffun", NULL, 5, 0, 0, JOF_OBJECT) \
|
||||
/*
|
||||
* Defines the new binding on the frame's current variables-object (the
|
||||
* scope object on the scope chain designated to receive new variables)
|
||||
* with 'READONLY' attribute.
|
||||
* scope object on the scope chain designated to receive new variables) with
|
||||
* 'READONLY' attribute. The binding is *not* JSPROP_PERMANENT. See bug
|
||||
* 1019181 for the reason.
|
||||
*
|
||||
* This is used for global scripts and also in some cases for function
|
||||
* scripts where use of dynamic scoping inhibits optimization.
|
||||
|
Loading…
Reference in New Issue
Block a user