aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4setobject_p.h
diff options
context:
space:
mode:
authorRobin Burchell <robin.burchell@crimson.no>2018-06-01 01:27:47 +0200
committerRobin Burchell <robin.burchell@crimson.no>2018-06-27 16:13:42 +0000
commit3cda7df8ac8fc6f9a5562e89a4b047449dc3b2bc (patch)
tree199ab0e72318b88b64f9833c6fffd12a94b5db3d /src/qml/jsruntime/qv4setobject_p.h
parentb4d31c9ff5f0c5821ea127c663532d9fc2cae43e (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/qv4setobject_p.h')
-rw-r--r--src/qml/jsruntime/qv4setobject_p.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/qml/jsruntime/qv4setobject_p.h b/src/qml/jsruntime/qv4setobject_p.h
index ba0ed6bfe7..1335a9a712 100644
--- a/src/qml/jsruntime/qv4setobject_p.h
+++ b/src/qml/jsruntime/qv4setobject_p.h
@@ -60,18 +60,19 @@ QT_BEGIN_NAMESPACE
namespace QV4 {
+class ESTable;
+
namespace Heap {
struct SetCtor : FunctionObject {
void init(QV4::ExecutionContext *scope);
};
-#define SetObjectMembers(class, Member) \
- Member(class, Pointer, ArrayObject *, setArray)
-
-DECLARE_HEAP_OBJECT(SetObject, Object) {
- DECLARE_MARKOBJECTS(SetObject);
- void init() { Object::init(); }
+struct SetObject : Object {
+ static void markObjects(Heap::Base *that, MarkStack *markStack);
+ void init();
+ void destroy();
+ ESTable *esTable;
};
}
@@ -88,6 +89,7 @@ struct SetObject : Object
{
V4_OBJECT2(SetObject, Object)
V4_PROTOTYPE(setPrototype)
+ V4_NEEDS_DESTROY
};
struct SetPrototype : Object