aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4lookup_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-11-13 15:00:20 +0100
committerLars Knoll <lars.knoll@qt.io>2017-11-27 11:09:53 +0000
commitd31304eab9e7424edc20fb83a8a19cd979458029 (patch)
tree027bdee6f8a64ff59def96a52a88bdeff9053ca5 /src/qml/jsruntime/qv4lookup_p.h
parent71f0bc8ce6244d4544dcd35a62ed8f163bb5b092 (diff)
Refactor getter lookups
Use the new id of InternalClass to simplify out lookup code for getters. Now all lookups in the prototype chain can be done at the same speed independent of the depth within the prototype chain with only two checks. Change-Id: I7d8451cc54c0ac50c1bcb4ae3bf386fd5f2a84aa Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4lookup_p.h')
-rw-r--r--src/qml/jsruntime/qv4lookup_p.h36
1 files changed, 28 insertions, 8 deletions
diff --git a/src/qml/jsruntime/qv4lookup_p.h b/src/qml/jsruntime/qv4lookup_p.h
index 826760aa2d..e85cf86c0f 100644
--- a/src/qml/jsruntime/qv4lookup_p.h
+++ b/src/qml/jsruntime/qv4lookup_p.h
@@ -72,6 +72,27 @@ struct Lookup {
bool (*setter)(Lookup *l, ExecutionEngine *engine, Value &object, const Value &v);
};
union {
+ struct {
+ InternalClass *ic;
+ int offset;
+ } objectLookup;
+ struct {
+ const Value *data;
+ int icIdentifier;
+ } protoLookup;
+ struct {
+ InternalClass *ic;
+ InternalClass *ic2;
+ int offset;
+ int offset2;
+ } objectLookupTwoClasses;
+ struct {
+ const Value *data;
+ const Value *data2;
+ int icIdentifier;
+ int icIdentifier2;
+ } protoLookupTwoClasses;
+
InternalClass *classList[Size];
struct {
void *dummy0;
@@ -88,23 +109,22 @@ struct Lookup {
uint index;
uint nameIndex;
+ ReturnedValue resolveGetter(ExecutionEngine *engine, const Object *object);
+
static ReturnedValue getterGeneric(Lookup *l, ExecutionEngine *engine, const Value &object);
static ReturnedValue getterTwoClasses(Lookup *l, ExecutionEngine *engine, const Value &object);
static ReturnedValue getterFallback(Lookup *l, ExecutionEngine *engine, const Value &object);
static ReturnedValue getter0MemberData(Lookup *l, ExecutionEngine *engine, const Value &object);
static ReturnedValue getter0Inline(Lookup *l, ExecutionEngine *engine, const Value &object);
- static ReturnedValue getter1(Lookup *l, ExecutionEngine *engine, const Value &object);
- static ReturnedValue getter2(Lookup *l, ExecutionEngine *engine, const Value &object);
+ static ReturnedValue getterProto(Lookup *l, ExecutionEngine *engine, const Value &object);
static ReturnedValue getter0Inlinegetter0Inline(Lookup *l, ExecutionEngine *engine, const Value &object);
static ReturnedValue getter0Inlinegetter0MemberData(Lookup *l, ExecutionEngine *engine, const Value &object);
static ReturnedValue getter0MemberDatagetter0MemberData(Lookup *l, ExecutionEngine *engine, const Value &object);
- static ReturnedValue getter0Inlinegetter1(Lookup *l, ExecutionEngine *engine, const Value &object);
- static ReturnedValue getter0MemberDatagetter1(Lookup *l, ExecutionEngine *engine, const Value &object);
- static ReturnedValue getter1getter1(Lookup *l, ExecutionEngine *engine, const Value &object);
- static ReturnedValue getterAccessor0(Lookup *l, ExecutionEngine *engine, const Value &object);
- static ReturnedValue getterAccessor1(Lookup *l, ExecutionEngine *engine, const Value &object);
- static ReturnedValue getterAccessor2(Lookup *l, ExecutionEngine *engine, const Value &object);
+ static ReturnedValue getterProtoTwoClasses(Lookup *l, ExecutionEngine *engine, const Value &object);
+ static ReturnedValue getterAccessor(Lookup *l, ExecutionEngine *engine, const Value &object);
+ static ReturnedValue getterProtoAccessor(Lookup *l, ExecutionEngine *engine, const Value &object);
+ static ReturnedValue getterProtoAccessorTwoClasses(Lookup *l, ExecutionEngine *engine, const Value &object);
static ReturnedValue primitiveGetter0Inline(Lookup *l, ExecutionEngine *engine, const Value &object);
static ReturnedValue primitiveGetter0MemberData(Lookup *l, ExecutionEngine *engine, const Value &object);