diff options
author | Lars Knoll <lars.knoll@digia.com> | 2014-01-17 12:19:34 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-20 21:14:35 +0100 |
commit | 393108500832dcefa4c4def442a08f20d3fbc4cd (patch) | |
tree | 64676214630008b9f5434c933590d9adf9baf094 /src/qml/compiler/qv4compiler.cpp | |
parent | bf6191f090b326eb0776cd4e921ddb56c8daa8a9 (diff) |
Use lookups for indexed accesses
This speeds up reading array data from objects significantly.
Change-Id: I5d17a7b3e7583a16dc76d1ee6cbc1d7134e4c2fa
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4compiler.cpp')
-rw-r--r-- | src/qml/compiler/qv4compiler.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/qml/compiler/qv4compiler.cpp b/src/qml/compiler/qv4compiler.cpp index 9041b04837..d18c43a969 100644 --- a/src/qml/compiler/qv4compiler.cpp +++ b/src/qml/compiler/qv4compiler.cpp @@ -72,6 +72,15 @@ int QV4::Compiler::JSUnitGenerator::getStringId(const QString &string) const return stringToId.value(string); } +uint QV4::Compiler::JSUnitGenerator::registerIndexedGetterLookup() +{ + CompiledData::Lookup l; + l.type_and_flags = CompiledData::Lookup::Type_IndexedGetter; + l.nameIndex = 0; + lookups << l; + return lookups.size() - 1; +} + uint QV4::Compiler::JSUnitGenerator::registerGetterLookup(const QString &name) { CompiledData::Lookup l; @@ -81,6 +90,7 @@ uint QV4::Compiler::JSUnitGenerator::registerGetterLookup(const QString &name) return lookups.size() - 1; } + uint QV4::Compiler::JSUnitGenerator::registerSetterLookup(const QString &name) { CompiledData::Lookup l; |