aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4isel_moth.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2014-01-31 14:58:14 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-31 23:02:23 +0100
commit3408bd9d08630687515401cfaadaf818912d72d7 (patch)
treebe83f9c1b3ba7508267bf9e99b6a2c8eb6830892 /src/qml/compiler/qv4isel_moth.cpp
parent74cc0db2ce84ff2c54a9650d475a1d65adc45a94 (diff)
Use lookups for get/setElement in the interpreter
Significantly speeds up crypto.js Change-Id: Icd3d59bea3fe4427e93e9e10e3526178e8de859c Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4isel_moth.cpp')
-rw-r--r--src/qml/compiler/qv4isel_moth.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/qml/compiler/qv4isel_moth.cpp b/src/qml/compiler/qv4isel_moth.cpp
index bf9af178fe..c8f15ae0b7 100644
--- a/src/qml/compiler/qv4isel_moth.cpp
+++ b/src/qml/compiler/qv4isel_moth.cpp
@@ -546,6 +546,15 @@ void InstructionSelection::getQObjectProperty(V4IR::Expr *base, int propertyInde
void InstructionSelection::getElement(V4IR::Expr *base, V4IR::Expr *index, V4IR::Temp *target)
{
+ if (useFastLookups) {
+ Instruction::LoadElementLookup load;
+ load.lookup = registerIndexedGetterLookup();
+ load.base = getParam(base);
+ load.index = getParam(index);
+ load.result = getResultParam(target);
+ addInstruction(load);
+ return;
+ }
Instruction::LoadElement load;
load.base = getParam(base);
load.index = getParam(index);
@@ -556,6 +565,15 @@ void InstructionSelection::getElement(V4IR::Expr *base, V4IR::Expr *index, V4IR:
void InstructionSelection::setElement(V4IR::Expr *source, V4IR::Expr *targetBase,
V4IR::Expr *targetIndex)
{
+ if (useFastLookups) {
+ Instruction::StoreElementLookup store;
+ store.lookup = registerIndexedSetterLookup();
+ store.base = getParam(targetBase);
+ store.index = getParam(targetIndex);
+ store.source = getParam(source);
+ addInstruction(store);
+ return;
+ }
Instruction::StoreElement store;
store.base = getParam(targetBase);
store.index = getParam(targetIndex);