diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-08-30 14:39:40 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-02 17:27:36 +0200 |
commit | bdc558c932fdb4b651c85d632bd65b9380e2e42a (patch) | |
tree | 0bdb468025ddba3e5cb44cdd9f4f8d8b1b0dd791 /src/qml/jsruntime/qv4lookup_p.h | |
parent | 2bd74245fadb69922132f7ca2ae98e645f67742b (diff) |
Optimise property lookups on primitive types
This gives a large speedup on code such as "foo".charAt(2), or
(5.).toString().
Change-Id: I8b6c46f2f69a4b00f82048a9368d8e9baf4d89ee
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 | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4lookup_p.h b/src/qml/jsruntime/qv4lookup_p.h index 3763182e84..b37738dd92 100644 --- a/src/qml/jsruntime/qv4lookup_p.h +++ b/src/qml/jsruntime/qv4lookup_p.h @@ -59,7 +59,15 @@ struct Lookup { void (*globalGetter)(Lookup *l, ExecutionContext *ctx, Value *result); void (*setter)(Lookup *l, const Value &object, const Value &v); }; - InternalClass *classList[Size]; + union { + InternalClass *classList[Size]; + struct { + void *dummy0; + void *dummy1; + Object *proto; + unsigned type; + }; + }; int level; uint index; String *name; @@ -72,6 +80,12 @@ struct Lookup { static void getterAccessor1(Lookup *l, Value *result, const Value &object); static void getterAccessor2(Lookup *l, Value *result, const Value &object); + static void primitiveGetter0(Lookup *l, Value *result, const Value &object); + static void primitiveGetter1(Lookup *l, Value *result, const Value &object); + static void primitiveGetterAccessor0(Lookup *l, Value *result, const Value &object); + static void primitiveGetterAccessor1(Lookup *l, Value *result, const Value &object); + static void stringLengthGetter(Lookup *l, Value *result, const Value &object); + static void globalGetterGeneric(Lookup *l, ExecutionContext *ctx, Value *result); static void globalGetter0(Lookup *l, ExecutionContext *ctx, Value *result); static void globalGetter1(Lookup *l, ExecutionContext *ctx, Value *result); |