aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlvme.cpp
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-01-10 18:41:43 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-01-10 18:41:43 +0100
commitcc0eb9c2aa9032c6a7bf2ab05d1eb913a09fa4f1 (patch)
tree7314014389e227bd7c9b28d97eebcd072e4852a2 /src/qml/qml/qqmlvme.cpp
parentcb2ac154273a8c07a1e4a14246ae22f6e0deaeda (diff)
parent0a74dc69b4c57a15da90be29b598371dfa63f7ee (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: src/qml/jsruntime/qv4managed_p.h Change-Id: I5da7ae9c87a539e42292f272d9e2b5faab619c9f
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();
}
{