diff options
-rw-r--r-- | src/qml/jsruntime/qv4objectiterator.cpp | 31 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4objectiterator_p.h | 5 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgthreadedrenderloop.cpp | 7 |
3 files changed, 29 insertions, 14 deletions
diff --git a/src/qml/jsruntime/qv4objectiterator.cpp b/src/qml/jsruntime/qv4objectiterator.cpp index daee44cfb6..f9038472df 100644 --- a/src/qml/jsruntime/qv4objectiterator.cpp +++ b/src/qml/jsruntime/qv4objectiterator.cpp @@ -46,17 +46,7 @@ ObjectIterator::ObjectIterator(Value *scratch1, Value *scratch2, Object *o, uint , memberIndex(0) , flags(flags) { - object->o = o; - current->o = o; -#if QT_POINTER_SIZE == 4 - object->tag = QV4::Value::Managed_Type; - current->tag = QV4::Value::Managed_Type; -#endif - - if (object->as<ArgumentsObject>()) { - Scope scope(object->engine()); - Scoped<ArgumentsObject> (scope, object->asReturnedValue())->fullyCreate(); - } + init(o); } ObjectIterator::ObjectIterator(Scope &scope, Object *o, uint flags) @@ -67,8 +57,27 @@ ObjectIterator::ObjectIterator(Scope &scope, Object *o, uint flags) , memberIndex(0) , flags(flags) { + init(o); +} + +ObjectIterator::ObjectIterator(Value *scratch1, Value *scratch2, uint flags) + : object(scratch1) + , current(scratch2) + , arrayNode(0) + , arrayIndex(0) + , memberIndex(0) + , flags(flags) +{ + object->o = (Object*)0; + current->o = (Object*)0; + // Caller needs to call init! +} + +void ObjectIterator::init(Object *o) +{ object->o = o; current->o = o; + #if QT_POINTER_SIZE == 4 object->tag = QV4::Value::Managed_Type; current->tag = QV4::Value::Managed_Type; diff --git a/src/qml/jsruntime/qv4objectiterator_p.h b/src/qml/jsruntime/qv4objectiterator_p.h index 4bb164ed0c..3ed73b5c08 100644 --- a/src/qml/jsruntime/qv4objectiterator_p.h +++ b/src/qml/jsruntime/qv4objectiterator_p.h @@ -50,6 +50,7 @@ struct ExecutionContext; struct Property; struct String; struct InternalClass; +struct ForEachIteratorObject; struct Q_QML_EXPORT ObjectIterator { @@ -68,10 +69,14 @@ struct Q_QML_EXPORT ObjectIterator ObjectIterator(Value *scratch1, Value *scratch2, Object *o, uint flags); ObjectIterator(Scope &scope, Object *o, uint flags); + void init(Object *o); void next(String *&name, uint *index, Property *pd, PropertyAttributes *attributes = 0); ReturnedValue nextPropertyName(ValueRef value); ReturnedValue nextPropertyNameAsString(ValueRef value); ReturnedValue nextPropertyNameAsString(); +private: + friend struct ForEachIteratorObject; + ObjectIterator(Value *scratch1, Value *scratch2, uint flags); // Constructor that requires calling init() }; struct ForEachIteratorObject: Object { diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp index ff32ccb358..7ac5f0a921 100644 --- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp +++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp @@ -552,6 +552,10 @@ void QSGRenderThread::syncAndRender() qCDebug(QSG_LOG_RENDERLOOP) << QSG_RT_PAD << "- updatePending, doing sync"; sync(pending == ExposeRequest); } +#ifndef QSG_NO_RENDER_TIMING + if (profileFrames) + syncTime = threadTimer.nsecsElapsed(); +#endif if (!syncResultedInChanges && ((pending & RepaintRequest) == 0)) { qCDebug(QSG_LOG_RENDERLOOP) << QSG_RT_PAD << "- no changes, render aborted"; @@ -561,9 +565,6 @@ void QSGRenderThread::syncAndRender() return; } - if (profileFrames) - syncTime = threadTimer.nsecsElapsed(); - qCDebug(QSG_LOG_RENDERLOOP) << QSG_RT_PAD << "- rendering started"; QQuickWindowPrivate *d = QQuickWindowPrivate::get(window); |