aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4lookup_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2014-01-17 12:19:34 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-20 21:14:35 +0100
commit393108500832dcefa4c4def442a08f20d3fbc4cd (patch)
tree64676214630008b9f5434c933590d9adf9baf094 /src/qml/jsruntime/qv4lookup_p.h
parentbf6191f090b326eb0776cd4e921ddb56c8daa8a9 (diff)
Use lookups for indexed accesses
This speeds up reading array data from objects significantly. Change-Id: I5d17a7b3e7583a16dc76d1ee6cbc1d7134e4c2fa 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.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4lookup_p.h b/src/qml/jsruntime/qv4lookup_p.h
index f47b603c15..50874411de 100644
--- a/src/qml/jsruntime/qv4lookup_p.h
+++ b/src/qml/jsruntime/qv4lookup_p.h
@@ -55,11 +55,13 @@ namespace QV4 {
struct Lookup {
enum { Size = 4 };
union {
+ ReturnedValue (*indexedGetter)(Lookup *l, const ValueRef object, const ValueRef index);
ReturnedValue (*getter)(Lookup *l, const ValueRef object);
ReturnedValue (*globalGetter)(Lookup *l, ExecutionContext *ctx);
void (*setter)(Lookup *l, const ValueRef object, const ValueRef v);
};
union {
+ ExecutionEngine *engine;
InternalClass *classList[Size];
struct {
void *dummy0;
@@ -72,6 +74,10 @@ struct Lookup {
uint index;
String *name;
+ static ReturnedValue indexedGetterGeneric(Lookup *l, const ValueRef object, const ValueRef index);
+ static ReturnedValue indexedGetterFallback(Lookup *l, const ValueRef object, const ValueRef index);
+ static ReturnedValue indexedGetterObjectInt(Lookup *l, const ValueRef object, const ValueRef index);
+
static ReturnedValue getterGeneric(Lookup *l, const ValueRef object);
static ReturnedValue getter0(Lookup *l, const ValueRef object);
static ReturnedValue getter1(Lookup *l, const ValueRef object);