diff options
author | Lars Knoll <lars.knoll@digia.com> | 2014-04-29 11:10:35 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2014-07-22 13:49:03 +0200 |
commit | fdc26425024132c5ffe37a53b7420da57b6af187 (patch) | |
tree | d7eef50fd7499a06960a3f3a7a26454ce344828d /src/qml/jsruntime/qv4objectiterator_p.h | |
parent | eedd22f7dd8330a767b73d008d3a60eed77cd900 (diff) |
Convert ObjectIterator to new storage scheme
Change-Id: I35631089e6791349ade08c6ed063f1e8ab1bdaea
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4objectiterator_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4objectiterator_p.h | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/qml/jsruntime/qv4objectiterator_p.h b/src/qml/jsruntime/qv4objectiterator_p.h index b914990ccd..05909742f7 100644 --- a/src/qml/jsruntime/qv4objectiterator_p.h +++ b/src/qml/jsruntime/qv4objectiterator_p.h @@ -83,29 +83,31 @@ struct Q_QML_EXPORT ObjectIterator }; struct ForEachIteratorObject: Object { - V4_OBJECT - Q_MANAGED_TYPE(ForeachIteratorObject) - 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) {} + struct Data : Object::Data { + Data(const ObjectRef o, uint flags) + : it(workArea, workArea + 1, o, flags) {} ObjectIterator it; + Value workArea[2]; }; - Data data; + struct _Data { + _Data(const ObjectRef o, uint flags) + : it(workArea, workArea + 1, o, flags) {} + ObjectIterator it; + Value workArea[2]; + } __data; + V4_OBJECT_NEW + Q_MANAGED_TYPE(ForeachIteratorObject) ForEachIteratorObject(ExecutionContext *ctx, const ObjectRef o) - : Object(ctx->engine), data(workArea, workArea + 1, - o, ObjectIterator::EnumerableOnly|ObjectIterator::WithProtoChain) { + : Object(ctx->engine) + , __data(o, ObjectIterator::EnumerableOnly|ObjectIterator::WithProtoChain) { setVTable(staticVTable()); } - ReturnedValue nextPropertyName() { return data.it.nextPropertyNameAsString(); } + ReturnedValue nextPropertyName() { return d()->it.nextPropertyNameAsString(); } protected: static void markObjects(Managed *that, ExecutionEngine *e); - - Value workArea[2]; }; |