| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Reviewed-by: MArtin Jones
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit introduces a new internal JS object type,
QScriptStaticScopeObject, that enables the JS compiler to make
more aggressive optimizations of scoped property access.
QScriptStaticScopeObject registers all its properties in a
symbol table that the JS compiler has access to. If the compiler
finds the property in the symbol table, it will generate the
fast index-based op_{get,put}_scoped_var bytecodes, rather than
the dynamic (slow) op_resolve and friends.
If the compiler _doesn't_ find the property in the symbol table,
it infers that it's safe to skip the scope object when later
resolving the property, which will also improve performance
(see op_resolve_skip bytecode).
QScriptStaticScopeObject is only safe to use when all relevant
properties are known at JS compile time; that is, when a
function that has the static scope object in its scope chain is
compiled.
It's up to the user of the class (e.g. QtDeclarative) to ensure
that this constraint is not violated.
The API for constructing QScriptStaticScopeObject instances is
not public; it lives in QScriptDeclarativeClass for now, an
internal class exported for the purpose of QML. The instance is
returned as a QScriptValue and can be manipulated like any
other JS object (e.g. by QScriptValue::setProperty()).
The other part of this commit utilizes QScriptStaticScopeObject
in QtDeclarative in the two major places where it's currently
possible:
1) QML disallows adding properties to the Global Object.
Furthermore, it's not possible for QML IDs and properties to
"shadow" global variables. Hence, a QScriptStaticScopeObject
can be used to hold all the standard ECMA properties, and this
scope object can come _before_ the QML component in the scope
chain. This enables binding expressions and scripts to have
optimized (direct) access to e.g. Math.sin.
2) Imported scripts can have their properties (resulting from
variable declarations ("var" statements) and function
declarations) added to a static scope object. This enables
functions in the script to have optimized (direct) access to
the script's own properties, as well as to global properties
such as Math.
With this change, it's no longer possible to delete properties
of the Global Object, nor delete properties of an imported
script. It's a compromise we make in order to make the
optimization safe.
Task-number: QTBUG-8576
Reviewed-by: Aaron Kennedy
Reviewed-by: Olivier Goffart
Reviewed-by: Jedrzej Nowacki
|
|
|
|
| |
Also rearrange the parameter order to be more clear.
|
|
|
|
|
|
|
| |
If a binding generates > 1 transient error, only the first was being
suppressed.
QTBUG-10274
|
| |
|
|
|
|
|
| |
QDeclarativeExpression can be used to evaluate any sort of expression,
not just those returning a value.
|
|
|
|
| |
QTBUG-9726
|
|
|
|
| |
QTBUG-9799
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
QML used to silently ignore a log of errors - such as a failed assignment
to a QObject property. These errors are now all reported as exceptions
in JavaScript.
Other questionable activities, like assigning a JavaScript array to a
"property var" property which appeared to work, thanks to QtScript's
transparent conversion of arrays to a QVariantList, are now blocked
entirely.
QTBUG-9152 QTBUG-9382 QTBUG-9341 QTBUG-6886
|
|
|
|
|
| |
Always use private/. The WinSCW compiler doesn't search the current
directory, for whatever reason.
|
| |
|
|
|
|
|
|
| |
If the notifier gets swapped out during emitting, the endpoint is also
invalidated. Thus the "disconnected" writeback must track the endpoint
not just the Notifier.
|
| |
|
| |
|
| |
|
|\
| |
| |
| |
| | |
Conflicts:
src/declarative/util/qdeclarativestateoperations.cpp
|
| | |
|
|/ |
|
|
|
|
|
|
|
| |
This prevents the secondary scope from contaminating scopes outside itself
when used as a signal expression.
QTBUG-8641
|
|
|
|
| |
QT-2787
|
|
QDeclarativeXXX.
|