aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4setobject_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-08-26 17:50:44 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2018-08-28 21:45:48 +0000
commit94f0d86b5d4c52a6af4843d05d47e7dcf2d1acaa (patch)
tree60e7d8615999d854e365c4caf1fc003ab83540c9 /src/qml/jsruntime/qv4setobject_p.h
parent464b878b973710077b2b92b1682d6f38c83554dd (diff)
Add support for WeakSet
Change-Id: I5cee2bf0c6a45ad2c14b52e1a4fc5ef015e01042 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4setobject_p.h')
-rw-r--r--src/qml/jsruntime/qv4setobject_p.h37
1 files changed, 33 insertions, 4 deletions
diff --git a/src/qml/jsruntime/qv4setobject_p.h b/src/qml/jsruntime/qv4setobject_p.h
index 34649c3f01..21584e2132 100644
--- a/src/qml/jsruntime/qv4setobject_p.h
+++ b/src/qml/jsruntime/qv4setobject_p.h
@@ -64,7 +64,12 @@ class ESTable;
namespace Heap {
-struct SetCtor : FunctionObject {
+struct WeakSetCtor : FunctionObject {
+ void init(QV4::ExecutionContext *scope);
+};
+
+
+struct SetCtor : WeakSetCtor {
void init(QV4::ExecutionContext *scope);
};
@@ -72,19 +77,33 @@ struct SetObject : Object {
static void markObjects(Heap::Base *that, MarkStack *markStack);
void init();
void destroy();
+ void removeUnmarkedKeys();
+
ESTable *esTable;
+ SetObject *nextWeakSet;
+ bool isWeakSet;
};
}
-struct SetCtor: FunctionObject
+
+struct WeakSetCtor: FunctionObject
{
- V4_OBJECT2(SetCtor, FunctionObject)
+ V4_OBJECT2(WeakSetCtor, FunctionObject)
+
+ static ReturnedValue construct(const FunctionObject *f, const Value *argv, int argc, const Value *, bool weakSet);
static ReturnedValue virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *);
static ReturnedValue virtualCall(const FunctionObject *f, const Value *thisObject, const Value *argv, int argc);
};
+struct SetCtor : WeakSetCtor
+{
+ V4_OBJECT2(SetCtor, WeakSetCtor)
+
+ static ReturnedValue virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *);
+};
+
struct SetObject : Object
{
V4_OBJECT2(SetObject, Object)
@@ -92,7 +111,17 @@ struct SetObject : Object
V4_NEEDS_DESTROY
};
-struct SetPrototype : Object
+struct WeakSetPrototype : Object
+{
+ void init(ExecutionEngine *engine, Object *ctor);
+
+ static ReturnedValue method_add(const FunctionObject *, const Value *thisObject, const Value *argv, int argc);
+ static ReturnedValue method_delete(const FunctionObject *, const Value *thisObject, const Value *argv, int argc);
+ static ReturnedValue method_has(const FunctionObject *, const Value *thisObject, const Value *argv, int argc);
+};
+
+
+struct SetPrototype : WeakSetPrototype
{
void init(ExecutionEngine *engine, Object *ctor);