diff options
author | Ulf Hermann <ulf.hermann@digia.com> | 2014-01-02 16:49:32 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-09 17:16:03 +0100 |
commit | 7701b58ad06f9e99d291e0e3468096dc3ab4dd00 (patch) | |
tree | 4179a1d22c59e783c50201732c65e1af1fe52203 /src/qml/qml | |
parent | e20324ea5cdc63145a25be3027c21d1bdfed03b6 (diff) |
Remove redundant copies of enabled flag in QML profiler
Task-number: QTBUG-35315
Change-Id: Idd35a330531722cb3d4e0d3e95cb3be6e5697688
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Diffstat (limited to 'src/qml/qml')
-rw-r--r-- | src/qml/qml/qqmlvme.cpp | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/src/qml/qml/qqmlvme.cpp b/src/qml/qml/qqmlvme.cpp index ad1e9d862e..1881b554ed 100644 --- a/src/qml/qml/qqmlvme.cpp +++ b/src/qml/qml/qqmlvme.cpp @@ -503,8 +503,7 @@ QObject *QQmlVME::run(QList<QQmlError> *errors, const QQmlCompiledData::TypeReference &type = TYPES.at(instr.type); Q_ASSERT(type.component); - if (profiler.enabled) { - profiler.start(); + if (profiler.start()) { profiler.updateTypeName(type.component->name); profiler.background(); } @@ -530,10 +529,8 @@ QObject *QQmlVME::run(QList<QQmlError> *errors, QML_END_INSTR(CreateQMLObject) QML_BEGIN_INSTR(CompleteQMLObject) - if (profiler.enabled) { - profiler.foreground(); + if (profiler.foreground()) profiler.updateLocation(CTXT->url, instr.line, instr.column); - } QObject *o = objects.top(); Q_ASSERT(o); @@ -577,8 +574,10 @@ QObject *QQmlVME::run(QList<QQmlError> *errors, QML_BEGIN_INSTR(CreateCppObject) const QQmlCompiledData::TypeReference &type = TYPES.at(instr.type); Q_ASSERT(type.type); - if (profiler.enabled) - profiler.start(CTXT->url, instr.line, instr.column, type.type->qmlTypeName()); + if (profiler.start()) { + profiler.updateLocation(CTXT->url, instr.line, instr.column); + profiler.updateTypeName(type.type->qmlTypeName()); + } QObject *o = 0; void *memory = 0; @@ -651,8 +650,10 @@ QObject *QQmlVME::run(QList<QQmlError> *errors, QML_BEGIN_INSTR(CreateSimpleObject) const QQmlCompiledData::TypeReference &ref = TYPES.at(instr.type); - if (profiler.enabled) - profiler.start(CTXT->url, instr.line, instr.column, ref.type->qmlTypeName()); + if (profiler.start()) { + profiler.updateLocation(CTXT->url, instr.line, instr.column); + profiler.updateTypeName(ref.type->qmlTypeName()); + } QObject *o = (QObject *)operator new(instr.typeSize + sizeof(QQmlData)); ::memset(static_cast<void *>(o), 0, instr.typeSize + sizeof(QQmlData)); instr.create(o); @@ -832,8 +833,7 @@ QObject *QQmlVME::run(QList<QQmlError> *errors, QML_END_INSTR(StoreScriptString) QML_BEGIN_INSTR(BeginObject) - if (profiler.enabled) - profiler.push(); + profiler.push(); QObject *target = objects.top(); QQmlParserStatus *status = reinterpret_cast<QQmlParserStatus *>(reinterpret_cast<char *>(target) + instr.castValue); parserStatus.push(status); @@ -1091,8 +1091,7 @@ normalExit: objects.deallocate(); lists.deallocate(); states.clear(); - if (profiler.enabled) - profiler.stop(); + profiler.stop(); return rv; } @@ -1130,8 +1129,7 @@ void QQmlVME::reset() states.clear(); rootContext = 0; creationContext = 0; - if (profiler.enabled) - profiler.clear(); + profiler.clear(); } #ifdef QML_THREADED_VME_INTERPRETER @@ -1191,8 +1189,7 @@ QQmlContextData *QQmlVME::complete(const Interrupt &interrupt) if (componentCompleteEnabled()) { // the qml designer does the component complete later QQmlTrace trace("VME Component Complete"); while (!parserStatus.isEmpty()) { - if (profiler.enabled) - profiler.pop(); + profiler.pop(); QQmlParserStatus *status = parserStatus.pop(); #ifdef QML_ENABLE_TRACE QQmlData *data = parserStatusData.pop(); @@ -1212,8 +1209,7 @@ QQmlContextData *QQmlVME::complete(const Interrupt &interrupt) return 0; } parserStatus.deallocate(); - if (profiler.enabled) - profiler.clear(); + profiler.clear(); } { |