diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-01-05 15:30:23 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-04-12 13:59:08 +0000 |
commit | 6002b48c3c5edc509c269c801fc8a088d5065ce8 (patch) | |
tree | a8fc764de87bfbd5f201930dcec1c7459502eb7e /src/qml/jsruntime/qv4engine_p.h | |
parent | 3932536b59df7b2fa010be6dd9f2501f6e306c8b (diff) |
garbage collect InternalClass
Internal classes are now allocated and collected through
the GC. As they are important to the deletion of other
objects (because of the vtable pointer living inside the
internal class), they need to get destroyed after regular
objects have been sweeped. Achieve this by using a separate
block allocator for internal class objects.
Our lookups do often contain pointers to internal classes,
so those need to be marked as well, so we don't accidentally
collect them.
Change-Id: I4762b054361c70c31f79f920f669ea0e8551601f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4engine_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4engine_p.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/qml/jsruntime/qv4engine_p.h b/src/qml/jsruntime/qv4engine_p.h index c1ee5ee926..737f377730 100644 --- a/src/qml/jsruntime/qv4engine_p.h +++ b/src/qml/jsruntime/qv4engine_p.h @@ -400,10 +400,10 @@ public: int newInternalClassId() { return ++internalClassIdCount; } - InternalClass *newInternalClass(const VTable *vtable, Object *prototype); + Heap::InternalClass *newInternalClass(const VTable *vtable, Object *prototype); Heap::Object *newObject(); - Heap::Object *newObject(InternalClass *internalClass); + Heap::Object *newObject(Heap::InternalClass *internalClass); Heap::String *newString(const QString &s = QString()); Heap::String *newIdentifier(const QString &text); @@ -415,7 +415,7 @@ public: Heap::ArrayObject *newArrayObject(int count = 0); Heap::ArrayObject *newArrayObject(const Value *values, int length); Heap::ArrayObject *newArrayObject(const QStringList &list); - Heap::ArrayObject *newArrayObject(InternalClass *ic); + Heap::ArrayObject *newArrayObject(Heap::InternalClass *ic); Heap::ArrayBuffer *newArrayBuffer(const QByteArray &array); Heap::ArrayBuffer *newArrayBuffer(size_t length); @@ -455,7 +455,7 @@ public: void initRootContext(); - InternalClass *newClass(InternalClass *other); + Heap::InternalClass *newClass(Heap::InternalClass *other); StackTrace exceptionStackTrace; |