diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-08-22 17:17:57 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-08-22 17:17:57 +0200 |
commit | f1aff1f2d495562460a87d351e62c06109045a3a (patch) | |
tree | 93e4659421a3dc1fc664b539bf7e48ce28f64e84 /src/qml/jsruntime | |
parent | 842ada7b04d68cd37df2556bf50b48d8a5f39ec4 (diff) | |
parent | 46ed14da325c6c0382c0bc54cacc347d2d7f2b0a (diff) |
Merge remote-tracking branch 'origin/dev' into wip/new-backend
Change-Id: Iff06429f948ac6cdec77a9e5bb8c5375c56fe705
Diffstat (limited to 'src/qml/jsruntime')
-rw-r--r-- | src/qml/jsruntime/qv4arraydata_p.h | 12 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4engine.cpp | 6 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4function.cpp | 13 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4lookup.cpp | 5 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4memberdata_p.h | 4 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4qmlcontext.cpp | 4 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4qobjectwrapper.cpp | 2 |
7 files changed, 24 insertions, 22 deletions
diff --git a/src/qml/jsruntime/qv4arraydata_p.h b/src/qml/jsruntime/qv4arraydata_p.h index 1d895c90c5..e1de2e82e6 100644 --- a/src/qml/jsruntime/qv4arraydata_p.h +++ b/src/qml/jsruntime/qv4arraydata_p.h @@ -107,7 +107,7 @@ DECLARE_HEAP_OBJECT(ArrayData, Base) { Heap::ArrayData *arrayData; uint index; - void set(ExecutionEngine *e, Value newVal) { + void set(EngineBase *e, Value newVal) { arrayData->values.set(e, index, newVal); } const Value *operator->() const { return &arrayData->values[index]; } @@ -123,7 +123,7 @@ DECLARE_HEAP_OBJECT(ArrayData, Base) { return vtable()->get(this, i); } inline bool getProperty(uint index, Property *p, PropertyAttributes *attrs); - inline void setProperty(ExecutionEngine *e, uint index, const Property *p); + inline void setProperty(EngineBase *e, uint index, const Property *p); inline Index getValueOrSetter(uint index, PropertyAttributes *attrs); inline PropertyAttributes attributes(uint i) const; @@ -135,7 +135,7 @@ DECLARE_HEAP_OBJECT(ArrayData, Base) { return vtable()->length(this); } - void setArrayData(ExecutionEngine *e, uint index, Value newVal) { + void setArrayData(EngineBase *e, uint index, Value newVal) { values.set(e, index, newVal); } @@ -146,7 +146,7 @@ V4_ASSERT_IS_TRIVIAL(ArrayData) struct SimpleArrayData : public ArrayData { uint mappedIndex(uint index) const { return (index + offset) % values.alloc; } const Value &data(uint index) const { return values[mappedIndex(index)]; } - void setData(ExecutionEngine *e, uint index, Value newVal) { + void setData(EngineBase *e, uint index, Value newVal) { values.set(e, mappedIndex(index), newVal); } @@ -197,7 +197,7 @@ struct Q_QML_EXPORT ArrayData : public Managed PropertyAttributes *attrs() const { return d()->attrs; } void setAttrs(PropertyAttributes *a) { d()->attrs = a; } const Value *arrayData() const { return d()->values.data(); } - void setArrayData(ExecutionEngine *e, uint index, Value newVal) { + void setArrayData(EngineBase *e, uint index, Value newVal) { d()->setArrayData(e, index, newVal); } @@ -310,7 +310,7 @@ bool ArrayData::getProperty(uint index, Property *p, PropertyAttributes *attrs) return true; } -void ArrayData::setProperty(QV4::ExecutionEngine *e, uint index, const Property *p) +void ArrayData::setProperty(QV4::EngineBase *e, uint index, const Property *p) { uint mapped = mappedIndex(index); Q_ASSERT(mapped != UINT_MAX); diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp index 50c82e677a..f5effc8c3b 100644 --- a/src/qml/jsruntime/qv4engine.cpp +++ b/src/qml/jsruntime/qv4engine.cpp @@ -763,10 +763,10 @@ ReturnedValue ExecutionEngine::qmlSingletonWrapper(String *name) QQmlTypeNameCache::Result r = ctx->imports->query(name); Q_ASSERT(r.isValid()); - Q_ASSERT(r.type); - Q_ASSERT(r.type->isSingleton()); + Q_ASSERT(r.type.isValid()); + Q_ASSERT(r.type.isSingleton()); - QQmlType::SingletonInstanceInfo *siinfo = r.type->singletonInstanceInfo(); + QQmlType::SingletonInstanceInfo *siinfo = r.type.singletonInstanceInfo(); QQmlEngine *e = qmlEngine(); siinfo->init(e); diff --git a/src/qml/jsruntime/qv4function.cpp b/src/qml/jsruntime/qv4function.cpp index c6533054ce..681a5ba1cf 100644 --- a/src/qml/jsruntime/qv4function.cpp +++ b/src/qml/jsruntime/qv4function.cpp @@ -45,6 +45,7 @@ #include "qv4engine_p.h" #include "qv4lookup_p.h" #include <private/qv4mm_p.h> +#include <private/qv4identifiertable_p.h> QT_BEGIN_NAMESPACE @@ -62,13 +63,13 @@ Function::Function(ExecutionEngine *engine, CompiledData::CompilationUnit *unit, internalClass = engine->internalClasses[EngineBase::Class_CallContext]; // first locals - const CompiledData::LEUInt32 *localsIndices = compiledFunction->localsTable(); + const quint32_le *localsIndices = compiledFunction->localsTable(); for (quint32 i = 0; i < compiledFunction->nLocals; ++i) - internalClass = internalClass->addMember(compilationUnit->runtimeStrings[localsIndices[i]]->identifier, Attr_NotConfigurable); + internalClass = internalClass->addMember(engine->identifierTable->identifier(compilationUnit->runtimeStrings[localsIndices[i]]), Attr_NotConfigurable); - const CompiledData::LEUInt32 *formalsIndices = compiledFunction->formalsTable(); + const quint32_le *formalsIndices = compiledFunction->formalsTable(); for (quint32 i = 0; i < compiledFunction->nFormals; ++i) - internalClass = internalClass->addMember(compilationUnit->runtimeStrings[formalsIndices[i]]->identifier, Attr_NotConfigurable); + internalClass = internalClass->addMember(engine->identifierTable->identifier(compilationUnit->runtimeStrings[formalsIndices[i]]), Attr_NotConfigurable); nFormals = compiledFunction->nFormals; @@ -101,9 +102,9 @@ void Function::updateInternalClass(ExecutionEngine *engine, const QList<QByteArr } nFormals = parameters.size(); - const CompiledData::LEUInt32 *localsIndices = compiledFunction->localsTable(); + const quint32_le *localsIndices = compiledFunction->localsTable(); for (quint32 i = 0; i < compiledFunction->nLocals; ++i) - internalClass = internalClass->addMember(compilationUnit->runtimeStrings[localsIndices[i]]->identifier, Attr_NotConfigurable); + internalClass = internalClass->addMember(engine->identifierTable->identifier(compilationUnit->runtimeStrings[localsIndices[i]]), Attr_NotConfigurable); canUseSimpleCall = false; } diff --git a/src/qml/jsruntime/qv4lookup.cpp b/src/qml/jsruntime/qv4lookup.cpp index 0fa8e1fc3d..429623e482 100644 --- a/src/qml/jsruntime/qv4lookup.cpp +++ b/src/qml/jsruntime/qv4lookup.cpp @@ -40,6 +40,7 @@ #include "qv4functionobject_p.h" #include "qv4scopedvalue_p.h" #include "qv4string_p.h" +#include <private/qv4identifiertable_p.h> QT_BEGIN_NAMESPACE @@ -49,7 +50,7 @@ using namespace QV4; ReturnedValue Lookup::lookup(const Value &thisObject, Object *o, PropertyAttributes *attrs) { ExecutionEngine *engine = o->engine(); - Identifier *name = engine->currentStackFrame->v4Function->compilationUnit->runtimeStrings[nameIndex]->identifier; + Identifier *name = engine->identifierTable->identifier(engine->currentStackFrame->v4Function->compilationUnit->runtimeStrings[nameIndex]); int i = 0; Heap::Object *obj = o->d(); while (i < Size && obj) { @@ -85,7 +86,7 @@ ReturnedValue Lookup::lookup(const Object *thisObject, PropertyAttributes *attrs { Heap::Object *obj = thisObject->d(); ExecutionEngine *engine = thisObject->engine(); - Identifier *name = engine->currentStackFrame->v4Function->compilationUnit->runtimeStrings[nameIndex]->identifier; + Identifier *name = engine->identifierTable->identifier(engine->currentStackFrame->v4Function->compilationUnit->runtimeStrings[nameIndex]); int i = 0; while (i < Size && obj) { classList[i] = obj->internalClass; diff --git a/src/qml/jsruntime/qv4memberdata_p.h b/src/qml/jsruntime/qv4memberdata_p.h index 9d333011fc..bae524d088 100644 --- a/src/qml/jsruntime/qv4memberdata_p.h +++ b/src/qml/jsruntime/qv4memberdata_p.h @@ -88,8 +88,8 @@ struct MemberData : Managed const Value &operator[] (uint idx) const { return d()->values[idx]; } const Value *data() const { return d()->values.data(); } - void set(ExecutionEngine *e, uint index, Value v) { d()->values.set(e, index, v); } - void set(ExecutionEngine *e, uint index, Heap::Base *b) { d()->values.set(e, index, b); } + void set(EngineBase *e, uint index, Value v) { d()->values.set(e, index, v); } + void set(EngineBase *e, uint index, Heap::Base *b) { d()->values.set(e, index, b); } inline uint size() const { return d()->values.size; } diff --git a/src/qml/jsruntime/qv4qmlcontext.cpp b/src/qml/jsruntime/qv4qmlcontext.cpp index 70723a97ed..b182e3ab83 100644 --- a/src/qml/jsruntime/qv4qmlcontext.cpp +++ b/src/qml/jsruntime/qv4qmlcontext.cpp @@ -134,7 +134,7 @@ ReturnedValue QQmlContextWrapper::get(const Managed *m, String *name, bool *hasP if (context->imports && name->startsWithUpper()) { // Search for attached properties, enums and imported scripts - QQmlTypeNameCache::Result r = context->imports->query(name); + QQmlTypeNameCache::Result r = context->imports->query(name, QQmlImport::AllowRecursion); if (r.isValid()) { if (hasProperty) @@ -142,7 +142,7 @@ ReturnedValue QQmlContextWrapper::get(const Managed *m, String *name, bool *hasP if (r.scriptIndex != -1) { QV4::ScopedObject scripts(scope, context->importedScripts.valueRef()); return scripts->getIndexed(r.scriptIndex); - } else if (r.type) { + } else if (r.type.isValid()) { return QQmlTypeWrapper::create(v4, scopeObject, r.type); } else if (r.importNamespace) { return QQmlTypeWrapper::create(v4, scopeObject, context->imports, r.importNamespace); diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp index 84b3571069..13cad8c081 100644 --- a/src/qml/jsruntime/qv4qobjectwrapper.cpp +++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp @@ -296,7 +296,7 @@ ReturnedValue QObjectWrapper::getQmlProperty(QQmlContextData *qmlContext, String if (r.isValid()) { if (r.scriptIndex != -1) { return QV4::Encode::undefined(); - } else if (r.type) { + } else if (r.type.isValid()) { return QQmlTypeWrapper::create(v4, d()->object(), r.type, Heap::QQmlTypeWrapper::ExcludeEnums); } else if (r.importNamespace) { |