| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Calling Qt.binding() on a bound function object is a valid use
case and used to work until Qt 5.8.
The problem was that we optimized the code in QQmlBinding and
QQmlJavascriptExpression to directly work on a QV4::Function,
so this wouldn't work anymore.
To fix this make sure recursive calls to Function.bind() are
unrolled (so that the BoundFunction's target is never a bound
function itself), then add the bound function as an optional
member to the QQmlBinding and use it's bound arguments if
present.
Task-number: QTBUG-61927
Change-Id: I472214ddd82fc2a1212efd9b769861fc43d2ddaf
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a QQmlEngine warning handler that's called during component
instantiation results in subsequent component instantiations, either via
the signal or via a Qt message handler like in the bug report, then we
might end up modifying the linked list of errored bindings before
returning from the QQmlEnginePrivate::warning() call. The easy fix is to
extract the QQmlError, unlink the delayed error from the linked list and
then deliver the error to the QQmlEngine.
Change-Id: I6b7be61b57b35636282595937046ff76091144a3
Task-number: QTBUG-53293
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Record errors that happen during QV4::Script::parse() time in the same
way as we record errors during binding evaluation, in order to correctly
set the error state of QQmlExpression. This also removes dead code about
setting line, description, etc. which is taken care of by
ExecutionEngine::catchExceptionAsQmlError.
Task-number: QTBUG-67240
Change-Id: I2d586e16803d0883cdd2d1d262b4c67202c00562
Reviewed-by: Michael Brasser <michael.brasser@live.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
From now on we prefer nullptr instead of 0 to clarify cases where
we are assigning or testing a pointer rather than a numeric zero.
Also, replaced cases where 0 was passed as Qt::KeyboardModifiers
with Qt::NoModifier (clang-tidy replaced them with nullptr, which
waas wrong, so it was just as well to make the tests more readable
rather than to revert those lines).
Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
| |
As QJSEngine's handle() method is internal, we can redefine it to return
a pointer to an ExecutionEngine. That makes many things easier.
Change-Id: Ie3df99e0bad5f00ad4fe73182896cd135fa82994
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
| |
Change-Id: I0e2ac30b7e6d77fe41deb84a97b0a7f220437c6a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
| |
Change-Id: Ic53532edae9a209aa7125af6f00a9d993d74f1a3
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
|
|
|
|
| |
Change-Id: I1c35fbf8f7355bc2393ae931f99e591b800f2f45
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
|
|
|
|
|
|
|
| |
As, this is going to change in a simple stack based structure
to keep pointers to the data to pass to calls.
Change-Id: Ia9aa3f81ee3eeba36affd16aac7b2fe97d59aea9
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
|
|
|
|
| |
Change-Id: Ibc8dc71ffa3b4efb9bc8d6705fb8ac9ee1b4e4d6
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
|
|
|
|
|
|
|
|
| |
The only plaec we can possibly have those dependencies is when
we execute JS code from QQmlJavascriptExpression, so let's also more
the dependency registration there.
Change-Id: I12e7c69f7d126027e4fd9e73355173a45be01c65
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
|
|
|
|
|
|
|
|
| |
Renamed ScopedCallData to JSCall, enforced passing a JS
FunctionObject to it, and added call() and callAsConstructor()
methods to it.
Change-Id: I30db65c9765c2896b5909fe2105c0934c6dad861
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
| |
Change-Id: I9ae42aa7a811aa93fe0950725e9d253a0c5e8dba
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
| |
Store the current context in the context member instead of
passing it along as arguments.
Change-Id: If3dd0d32eddb2a02bcbf65fe6e8d15142403170e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|\
| |
| |
| | |
Change-Id: Iff06429f948ac6cdec77a9e5bb8c5375c56fe705
|
| |\
| | |
| | |
| | | |
Change-Id: I7d092cce33cb009d63e7b0df7c71183089dea53f
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
These item objects are direct subclasses of QObject, and cannot
override connectNotify/disconnectNotify. This prevents the creation of
the backing QMetaObject during disconnect, which happens during
destruction, which in turn will call back into the model that is being
destroyed.
Task-number: QTBUG-59704
Change-Id: I7f997e5d2fda242b38e67b9147224d72aa4508ba
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Respond to the language change event by refreshing all binding
expressions. For constant string translation bindings we must now create
special QQmlBinding instances instead of a one-time property write
meta-call upon instantiation. Those however are more lightweight than an
entire JavaScript expression.
In addition this provides a slot to explicitly trigger a re-evaluation
of bindings, to make it a little easier to discover for the developer.
[ChangeLog][QtQml][QQmlEngine] Added retranslate() slot and
QEvent::LanguageChange support to refresh bindings when changing the
language at run-time.
Task-number: QTBUG-15602
Change-Id: Ide174648e1d8a5738acb88e15495018d0869d7bc
Reviewed-by: Michael Brasser <michael.brasser@live.com>
|
| |/
| |
| |
| |
| | |
Change-Id: Ibb24b0a55dd94e03fea3104e8af5ddb266004300
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| | |
Ensure any error is deleted when the expression is
Change-Id: Ibbfd28f50279d4c66830b40c5c917eb8d98f266e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
This will allow removing a few more special cases and to simplify
the code further.
Change-Id: I3a958e9f68e3c103ea4f2ee6825f893e5931b11d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
After the recent changes this can easily be unified with
the call method without loss of performance.
Change-Id: I0385b47b6a86e890f97dcbada3a1be1129ae0b84
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fix the push/pop context instructions to not modify the JS
stack anymore, as that can cause conflicts with the VME
(and was an ugly hack in any case). Instead, these instructions
not return the old context, that is then stored in a temporary.
Get rid of Engine::current and Engine::currentContext. The
StackFrame structures do now contain the only and authoritive
data. This finally gives us a nice setup where we create and
destroy frames on the stack when entering/leaving functions.
Change-Id: If161e3e941f59865c47ecfe1e094faf62b52bfa0
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
This cuts out quite a bit of overhead when entering
and leaving functions.
Change-Id: I32670c98a4087ea3b2d45853d9cabff9066399e8
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: I1fe2ff987e79cf590ad5ad3fc520b17925f8b616
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| | |
An engine pointer is sufficient.
Change-Id: I6430cfeac3bd2881e89bbbd22ff31ffbd2a2339a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Allow for faster calling of builtins, and completely avoid
scope creation in many cases.
Change-Id: I0f1681e19e9908db10def85a74e134a87fc2e44c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|/
|
|
|
|
|
|
| |
Change those back again to return a value. This will be required
to avoid creation of Scope objects between JS function calls.
Change-Id: I05cb5cf8fd0c13dcefa60d213ccd5983fab57ea3
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
|
|
|
|
|
|
|
| |
It was only used in one place now, and the code is actually cleaner
when calling setupFunction() instead.
Change-Id: Idfe2842b81e765569f2c70f3d5dcd1862442a2ee
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
| |
Like this we can remove the QQmlBinding::create() overload
that takes a FunctionObject.
Change-Id: Ib6c37395ded325e68cf0fbf3afd08fb6dd6efa3b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
| |
There's no need to store a pointer to the original function here, we
can simplify the code when storing the pointer to the QV4::Function
directly.
Change-Id: I377aaecf56a0118606713c26cc7da4da001766b1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
| |
It's not needed anymore as we now store this in the binding
directly.
Change-Id: I518c83207f219b690f31200e4d17251075bbd322
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
| |
Change-Id: I611ab4fe5dd59cb8e07b0fa69ce22c7df5a6c3f2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
| |
This also removes the last use of the QmlBindingWrapper, so
remove that class as well.
Change-Id: I2ec795b6ab695a689fb24d64c9b8809b651c2b37
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
| |
Change-Id: Ia62d380945250015009d9c2b6ed65f6d830277ef
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
| |
Instead store the QmlContext, the QV4::Function and a source location.
Change-Id: Iafa54c09b9be7e78bace3498673ca94a2a145c97
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
| |
Change-Id: I070f73f106440667fce2c7fe33310369a6aa1376
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
| |
Rather directly execute the call on the QV4::Function.
Change-Id: I1de52075760be6b3a0358af83270ebd4e1d1e8ae
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
| |
Move the function() accessor from QQmlBoundSIgnal to
QQmlJavaScriptExpression. Change the profiler to
operate on QV4::Function objects for binding profiling.
Change-Id: Ic7ce83c487ceb69cad4b16e3dab42026238b7e82
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
| |
And remove it from the derived QQmlBoundSignalExpression
class.
Change-Id: I93cdc67136ddd916474acd2169faf380e296a900
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
| |
The class should get merged with the QV4::QmlContext class.
Simplify the cleanup by moving both classes into a common
file.
Change-Id: I0074da79701d5f41eb51681b70fcde85bfd45fc1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
| |
Esp. when disabling notifications and marking notifiers as "done".
Change-Id: I2d1c3bf048b32f68680744250e4250c3c4d76660
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|\
| |
| |
| | |
Change-Id: If0f273d3d33cec20edda539de6372337c2e4e969
|
| |\
| | |
| | |
| | | |
Change-Id: I326616356ee26d4532c6d57558c43c919f0a900d
|
| | |\
| | | |
| | | |
| | | | |
Change-Id: I7bd70996e3372d154c6b0e47336baa22146667b0
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Because it can lead to a use-after-free.
Change-Id: I6701b370c0ecee4967e5f749f673a6f9ee3d504c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Commit 9ab8b9e4 (QML: Do not register static QML dependencies on every call.,
2016-04-05) introduced a new concept of separating guards into permanent and
active containers. When a property is 'captured' it is added to one or other
container. However, while one of the captureProperty overloads added the
guards to the correct container, the other overload adds to the wrong
container. Presumably this means that a binding can be invoked C+2^N times if
the condition for invoking it changes N times.
Task-number: QTBUG-55280
Change-Id: I51a31b3dd95825304ba208252289cc5abc744d21
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The goal is to make the compiled data structures persistent on disk. In order
to make it possible to create these data structures on a "host" system that may
have a different endianness than the target system, we now make all the word
sized fields little-endian. The template wrappers from QJson provide
zero-overhead access for little-endian machines (the vast majority) while
maintaining a large degree of source compatibility.
Change-Id: I3d30da1fcf3bffb98dbe9337d3a35482fb7b57c8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
QML objects can be re-parented on the fly, resulting in different
dependencies for expressions like 'parent.width'. So, because of this,
dependencies are cleared and re-calculated after every binding
evaluation.
However, dependencies on properties of the scope and context objects
cannot change, because these objects do not get changed for the
life-time of a binding. So we can permanently register them. This is
only done for bindings, not for functions, because those might be
conditionally executed.
According to valgrind, this is a reduction of ~186 instructions on x86
for every evaluation of:
Item {
height: width
}
Change-Id: Ib095497323d4f08caf712d480007e2627a176369
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The implementation of many (or all) runtime functions consist of first
creating a QV4::Scope, which saves and restores the JS stack pointer.
It also prevents tail-calls because of that restoring behavior. In many
cases it suffices to do that at the entry-point of the runtime.
The return value of a JS function call is now also stored in the scope.
Previously, all return values were stored in a ScopedValue, got loaded
on return, and immediately stored in another ScopedValue in the caller.
This resulted in a lot of stores, where now there is only one store
needed, and no extra ScopedValue for every function.
Change-Id: I13d80fc0ce72c5702ef1536d41d12f710c5914fa
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|