aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4compiler.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2018-07-20 15:54:53 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2018-07-31 07:28:52 +0000
commit41076956f7d38d9c661ae97111af9834786efa24 (patch)
treecb196b4b7e628991a021784a41d9e82af3c3222f /src/qml/compiler/qv4compiler.cpp
parent2ee5331d8ae73c0abde129eb26df4ca000470007 (diff)
Shrink CompiledData::Function by 8 bytes
We can express the offset to the line number table relative to the locals. Saves ~1.4k with examples/quickcontrols/extras/flat/Content.qml and ~11K RAM with the gallery. Task-number: QTBUG-69588 Change-Id: I802928102b4291e05ff1462226d22303f8a6d35b Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4compiler.cpp')
-rw-r--r--src/qml/compiler/qv4compiler.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/compiler/qv4compiler.cpp b/src/qml/compiler/qv4compiler.cpp
index 252056b2b6..6dbd4a35fb 100644
--- a/src/qml/compiler/qv4compiler.cpp
+++ b/src/qml/compiler/qv4compiler.cpp
@@ -331,7 +331,7 @@ void QV4::Compiler::JSUnitGenerator::writeFunction(char *f, QV4::Compiler::Conte
currentOffset += function->nLocals * sizeof(quint32);
function->nLineNumbers = irFunction->lineNumberMapping.size();
- function->lineNumberOffset = currentOffset;
+ Q_ASSERT(function->lineNumberOffset() == currentOffset);
currentOffset += function->nLineNumbers * sizeof(CompiledData::CodeOffsetToLine);
@@ -376,7 +376,7 @@ void QV4::Compiler::JSUnitGenerator::writeFunction(char *f, QV4::Compiler::Conte
locals[i] = getStringId(irFunction->locals.at(i));
// write line numbers
- memcpy(f + function->lineNumberOffset, irFunction->lineNumberMapping.constData(), irFunction->lineNumberMapping.size()*sizeof(CompiledData::CodeOffsetToLine));
+ memcpy(f + function->lineNumberOffset(), irFunction->lineNumberMapping.constData(), irFunction->lineNumberMapping.size()*sizeof(CompiledData::CodeOffsetToLine));
// write QML dependencies
quint32_le *writtenDeps = (quint32_le *)(f + function->dependingIdObjectsOffset());