aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4compileddata_p.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2018-07-20 10:05:35 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2018-07-30 19:46:38 +0000
commite31706d1ad50f3ce5f2fd100df3b2dccccb0b14c (patch)
tree556eee46906ec592d75de4e917b65f1aedc1bc66 /src/qml/compiler/qv4compileddata_p.h
parent88bdcd0b7fa62a7ea0fdc2286ad1f51d869fd3cf (diff)
Shrink function objects by 12 bytes
Saves about ~1.5K on examples/quickcontrols/extras/flat/Content.qml and ~11K RAM with the gallery. Task-number: QTBUG-69588 Change-Id: I49a1d08e18d4f50ffe02d904af39cab53d72493f Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4compileddata_p.h')
-rw-r--r--src/qml/compiler/qv4compileddata_p.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/qml/compiler/qv4compileddata_p.h b/src/qml/compiler/qv4compileddata_p.h
index 0ac40d2800..fd01401a4f 100644
--- a/src/qml/compiler/qv4compileddata_p.h
+++ b/src/qml/compiler/qv4compileddata_p.h
@@ -259,21 +259,21 @@ struct Function
quint32_le codeSize;
quint32_le nameIndex;
- quint32_le length;
- quint32_le nFormals;
+ quint16_le length;
+ quint16_le nFormals;
quint32_le formalsOffset;
- quint32_le nLocals;
quint32_le localsOffset;
- quint32_le nLineNumbers;
+ quint16_le nLocals;
+ quint16_le nLineNumbers;
quint32_le lineNumberOffset;
quint32_le nestedFunctionIndex; // for functions that only return a single closure, used in signal handlers
quint32_le nRegisters;
Location location;
// Qml Extensions Begin
- quint32_le nDependingIdObjects;
quint32_le dependingIdObjectsOffset; // Array of resolved ID objects
- quint32_le nDependingContextProperties;
+ quint16_le nDependingIdObjects;
+ quint16_le nDependingContextProperties;
quint32_le dependingContextPropertiesOffset; // Array of int pairs (property index and notify index)
quint32_le nDependingScopeProperties;
quint32_le dependingScopePropertiesOffset; // Array of int pairs (property index and notify index)
@@ -315,7 +315,7 @@ struct Function
return (a + 7) & ~size_t(7);
}
};
-static_assert(sizeof(Function) == 80, "Function structure needs to have the expected size to be binary compatible on disk when generated by host compiler and loaded by target");
+static_assert(sizeof(Function) == 68, "Function structure needs to have the expected size to be binary compatible on disk when generated by host compiler and loaded by target");
struct Method {
enum Type {