diff options
author | Robin Burchell <robin.burchell@viroteck.net> | 2015-01-10 22:12:29 +0100 |
---|---|---|
committer | Robin Burchell <robin.burchell@viroteck.net> | 2015-01-17 04:30:35 +0100 |
commit | b974fac576b620436af64ad8b617f2276b756a05 (patch) | |
tree | c1032a2d49f319bc88b50d1a159a597b49bd588f /src/qml/compiler | |
parent | 498d4322ce87b20a798d4c9fbf4f7d84c1730486 (diff) |
Implement DefUses::Temps with a QVarLengthArray.
Avoiding heap allocations here shaves 100ms or so off the optimizer runtime.
Change-Id: If00c757532ffe90f2fa9c62dc999bb69e25bb71c
Task-number: QTBUG-43719
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
Diffstat (limited to 'src/qml/compiler')
-rw-r--r-- | src/qml/compiler/qv4ssa.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/qml/compiler/qv4ssa.cpp b/src/qml/compiler/qv4ssa.cpp index c0a14a5c80..f47839f061 100644 --- a/src/qml/compiler/qv4ssa.cpp +++ b/src/qml/compiler/qv4ssa.cpp @@ -1073,10 +1073,7 @@ public: private: std::vector<DefUse> _defUses; - class Temps: public QVector<Temp> { - public: - Temps() { reserve(4); } - }; + typedef QVarLengthArray<Temp, 4> Temps; std::vector<Temps> _usesPerStatement; void ensure(Temp *newTemp) @@ -1219,7 +1216,7 @@ public: ensure(s); } - const QVector<Temp> &usedVars(Stmt *s) const + const Temps &usedVars(Stmt *s) const { Q_ASSERT(s->id() >= 0); Q_ASSERT(static_cast<unsigned>(s->id()) < _usesPerStatement.size()); |