diff options
author | Lars Knoll <lars.knoll@digia.com> | 2014-03-13 21:28:30 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-18 09:05:57 +0100 |
commit | 09f3cfee8d5e34b5f7058586c52c3fc36d295d93 (patch) | |
tree | 34e2f85fc7914780db09365dc0654d9201f829f4 /src/qml/jsruntime/qv4lookup_p.h | |
parent | 6b425f3182e57cb7cda6b559f3ee9673137706d0 (diff) |
Add some specialized lookups for two internal classes
Some methods are being called with two different types of objects,
alternating between them. This adds a specialized lookup for that
case. Speeds up the splay test by ~20%.
Also create a clean path to a fallback lookup instead of going back
to the generic lookup and then alternating.
Change-Id: I3082d70d27155ef5f2cf2b680d227c6dd389956d
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 | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4lookup_p.h b/src/qml/jsruntime/qv4lookup_p.h index 7f107bf8eb..3dd2c7f6ce 100644 --- a/src/qml/jsruntime/qv4lookup_p.h +++ b/src/qml/jsruntime/qv4lookup_p.h @@ -71,7 +71,10 @@ struct Lookup { unsigned type; }; }; - int level; + union { + int level; + uint index2; + }; uint index; String *name; @@ -84,9 +87,15 @@ struct Lookup { static void indexedSetterObjectInt(Lookup *l, const ValueRef object, const ValueRef index, const ValueRef v); static ReturnedValue getterGeneric(Lookup *l, const ValueRef object); + static ReturnedValue getterTwoClasses(Lookup *l, const ValueRef object); + static ReturnedValue getterFallback(Lookup *l, const ValueRef object); + static ReturnedValue getter0(Lookup *l, const ValueRef object); static ReturnedValue getter1(Lookup *l, const ValueRef object); static ReturnedValue getter2(Lookup *l, const ValueRef object); + static ReturnedValue getter0getter0(Lookup *l, const ValueRef object); + static ReturnedValue getter0getter1(Lookup *l, const ValueRef object); + static ReturnedValue getter1getter1(Lookup *l, const ValueRef object); static ReturnedValue getterAccessor0(Lookup *l, const ValueRef object); static ReturnedValue getterAccessor1(Lookup *l, const ValueRef object); static ReturnedValue getterAccessor2(Lookup *l, const ValueRef object); @@ -107,10 +116,13 @@ struct Lookup { static ReturnedValue globalGetterAccessor2(Lookup *l, ExecutionContext *ctx); static void setterGeneric(Lookup *l, const ValueRef object, const ValueRef value); + static void setterTwoClasses(Lookup *l, const ValueRef object, const ValueRef value); + static void setterFallback(Lookup *l, const ValueRef object, const ValueRef value); static void setter0(Lookup *l, const ValueRef object, const ValueRef value); static void setterInsert0(Lookup *l, const ValueRef object, const ValueRef value); static void setterInsert1(Lookup *l, const ValueRef object, const ValueRef value); static void setterInsert2(Lookup *l, const ValueRef object, const ValueRef value); + static void setter0setter0(Lookup *l, const ValueRef object, const ValueRef value); ReturnedValue lookup(ValueRef thisObject, Object *obj, PropertyAttributes *attrs); ReturnedValue lookup(Object *obj, PropertyAttributes *attrs); |