diff options
Diffstat (limited to 'src/qml/debugger/qqmlprofiler_p.h')
-rw-r--r-- | src/qml/debugger/qqmlprofiler_p.h | 59 |
1 files changed, 54 insertions, 5 deletions
diff --git a/src/qml/debugger/qqmlprofiler_p.h b/src/qml/debugger/qqmlprofiler_p.h index 707901063c..6643695d11 100644 --- a/src/qml/debugger/qqmlprofiler_p.h +++ b/src/qml/debugger/qqmlprofiler_p.h @@ -63,6 +63,54 @@ QT_BEGIN_NAMESPACE +#ifdef QT_NO_QML_DEBUGGER + +#define Q_QML_PROFILE_IF_ENABLED(feature, profiler, Code) +#define Q_QML_PROFILE(feature, profiler, Method) +#define Q_QML_OC_PROFILE(member, Code) + +struct QQmlProfiler {}; + +struct QQmlBindingProfiler +{ + QQmlBindingProfiler(quintptr, QQmlBinding *, QV4::FunctionObject *) {} +}; + +struct QQmlHandlingSignalProfiler +{ + QQmlHandlingSignalProfiler(quintptr, QQmlBoundSignalExpression *) {} +}; + +struct QQmlCompilingProfiler +{ + QQmlCompilingProfiler(quintptr, QQmlDataBlob *) {} +}; + +struct QQmlVmeProfiler { + QQmlVmeProfiler() {} + + void init(quintptr, int) {} + + const QV4::CompiledData::Object *pop() { return nullptr; } + void push(const QV4::CompiledData::Object *) {} + + static const quintptr profiler = 0; +}; + +struct QQmlObjectCreationProfiler +{ + QQmlObjectCreationProfiler(quintptr, const QV4::CompiledData::Object *) {} + void update(QV4::CompiledData::CompilationUnit *, const QV4::CompiledData::Object *, + const QString &, const QUrl &) {} +}; + +struct QQmlObjectCompletionProfiler +{ + QQmlObjectCompletionProfiler(QQmlVmeProfiler *) {} +}; + +#else + #define Q_QML_PROFILE_IF_ENABLED(feature, profiler, Code)\ if (profiler && (profiler->featuresEnabled & (1 << feature))) {\ Code;\ @@ -72,6 +120,9 @@ QT_BEGIN_NAMESPACE #define Q_QML_PROFILE(feature, profiler, Method)\ Q_QML_PROFILE_IF_ENABLED(feature, profiler, profiler->Method) +#define Q_QML_OC_PROFILE(member, Code)\ + Q_QML_PROFILE_IF_ENABLED(QQmlProfilerDefinitions::ProfileCreating, member.profiler, Code) + // This struct is somewhat dangerous to use: // The messageType is a bit field. You can pack multiple messages into // one object, e.g. RangeStart and RangeLocation. Each one will be read @@ -94,7 +145,7 @@ struct Q_AUTOTEST_EXPORT QQmlProfilerData : public QQmlProfilerDefinitions Q_DECLARE_TYPEINFO(QQmlProfilerData, Q_MOVABLE_TYPE); -class QQmlProfiler : public QObject, public QQmlProfilerDefinitions { +class Q_QML_PRIVATE_EXPORT QQmlProfiler : public QObject, public QQmlProfilerDefinitions { Q_OBJECT public: @@ -250,7 +301,6 @@ public: return reinterpret_cast<quintptr>(pointer); } -public slots: void startProfiling(quint64 features); void stopProfiling(); void reportData(bool trackLocations); @@ -349,9 +399,6 @@ private: QFiniteStack<const QV4::CompiledData::Object *> ranges; }; -#define Q_QML_OC_PROFILE(member, Code)\ - Q_QML_PROFILE_IF_ENABLED(QQmlProfilerDefinitions::ProfileCreating, member.profiler, Code) - class QQmlObjectCreationProfiler { public: @@ -399,4 +446,6 @@ QT_END_NAMESPACE Q_DECLARE_METATYPE(QVector<QQmlProfilerData>) Q_DECLARE_METATYPE(QQmlProfiler::LocationHash) +#endif // QT_NO_QML_DEBUGGER + #endif // QQMLPROFILER_P_H |