diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2013-10-18 14:02:56 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-20 21:11:43 +0200 |
commit | 6b2b62e903e1207255b0652b728ecaee6d51aea9 (patch) | |
tree | c832e832680f9d9fe21fc3eda8f7589efd78362a /src/qml/compiler/qv4codegen_p.h | |
parent | 9fd4591a61df467362fa2f17cc2d506efd6bece3 (diff) |
Cleanup: Avoid unnecessary irModule->functions.indexOf calls
With a growing number of functions per module, these calls become
expensive and are unnecessary. defineFunction in the code generator
can simply return the correct index right away.
Change-Id: I8ab56a3083bf215674a1b46c502b415be694e465
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4codegen_p.h')
-rw-r--r-- | src/qml/compiler/qv4codegen_p.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/qml/compiler/qv4codegen_p.h b/src/qml/compiler/qv4codegen_p.h index 2da65fae79..66b80c377b 100644 --- a/src/qml/compiler/qv4codegen_p.h +++ b/src/qml/compiler/qv4codegen_p.h @@ -75,13 +75,13 @@ public: QmlBinding }; - V4IR::Function *generateFromProgram(const QString &fileName, + void generateFromProgram(const QString &fileName, const QString &sourceCode, AST::Program *ast, V4IR::Module *module, CompilationMode mode = GlobalCode, const QStringList &inheritedLocals = QStringList()); - V4IR::Function *generateFromFunctionExpression(const QString &fileName, + void generateFromFunctionExpression(const QString &fileName, const QString &sourceCode, AST::FunctionExpression *ast, V4IR::Module *module); @@ -283,10 +283,11 @@ protected: void move(V4IR::Expr *target, V4IR::Expr *source, V4IR::AluOp op = V4IR::OpInvalid); void cjump(V4IR::Expr *cond, V4IR::BasicBlock *iftrue, V4IR::BasicBlock *iffalse); - V4IR::Function *defineFunction(const QString &name, AST::Node *ast, - AST::FormalParameterList *formals, - AST::SourceElements *body, - const QStringList &inheritedLocals = QStringList()); + // Returns index in _module->functions + int defineFunction(const QString &name, AST::Node *ast, + AST::FormalParameterList *formals, + AST::SourceElements *body, + const QStringList &inheritedLocals = QStringList()); void unwindException(ScopeAndFinally *outest); |