From 441a6ff47a713587f1b43c61377ed64caf15692f Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 10 Apr 2014 17:17:14 +0200 Subject: Convert ObjectIterator to new data layout Change-Id: Icda43ec9c1e324afebcf632a5fdcc40d855b193d Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4objectiterator_p.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/qml/jsruntime/qv4objectiterator_p.h') diff --git a/src/qml/jsruntime/qv4objectiterator_p.h b/src/qml/jsruntime/qv4objectiterator_p.h index c87f284288..b914990ccd 100644 --- a/src/qml/jsruntime/qv4objectiterator_p.h +++ b/src/qml/jsruntime/qv4objectiterator_p.h @@ -85,14 +85,22 @@ struct Q_QML_EXPORT ObjectIterator struct ForEachIteratorObject: Object { V4_OBJECT Q_MANAGED_TYPE(ForeachIteratorObject) - ObjectIterator it; + struct Data { + Data(Value *scratch1, Value *scratch2, const ObjectRef o, uint flags) + : it(scratch1, scratch2, o, flags) {} + Data(Scope &scope, const ObjectRef o, uint flags) + : it (scope, o, flags) {} + ObjectIterator it; + }; + Data data; + ForEachIteratorObject(ExecutionContext *ctx, const ObjectRef o) - : Object(ctx->engine), it(workArea, workArea + 1, - o, ObjectIterator::EnumerableOnly|ObjectIterator::WithProtoChain) { + : Object(ctx->engine), data(workArea, workArea + 1, + o, ObjectIterator::EnumerableOnly|ObjectIterator::WithProtoChain) { setVTable(staticVTable()); } - ReturnedValue nextPropertyName() { return it.nextPropertyNameAsString(); } + ReturnedValue nextPropertyName() { return data.it.nextPropertyNameAsString(); } protected: static void markObjects(Managed *that, ExecutionEngine *e); -- cgit v1.2.3