aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4lookup_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-01-05 15:30:23 +0100
committerLars Knoll <lars.knoll@qt.io>2018-04-12 13:59:08 +0000
commit6002b48c3c5edc509c269c801fc8a088d5065ce8 (patch)
treea8fc764de87bfbd5f201930dcec1c7459502eb7e /src/qml/jsruntime/qv4lookup_p.h
parent3932536b59df7b2fa010be6dd9f2501f6e306c8b (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/qv4lookup_p.h')
-rw-r--r--src/qml/jsruntime/qv4lookup_p.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/qml/jsruntime/qv4lookup_p.h b/src/qml/jsruntime/qv4lookup_p.h
index 5f507733fd..fb09e5958c 100644
--- a/src/qml/jsruntime/qv4lookup_p.h
+++ b/src/qml/jsruntime/qv4lookup_p.h
@@ -73,7 +73,7 @@ struct Lookup {
};
union {
struct {
- InternalClass *ic;
+ Heap::InternalClass *ic;
int offset;
} objectLookup;
struct {
@@ -81,8 +81,8 @@ struct Lookup {
int icIdentifier;
} protoLookup;
struct {
- InternalClass *ic;
- InternalClass *ic2;
+ Heap::InternalClass *ic;
+ Heap::InternalClass *ic2;
int offset;
int offset2;
} objectLookupTwoClasses;
@@ -100,7 +100,7 @@ struct Lookup {
Heap::Object *proto;
} primitiveLookup;
struct {
- InternalClass *newClass;
+ Heap::InternalClass *newClass;
int icIdentifier;
int offset;
} insertionLookup;
@@ -144,6 +144,8 @@ struct Lookup {
static bool setter0setter0(Lookup *l, ExecutionEngine *engine, Value &object, const Value &value);
static bool setterInsert(Lookup *l, ExecutionEngine *engine, Value &object, const Value &value);
static bool arrayLengthSetter(Lookup *l, ExecutionEngine *engine, Value &object, const Value &value);
+
+ void markObjects(MarkStack *stack);
};
Q_STATIC_ASSERT(std::is_standard_layout<Lookup>::value);