aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/qml/jsruntime/qv4lookup.cpp292
-rw-r--r--src/qml/jsruntime/qv4lookup_p.h36
-rw-r--r--src/qml/jsruntime/qv4object.cpp54
-rw-r--r--src/qml/jsruntime/qv4object_p.h6
4 files changed, 162 insertions, 226 deletions
diff --git a/src/qml/jsruntime/qv4lookup.cpp b/src/qml/jsruntime/qv4lookup.cpp
index c603d424ed..bbc33def10 100644
--- a/src/qml/jsruntime/qv4lookup.cpp
+++ b/src/qml/jsruntime/qv4lookup.cpp
@@ -87,6 +87,7 @@ ReturnedValue Lookup::lookup(const Object *thisObject, PropertyAttributes *attrs
Heap::Object *obj = thisObject->d();
ExecutionEngine *engine = thisObject->engine();
Identifier *name = engine->identifierTable->identifier(engine->currentStackFrame->v4Function->compilationUnit->runtimeStrings[nameIndex]);
+
int i = 0;
while (i < Size && obj) {
classList[i] = obj->internalClass;
@@ -117,10 +118,57 @@ ReturnedValue Lookup::lookup(const Object *thisObject, PropertyAttributes *attrs
return Primitive::emptyValue().asReturnedValue();
}
+ReturnedValue Lookup::resolveGetter(ExecutionEngine *engine, const Object *object)
+{
+ Heap::Object *obj = object->d();
+ Identifier *name = engine->identifierTable->identifier(engine->currentStackFrame->v4Function->compilationUnit->runtimeStrings[nameIndex]);
+
+ uint index = obj->internalClass->find(name);
+ if (index != UINT_MAX) {
+ PropertyAttributes attrs = obj->internalClass->propertyData.at(index);
+ uint nInline = obj->vtable()->nInlineProperties;
+ if (attrs.isData()) {
+ if (index < obj->vtable()->nInlineProperties) {
+ index += obj->vtable()->inlinePropertyOffset;
+ getter = getter0Inline;
+ } else {
+ index -= nInline;
+ getter = getter0MemberData;
+ }
+ } else {
+ getter = getterAccessor;
+ }
+ objectLookup.ic = obj->internalClass;
+ objectLookup.offset = index;
+ return getter(this, engine, *object);
+ }
+
+ protoLookup.icIdentifier = obj->internalClass->id;
+ obj = obj->prototype();
+ while (obj) {
+ uint index = obj->internalClass->find(name);
+ if (index != UINT_MAX) {
+ PropertyAttributes attrs = obj->internalClass->propertyData.at(index);
+ protoLookup.data = obj->propertyData(index);
+ if (attrs.isData()) {
+ getter = getterProto;
+ } else {
+ getter = getterProtoAccessor;
+ }
+ return getter(this, engine, *object);
+ }
+ obj = obj->prototype();
+ }
+ // ### put in a getterNotFound!
+ getter = getterFallback;
+ return getter(this, engine, *object);
+}
+
ReturnedValue Lookup::getterGeneric(Lookup *l, ExecutionEngine *engine, const Value &object)
{
- if (const Object *o = object.as<Object>())
- return o->getLookup(l);
+ if (const Object *o = object.as<Object>()) {
+ return l->resolveGetter(engine, o);
+ }
Object *proto;
switch (object.type()) {
@@ -179,51 +227,45 @@ ReturnedValue Lookup::getterGeneric(Lookup *l, ExecutionEngine *engine, const Va
ReturnedValue Lookup::getterTwoClasses(Lookup *l, ExecutionEngine *engine, const Value &object)
{
- Lookup l1 = *l;
+ if (const Object *o = object.as<Object>()) {
+ Lookup first = *l;
+ Lookup second = *l;
- if (l1.getter == Lookup::getter0MemberData || l1.getter == Lookup::getter0Inline || l1.getter == Lookup::getter1) {
- if (const Object *o = object.as<Object>()) {
- ReturnedValue v = o->getLookup(l);
- Lookup l2 = *l;
-
- if (l2.index != UINT_MAX) {
- if (l1.getter != Lookup::getter0Inline) {
- if (l2.getter == Lookup::getter0Inline ||
- (l1.getter != Lookup::getter0MemberData && l2.getter == Lookup::getter0MemberData))
- // sort the better getter first
- qSwap(l1, l2);
- }
+ ReturnedValue result = second.resolveGetter(engine, o);
- l->classList[0] = l1.classList[0];
- l->classList[1] = l1.classList[1];
- l->classList[2] = l2.classList[0];
- l->classList[3] = l2.classList[1];
- l->index = l1.index;
- l->index2 = l2.index;
-
- if (l1.getter == Lookup::getter0Inline) {
- if (l2.getter == Lookup::getter0Inline)
- l->getter = Lookup::getter0Inlinegetter0Inline;
- else if (l2.getter == Lookup::getter0MemberData)
- l->getter = Lookup::getter0Inlinegetter0MemberData;
- else if (l2.getter == Lookup::getter1)
- l->getter = Lookup::getter0Inlinegetter1;
- else
- Q_UNREACHABLE();
- } else if (l1.getter == Lookup::getter0MemberData) {
- if (l2.getter == Lookup::getter0MemberData)
- l->getter = Lookup::getter0MemberDatagetter0MemberData;
- else if (l2.getter == Lookup::getter1)
- l->getter = Lookup::getter0MemberDatagetter1;
- else
- Q_UNREACHABLE();
- } else {
- Q_ASSERT(l1.getter == Lookup::getter1 && l2.getter == Lookup::getter1);
- l->getter = Lookup::getter1getter1;
- }
- return v;
- }
+ if (first.getter == getter0Inline && (second.getter == getter0Inline || second.getter == getter0MemberData)) {
+ l->objectLookupTwoClasses.ic = first.objectLookup.ic;
+ l->objectLookupTwoClasses.ic2 = second.objectLookup.ic;
+ l->objectLookupTwoClasses.offset = first.objectLookup.offset;
+ l->objectLookupTwoClasses.offset2 = second.objectLookup.offset;
+ l->getter = second.getter == getter0Inline ? getter0Inlinegetter0Inline : getter0Inlinegetter0MemberData;
+ return result;
+ }
+ if (first.getter == getter0MemberData && (second.getter == getter0Inline || second.getter == getter0MemberData)) {
+ l->objectLookupTwoClasses.ic = second.objectLookup.ic;
+ l->objectLookupTwoClasses.ic2 = first.objectLookup.ic;
+ l->objectLookupTwoClasses.offset = second.objectLookup.offset;
+ l->objectLookupTwoClasses.offset2 = first.objectLookup.offset;
+ l->getter = second.getter == getter0Inline ? getter0Inlinegetter0MemberData : getter0MemberDatagetter0MemberData;
+ return result;
+ }
+ if (first.getter == getterProto && second.getter == getterProto) {
+ l->protoLookupTwoClasses.icIdentifier = first.protoLookup.icIdentifier;
+ l->protoLookupTwoClasses.icIdentifier2 = second.protoLookup.icIdentifier;
+ l->protoLookupTwoClasses.data = first.protoLookup.data;
+ l->protoLookupTwoClasses.data2 = second.protoLookup.data;
+ l->getter = getterProtoTwoClasses;
+ return result;
+ }
+ if (first.getter == getterProtoAccessor && second.getter == getterProtoAccessor) {
+ l->protoLookupTwoClasses.icIdentifier = first.protoLookup.icIdentifier;
+ l->protoLookupTwoClasses.icIdentifier2 = second.protoLookup.icIdentifier;
+ l->protoLookupTwoClasses.data = first.protoLookup.data;
+ l->protoLookupTwoClasses.data2 = second.protoLookup.data;
+ l->getter = getterProtoAccessorTwoClasses;
+ return result;
}
+
}
l->getter = getterFallback;
@@ -246,8 +288,8 @@ ReturnedValue Lookup::getter0MemberData(Lookup *l, ExecutionEngine *engine, cons
// the internal class won't match
Heap::Object *o = static_cast<Heap::Object *>(object.heapObject());
if (o) {
- if (l->classList[0] == o->internalClass)
- return o->memberData->values.data()[l->index].asReturnedValue();
+ if (l->objectLookup.ic == o->internalClass)
+ return o->memberData->values.data()[l->objectLookup.offset].asReturnedValue();
}
return getterTwoClasses(l, engine, object);
}
@@ -258,53 +300,34 @@ ReturnedValue Lookup::getter0Inline(Lookup *l, ExecutionEngine *engine, const Va
// the internal class won't match
Heap::Object *o = static_cast<Heap::Object *>(object.heapObject());
if (o) {
- if (l->classList[0] == o->internalClass)
- return o->inlinePropertyDataWithOffset(l->index)->asReturnedValue();
+ if (l->objectLookup.ic == o->internalClass)
+ return o->inlinePropertyDataWithOffset(l->objectLookup.offset)->asReturnedValue();
}
return getterTwoClasses(l, engine, object);
}
-ReturnedValue Lookup::getter1(Lookup *l, ExecutionEngine *engine, const Value &object)
+ReturnedValue Lookup::getterProto(Lookup *l, ExecutionEngine *engine, const Value &object)
{
// we can safely cast to a QV4::Object here. If object is actually a string,
// the internal class won't match
Heap::Object *o = static_cast<Heap::Object *>(object.heapObject());
if (o) {
- if (l->classList[0] == o->internalClass && l->classList[1] == l->proto->internalClass)
- return l->proto->propertyData(l->index)->asReturnedValue();
+ if (l->protoLookup.icIdentifier == o->internalClass->id)
+ return l->protoLookup.data->asReturnedValue();
}
return getterTwoClasses(l, engine, object);
}
-ReturnedValue Lookup::getter2(Lookup *l, ExecutionEngine *engine, const Value &object)
-{
- // we can safely cast to a QV4::Object here. If object is actually a string,
- // the internal class won't match
- Heap::Object *o = static_cast<Heap::Object *>(object.heapObject());
- if (o) {
- if (l->classList[0] == o->internalClass) {
- Q_ASSERT(l->proto == o->prototype());
- if (l->classList[1] == l->proto->internalClass) {
- Heap::Object *p = l->proto->prototype();
- if (l->classList[2] == p->internalClass)
- return p->propertyData(l->index)->asReturnedValue();
- }
- }
- }
- l->getter = getterFallback;
- return getterFallback(l, engine, object);
-}
-
ReturnedValue Lookup::getter0Inlinegetter0Inline(Lookup *l, ExecutionEngine *engine, const Value &object)
{
// we can safely cast to a QV4::Object here. If object is actually a string,
// the internal class won't match
Heap::Object *o = static_cast<Heap::Object *>(object.heapObject());
if (o) {
- if (l->classList[0] == o->internalClass)
- return o->inlinePropertyDataWithOffset(l->index)->asReturnedValue();
- if (l->classList[2] == o->internalClass)
- return o->inlinePropertyDataWithOffset(l->index2)->asReturnedValue();
+ if (l->objectLookupTwoClasses.ic == o->internalClass)
+ return o->inlinePropertyDataWithOffset(l->objectLookupTwoClasses.offset)->asReturnedValue();
+ if (l->objectLookupTwoClasses.ic2 == o->internalClass)
+ return o->inlinePropertyDataWithOffset(l->objectLookupTwoClasses.offset2)->asReturnedValue();
}
l->getter = getterFallback;
return getterFallback(l, engine, object);
@@ -316,10 +339,10 @@ ReturnedValue Lookup::getter0Inlinegetter0MemberData(Lookup *l, ExecutionEngine
// the internal class won't match
Heap::Object *o = static_cast<Heap::Object *>(object.heapObject());
if (o) {
- if (l->classList[0] == o->internalClass)
- return o->inlinePropertyDataWithOffset(l->index)->asReturnedValue();
- if (l->classList[2] == o->internalClass)
- return o->memberData->values.data()[l->index2].asReturnedValue();
+ if (l->objectLookupTwoClasses.ic == o->internalClass)
+ return o->inlinePropertyDataWithOffset(l->objectLookupTwoClasses.offset)->asReturnedValue();
+ if (l->objectLookupTwoClasses.ic2 == o->internalClass)
+ return o->memberData->values.data()[l->objectLookupTwoClasses.offset2].asReturnedValue();
}
l->getter = getterFallback;
return getterFallback(l, engine, object);
@@ -331,128 +354,81 @@ ReturnedValue Lookup::getter0MemberDatagetter0MemberData(Lookup *l, ExecutionEng
// the internal class won't match
Heap::Object *o = static_cast<Heap::Object *>(object.heapObject());
if (o) {
- if (l->classList[0] == o->internalClass)
- return o->memberData->values.data()[l->index].asReturnedValue();
- if (l->classList[2] == o->internalClass)
- return o->memberData->values.data()[l->index2].asReturnedValue();
+ if (l->objectLookupTwoClasses.ic == o->internalClass)
+ return o->memberData->values.data()[l->objectLookupTwoClasses.offset].asReturnedValue();
+ if (l->objectLookupTwoClasses.ic2 == o->internalClass)
+ return o->memberData->values.data()[l->objectLookupTwoClasses.offset2].asReturnedValue();
}
l->getter = getterFallback;
return getterFallback(l, engine, object);
}
-ReturnedValue Lookup::getter0Inlinegetter1(Lookup *l, ExecutionEngine *engine, const Value &object)
+ReturnedValue Lookup::getterProtoTwoClasses(Lookup *l, ExecutionEngine *engine, const Value &object)
{
// we can safely cast to a QV4::Object here. If object is actually a string,
// the internal class won't match
Heap::Object *o = static_cast<Heap::Object *>(object.heapObject());
if (o) {
- if (l->classList[0] == o->internalClass)
- return o->inlinePropertyDataWithOffset(l->index)->asReturnedValue();
- if (l->classList[2] == o->internalClass && l->classList[3] == o->prototype()->internalClass)
- return o->prototype()->propertyData(l->index2)->asReturnedValue();
- }
- l->getter = getterFallback;
- return getterFallback(l, engine, object);
-}
-
-ReturnedValue Lookup::getter0MemberDatagetter1(Lookup *l, ExecutionEngine *engine, const Value &object)
-{
- // we can safely cast to a QV4::Object here. If object is actually a string,
- // the internal class won't match
- Heap::Object *o = static_cast<Heap::Object *>(object.heapObject());
- if (o) {
- if (l->classList[0] == o->internalClass)
- return o->memberData->values.data()[l->index].asReturnedValue();
- if (l->classList[2] == o->internalClass && l->classList[3] == o->prototype()->internalClass)
- return o->prototype()->propertyData(l->index2)->asReturnedValue();
- }
- l->getter = getterFallback;
- return getterFallback(l, engine, object);
-}
-
-ReturnedValue Lookup::getter1getter1(Lookup *l, ExecutionEngine *engine, const Value &object)
-{
- // we can safely cast to a QV4::Object here. If object is actually a string,
- // the internal class won't match
- Heap::Object *o = static_cast<Heap::Object *>(object.heapObject());
- if (o) {
- if (l->classList[0] == o->internalClass &&
- l->classList[1] == o->prototype()->internalClass)
- return o->prototype()->propertyData(l->index)->asReturnedValue();
- if (l->classList[2] == o->internalClass &&
- l->classList[3] == o->prototype()->internalClass)
- return o->prototype()->propertyData(l->index2)->asReturnedValue();
+ if (l->protoLookupTwoClasses.icIdentifier == o->internalClass->id)
+ return l->protoLookupTwoClasses.data->asReturnedValue();
+ if (l->protoLookupTwoClasses.icIdentifier2 == o->internalClass->id)
+ return l->protoLookupTwoClasses.data2->asReturnedValue();
return getterFallback(l, engine, object);
}
l->getter = getterFallback;
return getterFallback(l, engine, object);
}
-
-ReturnedValue Lookup::getterAccessor0(Lookup *l, ExecutionEngine *engine, const Value &object)
+ReturnedValue Lookup::getterAccessor(Lookup *l, ExecutionEngine *engine, const Value &object)
{
// we can safely cast to a QV4::Object here. If object is actually a string,
// the internal class won't match
Heap::Object *o = static_cast<Heap::Object *>(object.heapObject());
if (o) {
- if (l->classList[0] == o->internalClass) {
- Scope scope(o->internalClass->engine);
- ScopedFunctionObject getter(scope, o->propertyData(l->index + Object::GetterOffset));
- if (!getter)
+ if (l->objectLookup.ic == o->internalClass) {
+ const Value *getter = o->propertyData(l->objectLookup.offset);
+ if (!getter->isFunctionObject()) // ### catch at resolve time
return Encode::undefined();
- JSCallData jsCallData(scope);
- *jsCallData->thisObject = object;
- return getter->call(jsCallData);
+ return static_cast<const FunctionObject *>(getter)->call(&object, nullptr, 0);
}
}
l->getter = getterFallback;
return getterFallback(l, engine, object);
}
-ReturnedValue Lookup::getterAccessor1(Lookup *l, ExecutionEngine *engine, const Value &object)
+ReturnedValue Lookup::getterProtoAccessor(Lookup *l, ExecutionEngine *engine, const Value &object)
{
// we can safely cast to a QV4::Object here. If object is actually a string,
// the internal class won't match
Heap::Object *o = static_cast<Heap::Object *>(object.heapObject());
- if (o) {
- if (l->classList[0] == o->internalClass &&
- l->classList[1] == l->proto->internalClass) {
- Scope scope(o->internalClass->engine);
- ScopedFunctionObject getter(scope, o->prototype()->propertyData(l->index + Object::GetterOffset));
- if (!getter)
- return Encode::undefined();
+ if (o && l->protoLookup.icIdentifier == o->internalClass->id) {
+ const Value *getter = l->protoLookup.data;
+ if (!getter->isFunctionObject()) // ### catch at resolve time
+ return Encode::undefined();
- JSCallData jsCallData(scope);
- *jsCallData->thisObject = object;
- return getter->call(jsCallData);
- }
+ return static_cast<const FunctionObject *>(getter)->call(&object, nullptr, 0);
}
- l->getter = getterFallback;
- return getterFallback(l, engine, object);
+ l->getter = getterTwoClasses;
+ return getterTwoClasses(l, engine, object);
}
-ReturnedValue Lookup::getterAccessor2(Lookup *l, ExecutionEngine *engine, const Value &object)
+ReturnedValue Lookup::getterProtoAccessorTwoClasses(Lookup *l, ExecutionEngine *engine, const Value &object)
{
// we can safely cast to a QV4::Object here. If object is actually a string,
// the internal class won't match
Heap::Object *o = static_cast<Heap::Object *>(object.heapObject());
if (o) {
- if (l->classList[0] == o->internalClass) {
- Q_ASSERT(o->prototype() == l->proto);
- if (l->classList[1] == l->proto->internalClass) {
- o = l->proto->prototype();
- if (l->classList[2] == o->internalClass) {
- Scope scope(o->internalClass->engine);
- ScopedFunctionObject getter(scope, o->propertyData(l->index + Object::GetterOffset));
- if (!getter)
- return Encode::undefined();
-
- JSCallData jsCallData(scope);
- *jsCallData->thisObject = object;
- return getter->call(jsCallData);
- }
- }
+ const Value *getter = nullptr;
+ if (l->protoLookupTwoClasses.icIdentifier == o->internalClass->id)
+ getter = l->protoLookupTwoClasses.data;
+ else if (l->protoLookupTwoClasses.icIdentifier2 == o->internalClass->id)
+ getter = l->protoLookupTwoClasses.data2;
+ if (getter) {
+ if (!getter->isFunctionObject()) // ### catch at resolve time
+ return Encode::undefined();
+
+ return static_cast<const FunctionObject *>(getter)->call(&object, nullptr, 0);
}
}
l->getter = getterFallback;
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);
diff --git a/src/qml/jsruntime/qv4object.cpp b/src/qml/jsruntime/qv4object.cpp
index 44414ad85a..e7368edad2 100644
--- a/src/qml/jsruntime/qv4object.cpp
+++ b/src/qml/jsruntime/qv4object.cpp
@@ -528,47 +528,6 @@ bool Object::deleteIndexedProperty(Managed *m, uint index)
return static_cast<Object *>(m)->internalDeleteIndexedProperty(index);
}
-ReturnedValue Object::getLookup(const Managed *m, Lookup *l)
-{
- const Object *o = static_cast<const Object *>(m);
- PropertyAttributes attrs;
- ReturnedValue v = l->lookup(o, &attrs);
- if (v != Primitive::emptyValue().asReturnedValue()) {
- l->proto = l->classList[0]->prototype;
- if (attrs.isData()) {
- Q_ASSERT(l->classList[0] == o->internalClass());
- if (l->level == 0) {
- uint nInline = o->d()->vtable()->nInlineProperties;
- if (l->index < nInline) {
- l->index += o->d()->vtable()->inlinePropertyOffset;
- l->getter = Lookup::getter0Inline;
- } else {
- l->index -= nInline;
- l->getter = Lookup::getter0MemberData;
- }
- }
- else if (l->level == 1)
- l->getter = Lookup::getter1;
- else if (l->level == 2)
- l->getter = Lookup::getter2;
- else
- l->getter = Lookup::getterFallback;
- return v;
- } else {
- if (l->level == 0)
- l->getter = Lookup::getterAccessor0;
- else if (l->level == 1)
- l->getter = Lookup::getterAccessor1;
- else if (l->level == 2)
- l->getter = Lookup::getterAccessor2;
- else
- l->getter = Lookup::getterFallback;
- return v;
- }
- }
- return Encode::undefined();
-}
-
bool Object::setLookup(Managed *m, Lookup *l, const Value &value)
{
Scope scope(static_cast<Object *>(m)->engine());
@@ -1280,19 +1239,6 @@ void Heap::ArrayObject::init(const QStringList &list)
a->setArrayLengthUnchecked(len);
}
-ReturnedValue ArrayObject::getLookup(const Managed *m, Lookup *l)
-{
- Scope scope(static_cast<const Object *>(m)->engine());
- ScopedString name(scope, scope.engine->currentStackFrame->v4Function->compilationUnit->runtimeStrings[l->nameIndex]);
- if (name->equals(scope.engine->id_length())) {
- // special case, as the property is on the object itself
- l->getter = Lookup::arrayLengthGetter;
- const ArrayObject *a = static_cast<const ArrayObject *>(m);
- return a->propertyData(Heap::ArrayObject::LengthPropertyIndex)->asReturnedValue();
- }
- return Object::getLookup(m, l);
-}
-
uint ArrayObject::getLength(const Managed *m)
{
const ArrayObject *a = static_cast<const ArrayObject *>(m);
diff --git a/src/qml/jsruntime/qv4object_p.h b/src/qml/jsruntime/qv4object_p.h
index 0abb9b8fa5..4f4c60408e 100644
--- a/src/qml/jsruntime/qv4object_p.h
+++ b/src/qml/jsruntime/qv4object_p.h
@@ -172,7 +172,6 @@ struct ObjectVTable
PropertyAttributes (*queryIndexed)(const Managed *, uint index);
bool (*deleteProperty)(Managed *m, String *name);
bool (*deleteIndexedProperty)(Managed *m, uint index);
- ReturnedValue (*getLookup)(const Managed *m, Lookup *l);
bool (*setLookup)(Managed *m, Lookup *l, const Value &v);
uint (*getLength)(const Managed *m);
void (*advanceIterator)(Managed *m, ObjectIterator *it, Value *name, uint *index, Property *p, PropertyAttributes *attributes);
@@ -193,7 +192,6 @@ const QV4::ObjectVTable classname::static_vtbl = \
queryIndexed, \
deleteProperty, \
deleteIndexedProperty, \
- getLookup, \
setLookup, \
getLength, \
advanceIterator, \
@@ -416,8 +414,6 @@ public:
{ return vtable()->deleteProperty(this, name); }
bool deleteIndexedProperty(uint index)
{ return vtable()->deleteIndexedProperty(this, index); }
- ReturnedValue getLookup(Lookup *l) const
- { return vtable()->getLookup(this, l); }
bool setLookup(Lookup *l, const Value &v)
{ return vtable()->setLookup(this, l, v); }
void advanceIterator(ObjectIterator *it, Value *name, uint *index, Property *p, PropertyAttributes *attributes)
@@ -437,7 +433,6 @@ protected:
static PropertyAttributes queryIndexed(const Managed *m, uint index);
static bool deleteProperty(Managed *m, String *name);
static bool deleteIndexedProperty(Managed *m, uint index);
- static ReturnedValue getLookup(const Managed *m, Lookup *l);
static bool setLookup(Managed *m, Lookup *l, const Value &v);
static void advanceIterator(Managed *m, ObjectIterator *it, Value *name, uint *index, Property *p, PropertyAttributes *attributes);
static uint getLength(const Managed *m);
@@ -521,7 +516,6 @@ struct ArrayObject: Object {
void init(ExecutionEngine *engine);
- static ReturnedValue getLookup(const Managed *m, Lookup *l);
using Object::getLength;
static uint getLength(const Managed *m);