From d5ab38b606fa63e6da1425b6fa607f55b3877007 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 4 Jul 2017 09:58:43 +0200 Subject: Properly save/restore the QML temps between functions This only worked by chance before, as they always for the same temp indices. Change-Id: Ib2c8b912fa1dee8b1f12c8f9d895bc023bc265d3 Reviewed-by: Erik Verbruggen --- src/qml/compiler/qqmlirbuilder.cpp | 15 +++++++++++++++ src/qml/compiler/qqmlirbuilder_p.h | 4 ++++ src/qml/compiler/qv4codegen_p.h | 6 +++--- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/qml/compiler/qqmlirbuilder.cpp b/src/qml/compiler/qqmlirbuilder.cpp index 312ddd753b..f34a797508 100644 --- a/src/qml/compiler/qqmlirbuilder.cpp +++ b/src/qml/compiler/qqmlirbuilder.cpp @@ -1650,6 +1650,21 @@ QVector JSCodeGen::generateJSCodeForFunctionsAndBindings(const QListruntimeFunctions QVector generateJSCodeForFunctionsAndBindings(const QList &functions); + int defineFunction(const QString &name, AST::Node *ast, + AST::FormalParameterList *formals, + AST::SourceElements *body) override; + protected: void beginFunctionBodyHook() override; Reference fallbackNameLookup(const QString &name) override; diff --git a/src/qml/compiler/qv4codegen_p.h b/src/qml/compiler/qv4codegen_p.h index 93d3ad85c2..4170001954 100644 --- a/src/qml/compiler/qv4codegen_p.h +++ b/src/qml/compiler/qv4codegen_p.h @@ -345,9 +345,9 @@ protected: uint registerGlobalGetterLookup(int nameIndex) { return jsUnitGenerator->registerGlobalGetterLookup(nameIndex); } // Returns index in _module->functions - int defineFunction(const QString &name, AST::Node *ast, - AST::FormalParameterList *formals, - AST::SourceElements *body); + virtual int defineFunction(const QString &name, AST::Node *ast, + AST::FormalParameterList *formals, + AST::SourceElements *body); void statement(AST::Statement *ast); void statement(AST::ExpressionNode *ast); -- cgit v1.2.3