aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2016-07-28 10:21:06 +0200
committerUlf Hermann <ulf.hermann@qt.io>2016-07-28 15:09:43 +0000
commit91deafdcc8e4b743e2d27a1793a2b1b2ba506cd7 (patch)
treefb1409be1deec84adb6dee9ac66e4b616e9530b6 /src/qml
parenta7c7b26653c76e6c699a7f4e81f7ffec60dde0be (diff)
Remove some unused members on -no-qml-debug
It's debatable if the uglification is worth the overhead of a few pointers. Change-Id: I63b55b2043b8752a94d4b862c3892915135a72b7 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml')
-rw-r--r--src/qml/compiler/qv4jsir_p.h8
-rw-r--r--src/qml/debugger/qqmlprofiler_p.h8
-rw-r--r--src/qml/jsruntime/qv4engine.cpp6
-rw-r--r--src/qml/jsruntime/qv4engine_p.h10
-rw-r--r--src/qml/qml/qqmlengine.cpp7
-rw-r--r--src/qml/qml/qqmlengine_p.h5
-rw-r--r--src/qml/qml/qqmlobjectcreator.cpp2
7 files changed, 40 insertions, 6 deletions
diff --git a/src/qml/compiler/qv4jsir_p.h b/src/qml/compiler/qv4jsir_p.h
index de84accbb1..51b8797862 100644
--- a/src/qml/compiler/qv4jsir_p.h
+++ b/src/qml/compiler/qv4jsir_p.h
@@ -934,7 +934,11 @@ struct Q_QML_PRIVATE_EXPORT Module {
QString fileName;
qint64 sourceTimeStamp;
bool isQmlModule; // implies rootFunction is always 0
+#ifdef QT_NO_QML_DEBUGGER
+ static const bool debugMode = false;
+#else
bool debugMode;
+#endif
Function *newFunction(const QString &name, Function *outer);
@@ -942,8 +946,12 @@ struct Q_QML_PRIVATE_EXPORT Module {
: rootFunction(0)
, sourceTimeStamp(0)
, isQmlModule(false)
+#ifndef QT_NO_QML_DEBUGGER
, debugMode(debugMode)
{}
+#else
+ { Q_UNUSED(debugMode); }
+#endif
~Module();
void setFileName(const QString &name);
diff --git a/src/qml/debugger/qqmlprofiler_p.h b/src/qml/debugger/qqmlprofiler_p.h
index 483252df6d..6643695d11 100644
--- a/src/qml/debugger/qqmlprofiler_p.h
+++ b/src/qml/debugger/qqmlprofiler_p.h
@@ -73,23 +73,23 @@ struct QQmlProfiler {};
struct QQmlBindingProfiler
{
- QQmlBindingProfiler(QQmlProfiler *, QQmlBinding *, QV4::FunctionObject *) {}
+ QQmlBindingProfiler(quintptr, QQmlBinding *, QV4::FunctionObject *) {}
};
struct QQmlHandlingSignalProfiler
{
- QQmlHandlingSignalProfiler(QQmlProfiler *, QQmlBoundSignalExpression *) {}
+ QQmlHandlingSignalProfiler(quintptr, QQmlBoundSignalExpression *) {}
};
struct QQmlCompilingProfiler
{
- QQmlCompilingProfiler(QQmlProfiler *, QQmlDataBlob *) {}
+ QQmlCompilingProfiler(quintptr, QQmlDataBlob *) {}
};
struct QQmlVmeProfiler {
QQmlVmeProfiler() {}
- void init(QQmlProfiler *, int) {}
+ void init(quintptr, int) {}
const QV4::CompiledData::Object *pop() { return nullptr; }
void push(const QV4::CompiledData::Object *) {}
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp
index 785094b96a..f5bae4b258 100644
--- a/src/qml/jsruntime/qv4engine.cpp
+++ b/src/qml/jsruntime/qv4engine.cpp
@@ -143,8 +143,10 @@ ExecutionEngine::ExecutionEngine(EvalISelFactory *factory)
, m_engineId(engineSerial.fetchAndAddOrdered(1))
, regExpCache(0)
, m_multiplyWrappedQObjects(0)
+#ifndef QT_NO_QML_DEBUGGER
, m_debugger(0)
, m_profiler(0)
+#endif
{
if (maxCallDepth == -1) {
bool ok = false;
@@ -442,10 +444,12 @@ ExecutionEngine::ExecutionEngine(EvalISelFactory *factory)
ExecutionEngine::~ExecutionEngine()
{
+#ifndef QT_NO_QML_DEBUGGER
delete m_debugger;
m_debugger = 0;
delete m_profiler;
m_profiler = 0;
+#endif
delete m_multiplyWrappedQObjects;
m_multiplyWrappedQObjects = 0;
delete identifierTable;
@@ -467,6 +471,7 @@ ExecutionEngine::~ExecutionEngine()
delete [] argumentsAccessors;
}
+#ifndef QT_NO_QML_DEBUGGER
void ExecutionEngine::setDebugger(Debugging::Debugger *debugger)
{
Q_ASSERT(!m_debugger);
@@ -478,6 +483,7 @@ void ExecutionEngine::setProfiler(Profiling::Profiler *profiler)
Q_ASSERT(!m_profiler);
m_profiler = profiler;
}
+#endif // QT_NO_QML_DEBUGGER
void ExecutionEngine::initRootContext()
{
diff --git a/src/qml/jsruntime/qv4engine_p.h b/src/qml/jsruntime/qv4engine_p.h
index 7c8c881255..f42f727295 100644
--- a/src/qml/jsruntime/qv4engine_p.h
+++ b/src/qml/jsruntime/qv4engine_p.h
@@ -379,11 +379,19 @@ public:
ExecutionEngine(EvalISelFactory *iselFactory = 0);
~ExecutionEngine();
+#ifdef QT_NO_QML_DEBUGGER
+ QV4::Debugging::Debugger *debugger() const { return nullptr; }
+ QV4::Profiling::Profiler *profiler() const { return nullptr; }
+
+ void setDebugger(Debugging::Debugger *) {}
+ void setProfiler(Profiling::Profiler *) {}
+#else
QV4::Debugging::Debugger *debugger() const { return m_debugger; }
QV4::Profiling::Profiler *profiler() const { return m_profiler; }
void setDebugger(Debugging::Debugger *debugger);
void setProfiler(Profiling::Profiler *profiler);
+#endif // QT_NO_QML_DEBUGGER
ExecutionContext *pushGlobalContext();
void pushContext(Heap::ExecutionContext *context);
@@ -485,8 +493,10 @@ public:
private:
void failStackLimitCheck(Scope &scope);
+#ifndef QT_NO_QML_DEBUGGER
QV4::Debugging::Debugger *m_debugger;
QV4::Profiling::Profiler *m_profiler;
+#endif
};
// This is a trick to tell the code generators that functions taking a NoThrowContext won't
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index 6e77bc551c..e4e7530af7 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -602,7 +602,10 @@ the same object as is returned from the Qt.include() call.
QQmlEnginePrivate::QQmlEnginePrivate(QQmlEngine *e)
: propertyCapture(0), rootContext(0),
- profiler(0), outputWarningsToMsgLog(true),
+#ifndef QT_NO_QML_DEBUGGER
+ profiler(0),
+#endif
+ outputWarningsToMsgLog(true),
cleanup(0), erroredBindings(0), inProgressCreations(0),
workerScriptEngine(0),
activeObjectCreator(0),
@@ -645,7 +648,9 @@ QQmlEnginePrivate::~QQmlEnginePrivate()
QMetaType::unregisterType(iter.value()->metaTypeId);
QMetaType::unregisterType(iter.value()->listMetaTypeId);
}
+#ifndef QT_NO_QML_DEBUGGER
delete profiler;
+#endif
}
void QQmlPrivate::qdeclarativeelement_destructor(QObject *o)
diff --git a/src/qml/qml/qqmlengine_p.h b/src/qml/qml/qqmlengine_p.h
index 4269392743..949060f395 100644
--- a/src/qml/qml/qqmlengine_p.h
+++ b/src/qml/qml/qqmlengine_p.h
@@ -134,7 +134,12 @@ public:
QRecyclePool<QQmlJavaScriptExpressionGuard> jsExpressionGuardPool;
QQmlContext *rootContext;
+
+#ifdef QT_NO_QML_DEBUGGER
+ static const quintptr profiler = 0;
+#else
QQmlProfiler *profiler;
+#endif
bool outputWarningsToMsgLog;
diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp
index 4e98e04ce4..a38d18acfb 100644
--- a/src/qml/qml/qqmlobjectcreator.cpp
+++ b/src/qml/qml/qqmlobjectcreator.cpp
@@ -89,7 +89,7 @@ QQmlObjectCreator::QQmlObjectCreator(QQmlContextData *parentContext, QV4::Compil
sharedState->creationContext = creationContext;
sharedState->rootContext = 0;
- if (QQmlProfiler *profiler = QQmlEnginePrivate::get(engine)->profiler) {
+ if (auto profiler = QQmlEnginePrivate::get(engine)->profiler) {
Q_QML_PROFILE_IF_ENABLED(QQmlProfilerDefinitions::ProfileCreating, profiler,
sharedState->profiler.init(profiler, compilationUnit->totalParserStatusCount));
} else {