diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-08-29 13:24:38 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-02 17:27:36 +0200 |
commit | 3ad8b0f0e8193bb7b62ffee6b33588ef6b51459c (patch) | |
tree | a4c05097b9787efcb2749ed2d40590b1beb2d360 /src/qml/jsruntime/qv4internalclass_p.h | |
parent | 6c69cdb1af58dfb584615aa60d4f69b359b312cc (diff) |
Add the object's prototype to the InternalClass structure
Change-Id: Ifa97d3354a7a7afadf70f9ba540716bd5b1eef44
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4internalclass_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4internalclass_p.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4internalclass_p.h b/src/qml/jsruntime/qv4internalclass_p.h index fc6c5352b1..1fba947a37 100644 --- a/src/qml/jsruntime/qv4internalclass_p.h +++ b/src/qml/jsruntime/qv4internalclass_p.h @@ -108,8 +108,12 @@ inline PropertyHash::~PropertyHash() struct InternalClassTransition { - Identifier *id; + union { + Identifier *id; + Object *prototype; + }; int flags; + enum { ProtoChange = 0x100 }; bool operator==(const InternalClassTransition &other) const { return id == other.id && flags == other.flags; } @@ -118,6 +122,7 @@ uint qHash(const QV4::InternalClassTransition &t, uint = 0); struct InternalClass { ExecutionEngine *engine; + Object *prototype; PropertyHash propertyTable; // id to valueIndex QVector<String *> nameMap; @@ -131,6 +136,7 @@ struct InternalClass { uint size; + InternalClass *changePrototype(Object *proto); InternalClass *addMember(String *string, PropertyAttributes data, uint *index = 0); InternalClass *changeMember(String *string, PropertyAttributes data, uint *index = 0); void removeMember(Object *object, Identifier *id); @@ -140,10 +146,11 @@ struct InternalClass { InternalClass *frozen(); void destroy(); + void markObjects(); private: friend struct ExecutionEngine; - InternalClass(ExecutionEngine *engine) : engine(engine), m_sealed(0), m_frozen(0), size(0) {} + InternalClass(ExecutionEngine *engine) : engine(engine), prototype(0), m_sealed(0), m_frozen(0), size(0) {} InternalClass(const InternalClass &other); }; |