diff options
Diffstat (limited to 'src/qml/jsruntime/qv4qobjectwrapper_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4qobjectwrapper_p.h | 46 |
1 files changed, 18 insertions, 28 deletions
diff --git a/src/qml/jsruntime/qv4qobjectwrapper_p.h b/src/qml/jsruntime/qv4qobjectwrapper_p.h index 7225612f08..288585f844 100644 --- a/src/qml/jsruntime/qv4qobjectwrapper_p.h +++ b/src/qml/jsruntime/qv4qobjectwrapper_p.h @@ -33,6 +33,7 @@ class QObject; class QQmlData; class QQmlPropertyCache; class QQmlPropertyData; +class QQmlObjectOrGadget; namespace QV4 { struct QObjectSlotDispatcher; @@ -71,7 +72,7 @@ DECLARE_EXPORTED_HEAP_OBJECT(QObjectMethod, FunctionObject) { int methodCount; int index; - void init(QV4::ExecutionContext *scope, Object *wrapper, int index); + void init(QV4::ExecutionEngine *engine, Object *wrapper, int index); void destroy() { if (methods != reinterpret_cast<const QQmlPropertyData *>(&_singleMethod)) @@ -97,16 +98,6 @@ DECLARE_EXPORTED_HEAP_OBJECT(QObjectMethod, FunctionObject) { QV4::Heap::QObjectMethod::ThisObjectMode checkThisObject(const QMetaObject *thisMeta) const; }; -struct QMetaObjectWrapper : FunctionObject { - const QMetaObject* metaObject; - QQmlPropertyData *constructors; - int constructorCount; - - void init(const QMetaObject* metaObject); - void destroy(); - void ensureConstructorsCache(); -}; - struct QmlSignalHandler : Object { void init(QObject *object, int signalIndex); void destroy() { @@ -357,10 +348,11 @@ struct Q_QML_EXPORT QObjectMethod : public QV4::FunctionObject enum { DestroyMethod = -1, ToStringMethod = -2 }; - static ReturnedValue create(QV4::ExecutionContext *scope, Heap::Object *wrapper, int index); + static ReturnedValue create(ExecutionEngine *engine, Heap::Object *wrapper, int index); static ReturnedValue create( - QV4::ExecutionContext *scope, Heap::QQmlValueTypeWrapper *valueType, int index); - static ReturnedValue create(QV4::ExecutionEngine *engine, Heap::QObjectMethod *cloneFrom, + ExecutionEngine *engine, Heap::QQmlValueTypeWrapper *valueType, int index); + static ReturnedValue create( + ExecutionEngine *engine, Heap::QObjectMethod *cloneFrom, Heap::Object *wrapper, Heap::Object *object); int methodIndex() const { return d()->index; } @@ -385,24 +377,22 @@ struct Q_QML_EXPORT QObjectMethod : public QV4::FunctionObject QObject *thisObject, void **argv, const QMetaType *types, int argc) const; static QPair<QObject *, int> extractQtMethod(const QV4::FunctionObject *function); -}; - -struct Q_QML_EXPORT QMetaObjectWrapper : public QV4::FunctionObject -{ - V4_OBJECT2(QMetaObjectWrapper, QV4::FunctionObject) - V4_NEEDS_DESTROY +private: + friend struct QMetaObjectWrapper; - static ReturnedValue create(ExecutionEngine *engine, const QMetaObject* metaObject); - const QMetaObject *metaObject() const { return d()->metaObject; } + static const QQmlPropertyData *resolveOverloaded( + const QQmlObjectOrGadget &object, const QQmlPropertyData *methods, int methodCount, + ExecutionEngine *engine, CallData *callArgs); -protected: - static ReturnedValue virtualCallAsConstructor(const FunctionObject *, const Value *argv, int argc, const Value *); - static bool virtualIsEqualTo(Managed *a, Managed *b); + static const QQmlPropertyData *resolveOverloaded( + const QQmlPropertyData *methods, int methodCount, + void **argv, int argc, const QMetaType *types); -private: - void init(ExecutionEngine *engine); - ReturnedValue constructInternal(const Value *argv, int argc) const; + static ReturnedValue callPrecise( + const QQmlObjectOrGadget &object, const QQmlPropertyData &data, + ExecutionEngine *engine, CallData *callArgs, + QMetaObject::Call callType = QMetaObject::InvokeMetaMethod); }; struct Q_QML_EXPORT QmlSignalHandler : public QV4::Object |