From 19cd5c46693a287c08025c01ded8eaf140e21317 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 6 Mar 2014 10:13:26 +0100 Subject: Reserve a double slot for accessor properties Reserve two slots in the internal class for accessor properties. This opens up reducing the default storage required per data property to one Value. In practice this implies cutting the required memory in half. Change-Id: Ifed897852bbdfd810018f0d6b049fca6690ead2c Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4internalclass_p.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/qml/jsruntime/qv4internalclass_p.h') diff --git a/src/qml/jsruntime/qv4internalclass_p.h b/src/qml/jsruntime/qv4internalclass_p.h index b25b895183..91c6e264db 100644 --- a/src/qml/jsruntime/qv4internalclass_p.h +++ b/src/qml/jsruntime/qv4internalclass_p.h @@ -233,10 +233,13 @@ struct InternalClass { static InternalClass *create(ExecutionEngine *engine, const ManagedVTable *vtable, Object *proto); InternalClass *changePrototype(Object *proto); InternalClass *changeVTable(const ManagedVTable *vt); + static void addMember(Object *object, StringRef string, PropertyAttributes data, uint *index); + static void addMember(Object *object, String *string, PropertyAttributes data, uint *index); InternalClass *addMember(StringRef string, PropertyAttributes data, uint *index = 0); InternalClass *addMember(String *string, PropertyAttributes data, uint *index = 0); InternalClass *changeMember(String *string, PropertyAttributes data, uint *index = 0); - void removeMember(Object *object, Identifier *id); + static void changeMember(Object *object, String *string, PropertyAttributes data, uint *index = 0); + static void removeMember(Object *object, Identifier *id); uint find(const StringRef string); uint find(const String *s); @@ -247,6 +250,7 @@ struct InternalClass { void markObjects(); private: + InternalClass *addMemberImpl(String *string, PropertyAttributes data, uint *index); friend struct ExecutionEngine; InternalClass(ExecutionEngine *engine); InternalClass(const InternalClass &other); -- cgit v1.2.3