зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 962dbeaf5c5d (bug 1238555) for opt-only jit-test failures.
This commit is contained in:
Родитель
87f79e1213
Коммит
7f33dece32
|
@ -6390,16 +6390,11 @@ BytecodeEmitter::emitFunction(ParseNode* pn, bool needsProto)
|
|||
|
||||
SharedContext* outersc = sc;
|
||||
if (fun->isInterpretedLazy()) {
|
||||
// We need to update the static scope chain regardless of whether
|
||||
// the LazyScript has already been initialized, due to the case
|
||||
// where we previously successfully compiled an inner function's
|
||||
// lazy script but failed to compile the outer script after the
|
||||
// fact. If we attempt to compile the outer script again, the
|
||||
// static scope chain will be newly allocated and will mismatch
|
||||
// the previously compiled LazyScript's.
|
||||
ScriptSourceObject* source = &script->sourceObject()->as<ScriptSourceObject>();
|
||||
JSObject* scope = innermostStaticScope();
|
||||
fun->lazyScript()->setEnclosingScopeAndSource(scope, source);
|
||||
if (!fun->lazyScript()->sourceObject()) {
|
||||
JSObject* scope = innermostStaticScope();
|
||||
JSObject* source = script->sourceObject();
|
||||
fun->lazyScript()->setParent(scope, &source->as<ScriptSourceObject>());
|
||||
}
|
||||
if (emittingRunOnceLambda)
|
||||
fun->lazyScript()->setTreatAsRunOnce();
|
||||
} else {
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
oomTest(
|
||||
function x() {
|
||||
try {
|
||||
eval('let ')
|
||||
} catch (ex) {
|
||||
(function() {})()
|
||||
}
|
||||
}
|
||||
);
|
|
@ -4281,14 +4281,11 @@ LazyScript::resetScript()
|
|||
}
|
||||
|
||||
void
|
||||
LazyScript::setEnclosingScopeAndSource(JSObject* enclosingScope, ScriptSourceObject* sourceObject)
|
||||
LazyScript::setParent(JSObject* enclosingScope, ScriptSourceObject* sourceObject)
|
||||
{
|
||||
MOZ_ASSERT(!sourceObject_ && !enclosingScope_);
|
||||
MOZ_ASSERT_IF(enclosingScope, function_->compartment() == enclosingScope->compartment());
|
||||
MOZ_ASSERT(function_->compartment() == sourceObject->compartment());
|
||||
// This method may be called to update the enclosing scope. See comment
|
||||
// above the callsite in BytecodeEmitter::emitFunction.
|
||||
MOZ_ASSERT_IF(sourceObject_, sourceObject_ == sourceObject && enclosingScope_);
|
||||
MOZ_ASSERT_IF(!sourceObject_, !enclosingScope_);
|
||||
|
||||
enclosingScope_ = enclosingScope;
|
||||
sourceObject_ = sourceObject;
|
||||
|
@ -4399,7 +4396,7 @@ LazyScript::Create(ExclusiveContext* cx, HandleFunction fun,
|
|||
// Set the enclosing scope of the lazy function, this would later be
|
||||
// used to define the environment when the function would be used.
|
||||
MOZ_ASSERT(!res->sourceObject());
|
||||
res->setEnclosingScopeAndSource(enclosingScope, &sourceObjectScript->scriptSourceUnwrap());
|
||||
res->setParent(enclosingScope, &sourceObjectScript->scriptSourceUnwrap());
|
||||
|
||||
MOZ_ASSERT(!res->hasScript());
|
||||
if (script)
|
||||
|
|
|
@ -2272,7 +2272,7 @@ class LazyScript : public gc::TenuredCell
|
|||
return (p_.version == JS_BIT(8) - 1) ? JSVERSION_UNKNOWN : JSVersion(p_.version);
|
||||
}
|
||||
|
||||
void setEnclosingScopeAndSource(JSObject* enclosingScope, ScriptSourceObject* sourceObject);
|
||||
void setParent(JSObject* enclosingScope, ScriptSourceObject* sourceObject);
|
||||
|
||||
uint32_t numFreeVariables() const {
|
||||
return p_.numFreeVariables;
|
||||
|
|
Загрузка…
Ссылка в новой задаче