From af7ca3607cc6e530af8ed0d1fa5e6d132bc16ac1 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 6 Mar 2014 12:06:36 +0100 Subject: 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 --- src/qml/jsruntime/qv4functionobject.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/qml/jsruntime/qv4functionobject.cpp') 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 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()); -- cgit v1.2.3