diff options
Diffstat (limited to 'src/qml/compiler/qv4jsir_p.h')
-rw-r--r-- | src/qml/compiler/qv4jsir_p.h | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/src/qml/compiler/qv4jsir_p.h b/src/qml/compiler/qv4jsir_p.h index 04bc3d86e5..f7c7b76ea8 100644 --- a/src/qml/compiler/qv4jsir_p.h +++ b/src/qml/compiler/qv4jsir_p.h @@ -61,6 +61,7 @@ #include <QtCore/QBitArray> #include <QtCore/qurl.h> #include <QtCore/QVarLengthArray> +#include <QtCore/QDateTime> #include <qglobal.h> #if defined(CONST) && defined(Q_OS_WIN) @@ -507,6 +508,16 @@ struct Q_AUTOTEST_EXPORT Temp: Expr { , memberResolver(0) {} + Temp(Type type, Kind kind, unsigned index) + : Expr(TempExpr) + , index(index) + , isReadOnly(0) + , kind(kind) + , memberResolver(0) + { + this->type = type; + } + void init(unsigned kind, unsigned index) { this->index = index; @@ -932,7 +943,7 @@ struct Q_QML_PRIVATE_EXPORT Module { QVector<Function *> functions; Function *rootFunction; QString fileName; - qint64 sourceTimeStamp; + QDateTime sourceTimeStamp; bool isQmlModule; // implies rootFunction is always 0 uint unitFlags; // flags merged into CompiledData::Unit::flags #ifdef QT_NO_QML_DEBUGGER @@ -945,7 +956,6 @@ struct Q_QML_PRIVATE_EXPORT Module { Module(bool debugMode) : rootFunction(0) - , sourceTimeStamp(0) , isQmlModule(false) , unitFlags(0) #ifndef QT_NO_QML_DEBUGGER @@ -1342,6 +1352,31 @@ struct Function { int getNewStatementId() { return _statementCount++; } int statementCount() const { return _statementCount; } + bool canUseSimpleCall() const { + return nestedFunctions.isEmpty() && + locals.isEmpty() && formals.size() <= QV4::Global::ReservedArgumentCount && + !hasTry && !hasWith && !isNamedExpression && !usesArgumentsObject && !hasDirectEval; + } + + bool argLocalRequiresWriteBarrier(ArgLocal *al) const { + uint scope = al->scope; + const IR::Function *f = this; + while (scope) { + f = f->outer; + --scope; + } + return !f->canUseSimpleCall(); + } + int localsCountForScope(ArgLocal *al) const { + uint scope = al->scope; + const IR::Function *f = this; + while (scope) { + f = f->outer; + --scope; + } + return f->locals.size(); + } + private: BasicBlock *getOrCreateBasicBlock(int index); void setStatementCount(int cnt); @@ -1410,6 +1445,7 @@ public: ArgLocal *newArgLocal = f->New<ArgLocal>(); newArgLocal->init(argLocal->kind, argLocal->index, argLocal->scope); newArgLocal->type = argLocal->type; + newArgLocal->isArgumentsOrEval = argLocal->isArgumentsOrEval; return newArgLocal; } |