diff options
Diffstat (limited to 'src/qml/qml/qqmlvme.cpp')
-rw-r--r-- | src/qml/qml/qqmlvme.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlvme.cpp b/src/qml/qml/qqmlvme.cpp index 983136a846..ad1e9d862e 100644 --- a/src/qml/qml/qqmlvme.cpp +++ b/src/qml/qml/qqmlvme.cpp @@ -503,6 +503,12 @@ QObject *QQmlVME::run(QList<QQmlError> *errors, const QQmlCompiledData::TypeReference &type = TYPES.at(instr.type); Q_ASSERT(type.component); + if (profiler.enabled) { + profiler.start(); + profiler.updateTypeName(type.component->name); + profiler.background(); + } + states.push(State()); State *cState = &states[states.count() - 2]; @@ -524,6 +530,11 @@ QObject *QQmlVME::run(QList<QQmlError> *errors, QML_END_INSTR(CreateQMLObject) QML_BEGIN_INSTR(CompleteQMLObject) + if (profiler.enabled) { + profiler.foreground(); + profiler.updateLocation(CTXT->url, instr.line, instr.column); + } + QObject *o = objects.top(); Q_ASSERT(o); @@ -566,6 +577,8 @@ 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()); QObject *o = 0; void *memory = 0; @@ -637,12 +650,14 @@ QObject *QQmlVME::run(QList<QQmlError> *errors, QML_END_INSTR(CreateCppObject) 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()); QObject *o = (QObject *)operator new(instr.typeSize + sizeof(QQmlData)); ::memset(static_cast<void *>(o), 0, instr.typeSize + sizeof(QQmlData)); instr.create(o); QQmlData *ddata = (QQmlData *)(((const char *)o) + instr.typeSize); - const QQmlCompiledData::TypeReference &ref = TYPES.at(instr.type); if (!ddata->propertyCache && ref.typePropertyCache) { ddata->propertyCache = ref.typePropertyCache; ddata->propertyCache->addref(); @@ -817,6 +832,8 @@ QObject *QQmlVME::run(QList<QQmlError> *errors, QML_END_INSTR(StoreScriptString) QML_BEGIN_INSTR(BeginObject) + if (profiler.enabled) + profiler.push(); QObject *target = objects.top(); QQmlParserStatus *status = reinterpret_cast<QQmlParserStatus *>(reinterpret_cast<char *>(target) + instr.castValue); parserStatus.push(status); @@ -1074,6 +1091,8 @@ normalExit: objects.deallocate(); lists.deallocate(); states.clear(); + if (profiler.enabled) + profiler.stop(); return rv; } @@ -1111,6 +1130,8 @@ void QQmlVME::reset() states.clear(); rootContext = 0; creationContext = 0; + if (profiler.enabled) + profiler.clear(); } #ifdef QML_THREADED_VME_INTERPRETER @@ -1170,6 +1191,8 @@ 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(); QQmlParserStatus *status = parserStatus.pop(); #ifdef QML_ENABLE_TRACE QQmlData *data = parserStatusData.pop(); @@ -1189,6 +1212,8 @@ QQmlContextData *QQmlVME::complete(const Interrupt &interrupt) return 0; } parserStatus.deallocate(); + if (profiler.enabled) + profiler.clear(); } { |