diff options
author | Lars Knoll <lars.knoll@digia.com> | 2014-01-07 16:10:00 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-09 07:47:22 +0100 |
commit | 7eff387795f02f56ea9d117e4d34ef6f5dd78125 (patch) | |
tree | ee9ce7ae0ae94aa4844ae24bf98d3ff3b4d53d20 /src/qml/jsruntime/qv4object_p.h | |
parent | d3a4fd9bf85ab503a343b548c4d96d12dd48ffc6 (diff) |
Cleanup: change signature of Object::insertMember()
Methods returning a Property pointer have to be removed, so that
we can move over to store member data requiring only one value for
the common case of data properties.
This will in the long term reduce memory consumption on 64 bit
systems quite a bit.
Change-Id: I78de3794ec7b3bc5db13aa57275d3f08fa9d470a
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4object_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4object_p.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4object_p.h b/src/qml/jsruntime/qv4object_p.h index b9fc05eb64..9500c2a4d0 100644 --- a/src/qml/jsruntime/qv4object_p.h +++ b/src/qml/jsruntime/qv4object_p.h @@ -157,7 +157,9 @@ struct Q_QML_EXPORT Object: Managed { void putValue(Property *pd, PropertyAttributes attrs, const ValueRef value); /* The spec default: Writable: true, Enumerable: false, Configurable: true */ - void defineDefaultProperty(const StringRef name, ValueRef value); + void defineDefaultProperty(const StringRef name, ValueRef value) { + insertMember(name, value, Attr_Data|Attr_NotEnumerable); + } void defineDefaultProperty(const QString &name, ValueRef value); void defineDefaultProperty(const QString &name, ReturnedValue (*code)(CallContext *), int argumentCount = 0); void defineDefaultProperty(const StringRef name, ReturnedValue (*code)(CallContext *), int argumentCount = 0); @@ -167,7 +169,10 @@ struct Q_QML_EXPORT Object: Managed { void defineReadonlyProperty(const QString &name, ValueRef value); void defineReadonlyProperty(const StringRef name, ValueRef value); - Property *insertMember(const StringRef s, PropertyAttributes attributes); + void insertMember(const StringRef s, const ValueRef v, PropertyAttributes attributes = Attr_Data) { + insertMember(s, Property::fromValue(*v), attributes); + } + void insertMember(const StringRef s, const Property &p, PropertyAttributes attributes); inline ExecutionEngine *engine() const { return internalClass->engine; } |