Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-10962

Avoid dynamic lookup of signal handler arguments

XMLWordPrintable

      For a signal declaration like so:
      signal clicked(color cellColor)

      and signal handler like so:
      onClicked:

      { helloText.color = cellColor; }

      QML will generate a function expression

      function() { helloText.color = cellColor; }

      and the resolution of the arguments (cellColor, in this case) is done dynamically in the QML scope.
      Instead, QML could generate the expression

      function(cellColor)

      { helloText.color = cellColor; }

      and pass the arguments directly to QScriptValue::call().
      This should make arguments access a lot faster since it allows JSC to use "static" opcodes (i.e. avoids virtual calls to scope chain).

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            brasser Michael Brasser (closed Nokia identity) (Inactive)
            kenthans Kent Hansen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes