aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/v4/qv4compiler.cpp
diff options
context:
space:
mode:
authorRoberto Raggi <roberto.raggi@nokia.com>2011-11-10 10:39:56 +0100
committerQt by Nokia <qt-info@nokia.com>2011-11-14 16:39:25 +0100
commit2ad0e1978347dd7c1782a9edb5047351c3fb6706 (patch)
tree9e385a100ee13127f68834074edecab7a3d14384 /src/declarative/qml/v4/qv4compiler.cpp
parent83029e5efe6c200def9f2bb4e116fd22bb220f52 (diff)
Use the property cache when compiling the V4 instructions.
Change-Id: Ifca6166328e7c20707fef153fa2b960da3a00a98 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
Diffstat (limited to 'src/declarative/qml/v4/qv4compiler.cpp')
-rw-r--r--src/declarative/qml/v4/qv4compiler.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/declarative/qml/v4/qv4compiler.cpp b/src/declarative/qml/v4/qv4compiler.cpp
index 31a0a1e63f..8fdfa74ac4 100644
--- a/src/declarative/qml/v4/qv4compiler.cpp
+++ b/src/declarative/qml/v4/qv4compiler.cpp
@@ -277,7 +277,7 @@ void QV4CompilerPrivate::visitName(IR::Name *e)
Instr::LoadId instr;
instr.reg = currentReg;
- instr.index = e->index;
+ instr.index = e->idObject->idIndex;
gen(instr);
_subscribeName << QLatin1String("$$$ID_") + *e->id;
@@ -320,10 +320,13 @@ void QV4CompilerPrivate::visitName(IR::Name *e)
case IR::Name::Property: {
_subscribeName << *e->id;
- QMetaProperty prop = e->meta->property(e->index);
- int fastFetchIndex = QDeclarativeFastProperties::instance()->accessorIndexForProperty(e->meta, e->index);
+ if (e->property->coreIndex == -1) {
+ QMetaProperty prop;
+ e->property->load(prop, QDeclarativeEnginePrivate::get(engine));
+ }
+ int fastFetchIndex = QDeclarativeFastProperties::instance()->accessorIndexForProperty(e->meta, e->property->coreIndex);
- const int propTy = prop.userType();
+ const int propTy = e->property->propType;
QDeclarativeRegisterType regType;
switch (propTy) {
@@ -366,17 +369,17 @@ void QV4CompilerPrivate::visitName(IR::Name *e)
fetch.valueType = regType;
gen(fetch);
} else {
- if (blockNeedsSubscription(_subscribeName) && prop.hasNotifySignal() && prop.notifySignalIndex() != -1) {
+ if (blockNeedsSubscription(_subscribeName) && e->property->notifyIndex != -1) {
Instr::Subscribe sub;
sub.reg = currentReg;
sub.offset = subscriptionIndex(_subscribeName);
- sub.index = prop.notifySignalIndex();
+ sub.index = e->property->notifyIndex;
gen(sub);
}
Instr::Fetch fetch;
fetch.reg = currentReg;
- fetch.index = e->index;
+ fetch.index = e->property->coreIndex;
fetch.exceptionId = exceptionId(e->line, e->column);
fetch.valueType = regType;
gen(fetch);