aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4profiling_p.h
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2016-07-25 17:20:04 +0200
committerUlf Hermann <ulf.hermann@qt.io>2016-07-28 12:59:57 +0000
commitd32319eca446d5583af9081a0056dea4667d6096 (patch)
tree18c01828f49fbe803bfb6ccc2d490b7f62a55aaa /src/qml/jsruntime/qv4profiling_p.h
parent901b975fb5be147b9bb446c7b9f61c2d448a94ab (diff)
Replace debugger and profiler with stubs on -no-qml-debug
Change-Id: I0f029d92366b3b508bf024c67b877a14bae27cd6 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4profiling_p.h')
-rw-r--r--src/qml/jsruntime/qv4profiling_p.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4profiling_p.h b/src/qml/jsruntime/qv4profiling_p.h
index c684d48368..fd14c0ae93 100644
--- a/src/qml/jsruntime/qv4profiling_p.h
+++ b/src/qml/jsruntime/qv4profiling_p.h
@@ -57,8 +57,24 @@
#include <QElapsedTimer>
+#ifdef QT_NO_QML_DEBUGGER
+
+#define Q_V4_PROFILE_ALLOC(engine, size, type) (!engine)
+#define Q_V4_PROFILE_DEALLOC(engine, size, type) (!engine)
+#define Q_V4_PROFILE(engine, function) (function->code(engine, function->codeData))
+
QT_BEGIN_NAMESPACE
+namespace QV4 {
+namespace Profiling {
+struct Profiler {};
+}
+}
+
+QT_END_NAMESPACE
+
+#else
+
#define Q_V4_PROFILE_ALLOC(engine, size, type)\
(engine->profiler &&\
(engine->profiler->featuresEnabled & (1 << Profiling::FeatureMemoryAllocation)) ?\
@@ -75,6 +91,8 @@ QT_BEGIN_NAMESPACE
Profiling::FunctionCallProfiler::profileCall(engine->profiler, engine, function) :\
function->code(engine, function->codeData))
+QT_BEGIN_NAMESPACE
+
namespace QV4 {
namespace Profiling {
@@ -288,4 +306,6 @@ Q_DECLARE_METATYPE(QV4::Profiling::FunctionLocationHash)
Q_DECLARE_METATYPE(QVector<QV4::Profiling::FunctionCallProperties>)
Q_DECLARE_METATYPE(QVector<QV4::Profiling::MemoryAllocationProperties>)
+#endif // QT_NO_QML_DEBUGGER
+
#endif // QV4PROFILING_H