Profiler: Preserve line information also for optimized bindings
authorKai Koehne <kai.koehne@nokia.com>
Fri, 11 Nov 2011 16:18:21 +0000 (17:18 +0100)
committerQt by Nokia <qt-info@nokia.com>
Tue, 22 Nov 2011 12:45:40 +0000 (13:45 +0100)
Change-Id: Ibd5abb42364711fab454e6b9c13af53462730471
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
src/declarative/qml/qdeclarativevme.cpp
src/declarative/qml/v4/qv4bindings.cpp
src/declarative/qml/v4/qv4bindings_p.h

index 24d2ef4..19df527 100644 (file)
@@ -958,7 +958,7 @@ QObject *QDeclarativeVME::run(QList<QDeclarativeError> *errors,
                 QML_NEXT_INSTR(StoreV4Binding);
 
             QDeclarativeAbstractBinding *binding = 
-                CTXT->v4bindings->configBinding(instr.value, target, scope, property);
+                CTXT->v4bindings->configBinding(instr.value, target, scope, property, instr.line);
             bindValues.push(binding);
             binding->m_mePtr = &bindValues.top();
             binding->addToObject(target, property);
index 0822321..b398ac5 100644 (file)
@@ -212,7 +212,7 @@ QV4Bindings::~QV4Bindings()
 }
 
 QDeclarativeAbstractBinding *QV4Bindings::configBinding(int index, QObject *target, 
-                                                                   QObject *scope, int property)
+                                                                   QObject *scope, int property, int line)
 {
     Binding *rv = bindings + index;
 
@@ -220,6 +220,7 @@ QDeclarativeAbstractBinding *QV4Bindings::configBinding(int index, QObject *targ
     rv->property = property;
     rv->target = target;
     rv->scope = scope;
+    rv->line = line;
     rv->parent = this;
 
     addref(); // This is decremented in Binding::destroy()
@@ -239,6 +240,9 @@ void QV4Bindings::Binding::setEnabled(bool e, QDeclarativePropertyPrivate::Write
 void QV4Bindings::Binding::update(QDeclarativePropertyPrivate::WriteFlags flags)
 {
     QDeclarativeDebugTrace::startRange(QDeclarativeDebugTrace::Binding);
+    if (parent->context())
+        QDeclarativeDebugTrace::rangeLocation(QDeclarativeDebugTrace::Binding,
+                                              parent->context()->url, line);
     parent->run(this, flags);
     QDeclarativeDebugTrace::endRange(QDeclarativeDebugTrace::Binding);
 }
index 6bb15e4..b961cc5 100644 (file)
@@ -72,7 +72,7 @@ public:
     virtual ~QV4Bindings();
 
     QDeclarativeAbstractBinding *configBinding(int index, QObject *target, 
-                                               QObject *scope, int property);
+                                               QObject *scope, int property, int line);
 
 #ifdef QML_THREADED_INTERPRETER
     static void **getDecodeInstrTable();
@@ -95,6 +95,7 @@ private:
         bool updating:1;
         int property;
         QObject *scope;
+        int line;
         QObject *target;
         quint32 executedBlocks;