aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlvmemetaobject_p.h
diff options
context:
space:
mode:
authorFrank Meerkoetter <frank.meerkoetter@basyskom.com>2015-07-14 22:38:51 +0200
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-08-18 20:25:19 +0000
commit7e61bc92a3dccbd4c04d0a69da950cfdc32e487b (patch)
treeb00ebc37e92a7ad2b252651d69edc285a7bb807f /src/qml/qml/qqmlvmemetaobject_p.h
parenta820a56eb5a8e4f21ca4a04efe816e40b5645cef (diff)
Store int/bool/double/string and sizef as QV4::Value in a Javascript array
This is the first patch in a series of patches removing the QQmlVMEVariant used for the storage of non-var properties. The overall goal is to reduce the memory usage of QML. The QQmlVMEVariant has a size of 8*sizeof(void*) + sizeof(int) which is quite an overhead for types such as int/bool or double. Change-Id: I301661d134724300942911a3d75258fe45356a7a Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/qml/qqmlvmemetaobject_p.h')
-rw-r--r--src/qml/qml/qqmlvmemetaobject_p.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlvmemetaobject_p.h b/src/qml/qml/qqmlvmemetaobject_p.h
index a320163f23..a87feec043 100644
--- a/src/qml/qml/qqmlvmemetaobject_p.h
+++ b/src/qml/qml/qqmlvmemetaobject_p.h
@@ -204,6 +204,26 @@ public:
inline void allocateVarPropertiesArray();
inline bool ensureVarPropertiesAllocated();
+ // temporary solution so I can experiment with storing
+ // properties in a JS array. Should be switched over to also
+ // use the 'varProperties' in the end.
+ QV4::WeakValue properties;
+ bool propertiesInitialized;
+ inline void allocatePropertiesArray();
+ inline bool ensurePropertiesAllocated();
+
+ int readPropertyAsInt(int id);
+ bool readPropertyAsBool(int id);
+ double readPropertyAsDouble(int id);
+ QString readPropertyAsString(int id);
+ QSizeF readPropertyAsSizeF(int id);
+
+ void writeProperty(int id, int v);
+ void writeProperty(int id, bool v);
+ void writeProperty(int id, double v);
+ void writeProperty(int id, const QString& v);
+ void writeProperty(int id, const QSizeF& v);
+
void ensureQObjectWrapper();
void mark(QV4::ExecutionEngine *e);