aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4compiler.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2019-01-03 15:44:34 +0100
committerSimon Hausmann <simon.hausmann@qt.io>2019-03-20 09:16:52 +0000
commit5cfccf30898aed5ca96c0f8779b0f8a1117118b7 (patch)
tree361b7847136122d42b1647b4debdafa184baebb5 /src/qml/compiler/qv4compiler.cpp
parentc9e6251cc8dfcf002f64b07e48dd68b7edd3f630 (diff)
Remove dead compile time QML context/scope property and id object code
After enabling lookups in QML files, we can remove all the code that tries to deal with (type) compile time detection of access to id objects and properties of the scope/context object. This also allows removing quite a bit of run-time code paths and even byte code instructions. Task-number: QTBUG-69898 Change-Id: I7b26d7983393594a3ef56466d3e633f1822b76f4 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4compiler.cpp')
-rw-r--r--src/qml/compiler/qv4compiler.cpp45
1 files changed, 1 insertions, 44 deletions
diff --git a/src/qml/compiler/qv4compiler.cpp b/src/qml/compiler/qv4compiler.cpp
index a3c9347c67..4d85f25d4b 100644
--- a/src/qml/compiler/qv4compiler.cpp
+++ b/src/qml/compiler/qv4compiler.cpp
@@ -427,28 +427,6 @@ void QV4::Compiler::JSUnitGenerator::writeFunction(char *f, QV4::Compiler::Conte
function->nRegisters = irFunction->registerCountInFunction;
- function->nDependingIdObjects = 0;
- function->nDependingContextProperties = 0;
- function->nDependingScopeProperties = 0;
-
- if (!irFunction->idObjectDependencies.isEmpty()) {
- function->nDependingIdObjects = irFunction->idObjectDependencies.count();
- Q_ASSERT(function->dependingIdObjectsOffset() == currentOffset);
- currentOffset += function->nDependingIdObjects * sizeof(quint32);
- }
-
- if (!irFunction->contextObjectPropertyDependencies.isEmpty()) {
- function->nDependingContextProperties = irFunction->contextObjectPropertyDependencies.count();
- Q_ASSERT(function->dependingContextPropertiesOffset() == currentOffset);
- currentOffset += function->nDependingContextProperties * sizeof(quint32) * 2;
- }
-
- if (!irFunction->scopeObjectPropertyDependencies.isEmpty()) {
- function->nDependingScopeProperties = irFunction->scopeObjectPropertyDependencies.count();
- Q_ASSERT(function->dependingScopePropertiesOffset() == currentOffset);
- currentOffset += function->nDependingScopeProperties * sizeof(quint32) * 2;
- }
-
function->location.line = irFunction->line;
function->location.column = irFunction->column;
@@ -468,25 +446,6 @@ void QV4::Compiler::JSUnitGenerator::writeFunction(char *f, QV4::Compiler::Conte
// write line numbers
memcpy(f + function->lineNumberOffset(), irFunction->lineNumberMapping.constData(), irFunction->lineNumberMapping.size()*sizeof(CompiledData::CodeOffsetToLine));
- // write QML dependencies
- quint32_le *writtenDeps = (quint32_le *)(f + function->dependingIdObjectsOffset());
- for (int id : irFunction->idObjectDependencies) {
- Q_ASSERT(id >= 0);
- *writtenDeps++ = static_cast<quint32>(id);
- }
-
- writtenDeps = (quint32_le *)(f + function->dependingContextPropertiesOffset());
- for (auto property : irFunction->contextObjectPropertyDependencies) {
- *writtenDeps++ = property.key(); // property index
- *writtenDeps++ = property.value(); // notify index
- }
-
- writtenDeps = (quint32_le *)(f + function->dependingScopePropertiesOffset());
- for (auto property : irFunction->scopeObjectPropertyDependencies) {
- *writtenDeps++ = property.key(); // property index
- *writtenDeps++ = property.value(); // notify index
- }
-
// write byte code
memcpy(f + function->codeOffset, irFunction->code.constData(), irFunction->code.size());
}
@@ -683,10 +642,8 @@ QV4::CompiledData::Unit QV4::Compiler::JSUnitGenerator::generateHeader(QV4::Comp
Context *f = module->functions.at(i);
blockAndFunctionOffsets[i] = nextOffset;
- const int qmlIdDepsCount = f->idObjectDependencies.count();
- const int qmlPropertyDepsCount = f->scopeObjectPropertyDependencies.count() + f->contextObjectPropertyDependencies.count();
quint32 size = QV4::CompiledData::Function::calculateSize(f->arguments.size(), f->locals.size(), f->lineNumberMapping.size(), f->nestedContexts.size(),
- qmlIdDepsCount, qmlPropertyDepsCount, f->code.size());
+ f->code.size());
functionSize += size - f->code.size();
nextOffset += size;
}