Instr::LoadId instr;
instr.reg = currentReg;
- instr.index = e->index;
+ instr.index = e->idObject->idIndex;
gen(instr);
_subscribeName << QLatin1String("$$$ID_") + *e->id;
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) {
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);
this->id = id;
this->symbol = symbol;
this->ptr = 0;
- this->index = -1;
+ this->property = 0;
this->storage = MemberStorage;
this->builtin = NoBuiltinSymbol;
this->line = line;
return e;
}
-Name *BasicBlock::SYMBOL(Type type, const QString &id, const QMetaObject *meta, int index, Name::Storage storage,
+Name *BasicBlock::SYMBOL(Type type, const QString &id, const QMetaObject *meta, QDeclarativePropertyData *property, Name::Storage storage,
quint32 line, quint32 column)
{
- Name *name = SYMBOL(/*base = */ 0, type, id, meta, index, line, column);
+ Name *name = SYMBOL(/*base = */ 0, type, id, meta, property, line, column);
name->storage = storage;
return name;
}
-Name *BasicBlock::SYMBOL(Name *base, Type type, const QString &id, const QMetaObject *meta, int index, Name::Storage storage,
+Name *BasicBlock::SYMBOL(Name *base, Type type, const QString &id, const QMetaObject *meta, QDeclarativePropertyData *property, Name::Storage storage,
quint32 line, quint32 column)
{
Name *name = function->pool->New<Name>();
name->init(base, type, function->newString(id),
Name::Property, line, column);
name->meta = meta;
- name->index = index;
+ name->property = property;
name->storage = storage;
return name;
}
-Name *BasicBlock::SYMBOL(Name *base, Type type, const QString &id, const QMetaObject *meta, int index,
+Name *BasicBlock::SYMBOL(Name *base, Type type, const QString &id, const QMetaObject *meta, QDeclarativePropertyData *property,
quint32 line, quint32 column)
{
Name *name = function->pool->New<Name>();
name->init(base, type, function->newString(id),
Name::Property, line, column);
name->meta = meta;
- name->index = index;
+ name->property = property;
return name;
}
function->newString(id),
Name::IdObject, line, column);
name->idObject = object;
- name->index = object->idIndex;
+ name->property = 0;
name->storage = Name::IdStorage;
return name;
}
const QDeclarativeType *declarativeType;
const QDeclarativeScript::Object *idObject;
};
- int index;
+ QDeclarativePropertyData *property;
Storage storage;
BuiltinSymbol builtin;
quint32 line;
Name *NAME(const QString &id, quint32 line, quint32 column);
Name *NAME(Name *base, const QString &id, quint32 line, quint32 column);
- Name *SYMBOL(Type type, const QString &id, const QMetaObject *meta, int index, Name::Storage storage, quint32 line, quint32 column);
- Name *SYMBOL(Name *base, Type type, const QString &id, const QMetaObject *meta, int index, quint32 line, quint32 column);
- Name *SYMBOL(Name *base, Type type, const QString &id, const QMetaObject *meta, int index, Name::Storage storage, quint32 line, quint32 column);
+ Name *SYMBOL(Type type, const QString &id, const QMetaObject *meta, QDeclarativePropertyData *property, Name::Storage storage, quint32 line, quint32 column);
+ Name *SYMBOL(Name *base, Type type, const QString &id, const QMetaObject *meta, QDeclarativePropertyData *property, quint32 line, quint32 column);
+ Name *SYMBOL(Name *base, Type type, const QString &id, const QMetaObject *meta, QDeclarativePropertyData *property, Name::Storage storage, quint32 line, quint32 column);
Name *ID_OBJECT(const QString &id, const QDeclarativeScript::Object *object, quint32 line, quint32 column);
Name *ATTACH_TYPE(const QString &id, const QDeclarativeType *attachType, Name::Storage storage, quint32 line, quint32 column);
if (data && !data->isFunction()) {
IR::Type irType = irTypeFromVariantType(data->propType, m_engine, metaObject);
- _expr.code = _block->SYMBOL(irType, name, metaObject, data->coreIndex, IR::Name::ScopeStorage, line, column);
+ _expr.code = _block->SYMBOL(irType, name, metaObject, data, IR::Name::ScopeStorage, line, column);
found = true;
}
}
if (data && !data->isFunction()) {
IR::Type irType = irTypeFromVariantType(data->propType, m_engine, metaObject);
- _expr.code = _block->SYMBOL(irType, name, metaObject, data->coreIndex, IR::Name::RootStorage, line, column);
+ _expr.code = _block->SYMBOL(irType, name, metaObject, data, IR::Name::RootStorage, line, column);
found = true;
}
}
}
IR::Type irType = irTypeFromVariantType(data->propType, m_engine, attachedMeta);
- _expr.code = _block->SYMBOL(baseName, irType, name, attachedMeta, data->coreIndex, line, column);
+ _expr.code = _block->SYMBOL(baseName, irType, name, attachedMeta, data, line, column);
}
break;
IR::Type irType = irTypeFromVariantType(data->propType, m_engine, idObject->metaObject());
_expr.code = _block->SYMBOL(baseName, irType, name,
- idObject->metaObject(), data->coreIndex, line, column);
+ idObject->metaObject(), data, line, column);
}
break;
case IR::Name::Property:
if (baseName->type == IR::ObjectType) {
- const QMetaObject *m =
- m_engine->metaObjectForType(baseName->meta->property(baseName->index).userType());
- QDeclarativePropertyCache *cache = m_engine->cache(m);
-
- QDeclarativePropertyData *data = cache->property(name);
-
+ QDeclarativePropertyData *data = baseName->property;
if (!data || data->isFunction())
return false; // Don't support methods (or non-existing properties ;)
IR::Type irType = irTypeFromVariantType(data->propType, m_engine, baseName->meta);
_expr.code = _block->SYMBOL(baseName, irType, name,
- baseName->meta, data->coreIndex, line, column);
+ baseName->meta, data, line, column);
}
break;