From 6b4b2f5f1bbd706742cbab8764a1d07cbd912600 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 24 Jan 2017 12:07:33 +0100 Subject: New mark table implementation Automatically generate a table containing the data where JS Values and pointers are in objects in the JS heap. This will allow making the GC mark phase a lot more efficient. A bit of a special hack is currently required for MemberData and ArrayData, as they have a variable length, and we need to read the size from the object. We keep backwards compatibility with the old markObjects() functions for now (calling them if they are defined). Some further work on QV4::String and in a few other places is required before we can get remove the compatibility. Change-Id: I78528ace67e886bdbe4a4330c9677c7fc9f08a33 Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4qobjectwrapper_p.h | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'src/qml/jsruntime/qv4qobjectwrapper_p.h') diff --git a/src/qml/jsruntime/qv4qobjectwrapper_p.h b/src/qml/jsruntime/qv4qobjectwrapper_p.h index d81ef2a680..002e1f2eb0 100644 --- a/src/qml/jsruntime/qv4qobjectwrapper_p.h +++ b/src/qml/jsruntime/qv4qobjectwrapper_p.h @@ -95,7 +95,15 @@ private: QQmlQPointer qObj; }; -struct QObjectMethod : FunctionObject { +#define QObjectMethodMembers(class, Member) \ + Member(class, Pointer, valueTypeWrapper) \ + Member(class, QQmlQPointer, qObj) \ + Member(class, QQmlPropertyCache *, _propertyCache) \ + Member(class, int, index) + +DECLARE_HEAP_OBJECT(QObjectMethod, FunctionObject) { + DECLARE_MARK_TABLE(QObjectMethod); + void init(QV4::ExecutionContext *scope); void destroy() { @@ -113,18 +121,10 @@ struct QObjectMethod : FunctionObject { _propertyCache = c; } - Pointer valueTypeWrapper; - const QMetaObject *metaObject(); QObject *object() const { return qObj.data(); } void setObject(QObject *o) { qObj = o; } -private: - QQmlQPointer qObj; - QQmlPropertyCache *_propertyCache; - -public: - int index; }; struct QMetaObjectWrapper : FunctionObject { @@ -243,8 +243,6 @@ struct Q_QML_EXPORT QObjectMethod : public QV4::FunctionObject void callInternal(CallData *callData, Scope &scope) const; - static void markObjects(Heap::Base *that, QV4::ExecutionEngine *e); - static QPair extractQtMethod(const QV4::FunctionObject *function); }; -- cgit v1.2.3