diff options
author | Lars Knoll <[email protected]> | 2014-03-06 12:06:36 +0100 |
---|---|---|
committer | The Qt Project <[email protected]> | 2014-03-07 21:16:01 +0100 |
commit | af7ca3607cc6e530af8ed0d1fa5e6d132bc16ac1 (patch) | |
tree | 7be76616922e984d8ea59e40d5e1f797a4adc3e7 /src/qml/jsruntime/qv4functionobject.cpp | |
parent | 19cd5c46693a287c08025c01ded8eaf140e21317 (diff) |
Use an array of Value's for Object::memberData
This cuts the memory required to store properties
in an object in half for the common case. Accessor
properties require two slots inside memberData,
but data properties only one.
Change-Id: I0bab1b88ca9ed5930abf065c77c89985b9ed5320
Reviewed-by: Simon Hausmann <[email protected]>
Diffstat (limited to 'src/qml/jsruntime/qv4functionobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4functionobject.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp index 9a3aa331dc..9b502a0927 100644 --- a/src/qml/jsruntime/qv4functionobject.cpp +++ b/src/qml/jsruntime/qv4functionobject.cpp @@ -111,7 +111,7 @@ FunctionObject::FunctionObject(InternalClass *ic) { needsActivation = false; strictMode = false; - memberData[Index_Prototype].value = Encode::undefined(); + memberData[Index_Prototype] = Encode::undefined(); } FunctionObject::~FunctionObject() @@ -130,11 +130,10 @@ void FunctionObject::init(const StringRef n, bool createProto) if (createProto) { Scoped<Object> proto(s, scope->engine->newObject(scope->engine->protoClass)); - proto->memberData[Index_ProtoConstructor].value = this->asReturnedValue(); - memberData[Index_Prototype].value = proto.asReturnedValue(); + proto->memberData[Index_ProtoConstructor] = this->asReturnedValue(); + memberData[Index_Prototype] = proto.asReturnedValue(); } else { - // ### Empty or undefined? - memberData[Index_Prototype].value = Encode::undefined(); + memberData[Index_Prototype] = Encode::undefined(); } ScopedValue v(s, n.asReturnedValue()); |