diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-08-16 10:11:20 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-08-18 13:03:13 +0200 |
commit | b6a6a6387e279c431d520243345530fa19bd96c5 (patch) | |
tree | b2551748458f0728ba6a5c403c4d56c61caa072f /src/qml/jsruntime/qv4lookup_p.h | |
parent | 091f20de8c7fc33ae82b12c1ee5a7835da1daa81 (diff) |
Optimize setting new properties on objects
When a property on an object is set for the first time,
this triggers a change in internal class for the object.
Record that change in the lookup, and do the same transition
in the future.
Change-Id: Ib0e8ac61ce3aaecb736532600740cec51996e3d6
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4lookup_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4lookup_p.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4lookup_p.h b/src/qml/jsruntime/qv4lookup_p.h index e77552826a..3763182e84 100644 --- a/src/qml/jsruntime/qv4lookup_p.h +++ b/src/qml/jsruntime/qv4lookup_p.h @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE namespace QV4 { struct Lookup { - enum { Size = 3 }; + enum { Size = 4 }; union { void (*getter)(Lookup *l, Value *result, const Value &object); void (*globalGetter)(Lookup *l, ExecutionContext *ctx, Value *result); @@ -82,6 +82,9 @@ struct Lookup { static void setterGeneric(Lookup *l, const Value &object, const Value &value); static void setter0(Lookup *l, const Value &object, const Value &value); + static void setterInsert0(Lookup *l, const Value &object, const Value &value); + static void setterInsert1(Lookup *l, const Value &object, const Value &value); + static void setterInsert2(Lookup *l, const Value &object, const Value &value); Property *lookup(Object *obj, PropertyAttributes *attrs); |