aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4compileddata.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2018-07-27 11:36:43 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2018-07-31 17:08:57 +0000
commit77449db6e086e8ac6594c432fede027656be0da0 (patch)
tree7bc9daff55d4480148488030f797ed517233736e /src/qml/compiler/qv4compileddata.cpp
parent71c66d4b41be95b44ffa0d9bbbf04164f74bd23a (diff)
Encapsulate access to CompiledData::Object and CompiledData::Import
This will make it easier to move the data out of CompiledData::Unit and into a separate data structure. Change-Id: I32e6233a66f2279b44cc06ef7c3505db4a565f98 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4compileddata.cpp')
-rw-r--r--src/qml/compiler/qv4compileddata.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/qml/compiler/qv4compileddata.cpp b/src/qml/compiler/qv4compileddata.cpp
index af0cfedf5b..767e8dfeb3 100644
--- a/src/qml/compiler/qv4compileddata.cpp
+++ b/src/qml/compiler/qv4compileddata.cpp
@@ -270,10 +270,10 @@ void CompilationUnit::markObjects(QV4::MarkStack *markStack)
IdentifierHash CompilationUnit::createNamedObjectsPerComponent(int componentObjectIndex)
{
IdentifierHash namedObjectCache(engine);
- const CompiledData::Object *component = data->objectAt(componentObjectIndex);
+ const CompiledData::Object *component = objectAt(componentObjectIndex);
const quint32_le *namedObjectIndexPtr = component->namedObjectsInComponentTable();
for (quint32 i = 0; i < component->nNamedObjectsInComponent; ++i, ++namedObjectIndexPtr) {
- const CompiledData::Object *namedObject = data->objectAt(*namedObjectIndexPtr);
+ const CompiledData::Object *namedObject = objectAt(*namedObjectIndexPtr);
namedObjectCache.add(runtimeStrings[namedObject->idNameIndex], namedObject->id);
}
return *namedObjectsPerComponentCache.insert(componentObjectIndex, namedObjectCache);
@@ -304,8 +304,8 @@ void CompilationUnit::finalizeCompositeType(QQmlEnginePrivate *qmlEngine)
int bindingCount = 0;
int parserStatusCount = 0;
int objectCount = 0;
- for (quint32 i = 0; i < data->nObjects; ++i) {
- const QV4::CompiledData::Object *obj = data->objectAt(i);
+ for (quint32 i = 0, count = this->objectCount(); i < count; ++i) {
+ const QV4::CompiledData::Object *obj = objectAt(i);
bindingCount += obj->nBindings;
if (auto *typeRef = resolvedTypes.value(obj->inheritedTypeNameIndex)) {
if (typeRef->type.isValid()) {