diff options
author | Robin Burchell <robin.burchell@crimson.no> | 2018-06-01 01:27:47 +0200 |
---|---|---|
committer | Robin Burchell <robin.burchell@crimson.no> | 2018-06-27 16:13:42 +0000 |
commit | 3cda7df8ac8fc6f9a5562e89a4b047449dc3b2bc (patch) | |
tree | 199ab0e72318b88b64f9833c6fffd12a94b5db3d /src/qml/jsruntime/qv4mapobject_p.h | |
parent | b4d31c9ff5f0c5821ea127c663532d9fc2cae43e (diff) |
Map/Set: Introduce QV4::ESTable
This removes the duplication of code between Map and Set by placing it
in a shared location, and will hopefully be a touch more efficient than
using ArrayObject.
In a followup patch, it will get faster, too.
Note: As a bonus, this also fixed a few more test failures: forEach
wasn't handling the object being changed during iteration.
Task-number: QTBUG-68545
Change-Id: I8bf6f9c5b2de030a02ce27a23b8c1da431ffeda4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4mapobject_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4mapobject_p.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/qml/jsruntime/qv4mapobject_p.h b/src/qml/jsruntime/qv4mapobject_p.h index 9c64e25c3d..9543c69928 100644 --- a/src/qml/jsruntime/qv4mapobject_p.h +++ b/src/qml/jsruntime/qv4mapobject_p.h @@ -60,19 +60,19 @@ QT_BEGIN_NAMESPACE namespace QV4 { +class ESTable; + namespace Heap { struct MapCtor : FunctionObject { void init(QV4::ExecutionContext *scope); }; -#define MapObjectMembers(class, Member) \ - Member(class, Pointer, ArrayObject *, mapKeys) \ - Member(class, Pointer, ArrayObject *, mapValues) - -DECLARE_HEAP_OBJECT(MapObject, Object) { - DECLARE_MARKOBJECTS(MapObject); - void init() { Object::init(); } +struct MapObject : Object { + static void markObjects(Heap::Base *that, MarkStack *markStack); + void init(); + void destroy(); + ESTable *esTable; }; } @@ -89,6 +89,7 @@ struct MapObject : Object { V4_OBJECT2(MapObject, Object) V4_PROTOTYPE(mapPrototype) + V4_NEEDS_DESTROY }; struct MapPrototype : Object |