From 3f1d0b27a11a1d560c11057d2a801224d1613d60 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 23 Jul 2014 13:56:43 +0200 Subject: Changed Value to store Managed::Data pointers directly This is a step towards storing direct heap object pointers for the values on the JS stack, to avoid the costly indirection for data access. Change-Id: Ibb57ed6cf52a7088bbc95ee04ae3a4cb25b8c045 Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4objectiterator.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/qml/jsruntime/qv4objectiterator.cpp') diff --git a/src/qml/jsruntime/qv4objectiterator.cpp b/src/qml/jsruntime/qv4objectiterator.cpp index f9ccb8f829..b2875a192d 100644 --- a/src/qml/jsruntime/qv4objectiterator.cpp +++ b/src/qml/jsruntime/qv4objectiterator.cpp @@ -68,15 +68,15 @@ ObjectIterator::ObjectIterator(Value *scratch1, Value *scratch2, uint flags) , memberIndex(0) , flags(flags) { - object->m = (Object*)0; - current->m = (Object*)0; + object->m = 0; + current->m = 0; // Caller needs to call init! } void ObjectIterator::init(Object *o) { - object->m = o; - current->m = o; + object->m = o ? &o->data : 0; + current->m = o ? &o->data : 0; #if QT_POINTER_SIZE == 4 object->tag = QV4::Value::Managed_Type; @@ -125,10 +125,11 @@ void ObjectIterator::next(String *&name, uint *index, Property *pd, PropertyAttr return; } - if (flags & WithProtoChain) - current->m = current->objectValue()->prototype(); - else - current->m = (Object *)0; + if (flags & WithProtoChain) { + Object *proto = current->objectValue()->prototype(); + current->m = proto ? &proto->data : 0; + } else + current->m = (HeapObject *)0; arrayIndex = 0; memberIndex = 0; -- cgit v1.2.3