Backed out 2 changesets (bug 1558604) for causing failures in class-declaration-explicit-ctor.js CLOSED TREE

Backed out changeset 2fa5845aab8f (bug 1558604)
Backed out changeset 6accf00aa7cc (bug 1558604)
This commit is contained in:
Noemi Erli 2019-06-13 16:06:59 +03:00
Родитель 4b22abe3d1
Коммит fc3db67332
7 изменённых файлов: 10 добавлений и 41 удалений

Просмотреть файл

@ -335,7 +335,7 @@ JS::Result<FunctionNode*> BinASTParserPerTokenizer<Tok>::buildFunction(
// handled by setting the appropriate funbox field during argument parsing.
if (!lazyScript_ ||
lazyScript_->functionNonDelazifying() != funbox->function()) {
funbox->setArgCount(params ? uint16_t(params->count()) : 0);
funbox->function()->setArgCount(params ? uint16_t(params->count()) : 0);
}
// ParseNode represents the body as concatenated after the params.

Просмотреть файл

@ -665,7 +665,7 @@ bool frontend::StandaloneFunctionCompiler<Unit>::compile(
MutableHandleFunction fun, StandaloneFunctionInfo& info,
FunctionNode* parsedFunction) {
FunctionBox* funbox = parsedFunction->funbox();
if (funbox->isInterpreted()) {
if (funbox->function()->isInterpreted()) {
MOZ_ASSERT(fun == funbox->function());
if (!createFunctionScript(info, funbox->toStringStart,

Просмотреть файл

@ -110,7 +110,7 @@ BytecodeEmitter::BytecodeEmitter(
if (sc->isFunctionBox()) {
// Functions have IC entries for type monitoring |this| and arguments.
bytecodeSection().setNumICEntries(sc->asFunctionBox()->nargs() +
bytecodeSection().setNumICEntries(sc->asFunctionBox()->function()->nargs() +
1);
}
}
@ -2487,7 +2487,6 @@ bool BytecodeEmitter::emitFunctionScript(FunctionNode* funNode,
AutoFrontendTraceLog traceLog(cx, TraceLogger_BytecodeEmission,
parser->errorReporter(), funbox);
MOZ_ASSERT((fieldInitializers_.valid) ==
(funbox->kind() == JSFunction::FunctionKind::ClassConstructor));

Просмотреть файл

@ -1639,10 +1639,6 @@ bool PerHandlerParser<FullParseHandler>::finishFunction(
}
FunctionBox* funbox = pc_->functionBox();
// Synchronize functionBox argCount with Function.
funbox->function()->setArgCount(funbox->nargs());
bool hasParameterExprs = funbox->hasParameterExprs;
if (hasParameterExprs) {
@ -1699,10 +1695,6 @@ bool PerHandlerParser<SyntaxParseHandler>::finishFunction(
FunctionBox* funbox = pc_->functionBox();
RootedFunction fun(cx_, funbox->function());
// Synchronize functionBox argCount with Function.
funbox->function()->setArgCount(funbox->nargs());
LazyScript* lazy = LazyScript::Create(
cx_, fun, sourceObject_, pc_->closedOverBindingsForLazy(),
pc_->innerFunctionsForLazy, funbox->bufStart, funbox->bufEnd,
@ -2441,7 +2433,7 @@ bool GeneralParser<ParseHandler, Unit>::functionArguments(
funbox->hasDirectEvalInParameterExpr = true;
}
funbox->setArgCount(positionalFormals.length());
funbox->function()->setArgCount(positionalFormals.length());
} else if (kind == FunctionSyntaxKind::Setter) {
error(JSMSG_ACCESSOR_WRONG_ARGS, "setter", "one", "");
return false;
@ -7013,7 +7005,7 @@ bool GeneralParser<ParseHandler, Unit>::finishClassConstructor(
}
// Set the same information, but on the lazyScript.
if (ctorbox->isInterpretedLazy()) {
if (ctorbox->function()->isInterpretedLazy()) {
ctorbox->function()->lazyScript()->setToStringEnd(classEndOffset);
if (numFields > 0) {
@ -7246,9 +7238,9 @@ GeneralParser<ParseHandler, Unit>::synthesizeConstructor(
/* duplicatedParam = */ nullptr)) {
return null();
}
funbox->setArgCount(1);
funbox->function()->setArgCount(1);
} else {
funbox->setArgCount(0);
funbox->function()->setArgCount(0);
}
pc_->functionScope().useAsVarScope(pc_);
@ -7441,7 +7433,7 @@ GeneralParser<ParseHandler, Unit>::fieldInitializerOpt(
return null();
}
handler_.setFunctionFormalParametersAndBody(funNode, argsbody);
funbox->setArgCount(0);
funbox->function()->setArgCount(0);
funbox->usesThis = true;
NameNodeType thisName = newThisName();

Просмотреть файл

@ -162,9 +162,6 @@ FunctionBox::FunctionBox(JSContext* cx, TraceListNode* traceListHead,
isGetter_(fun->isGetter()),
isSetter_(fun->isSetter()),
isMethod_(fun->isMethod()),
isInterpreted_(fun->isInterpreted()),
isInterpretedLazy_(fun->isInterpretedLazy()),
nargs_(0),
kind_(fun->kind()),
explicitName_(fun->explicitName()) {
// Functions created at parse time may be set singleton after parsing and

Просмотреть файл

@ -394,11 +394,6 @@ class FunctionBox : public ObjectBox, public SharedContext {
bool isSetter_ : 1;
bool isMethod_ : 1;
bool isInterpreted_ : 1;
bool isInterpretedLazy_ : 1;
size_t nargs_;
JSFunction::FunctionKind kind_;
JSAtom* explicitName_;
@ -443,13 +438,7 @@ class FunctionBox : public ObjectBox, public SharedContext {
void finish();
JSFunction* function() const { return &object()->as<JSFunction>(); }
void clobberFunction(JSFunction* function) {
gcThing = function;
// After clobbering, these flags need to be updated
setIsInterpreted(function->isInterpreted());
setIsInterpretedLazy(function->isInterpretedLazy());
}
void clobberFunction(JSFunction* function) { gcThing = function; }
Scope* compilationEnclosingScope() const override {
// This method is used to distinguish the outermost SharedContext. If
@ -535,14 +524,6 @@ class FunctionBox : public ObjectBox, public SharedContext {
bool isSetter() const { return isSetter_; }
bool isMethod() const { return isMethod_; }
bool isInterpreted() const { return isInterpreted_; }
void setIsInterpreted(bool interpreted) { isInterpreted_ = interpreted; }
bool isInterpretedLazy() const { return isInterpretedLazy_; }
void setIsInterpretedLazy(bool interpretedLazy) { isInterpretedLazy_ = interpretedLazy; }
size_t nargs() const { return nargs_; }
void setArgCount(size_t args) { nargs_ = args; }
JSFunction::FunctionKind kind() { return kind_; }
JSAtom* explicitName() const { return function()->explicitName(); }

Просмотреть файл

@ -7107,7 +7107,7 @@ static bool DoCompileAsmJS(JSContext* cx, AsmJSParser<Unit>& parser,
// asm.js module function. Special cases in the bytecode emitter avoid
// generating bytecode for asm.js functions, allowing this asm.js module
// function to be the finished result.
MOZ_ASSERT(funbox->isInterpreted());
MOZ_ASSERT(funbox->function()->isInterpreted());
funbox->clobberFunction(moduleFun);
// Success! Write to the console with a "warning" message indicating