aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlvme.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/qml/qqmlvme.cpp')
-rw-r--r--src/qml/qml/qqmlvme.cpp34
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();
}
{