Lars Knoll [Mon, 27 Jan 2014 13:58:52 +0000 (14:58 +0100)]
Make the Ref classes not template based
Move to a class hierarchy that mirrors the main classes. This will
allow moving functionality over into the Ref classes, as the current
Managed classes become mainly something that holds the data. This
is required to make objects movable by the GC.
Change-Id: I4ca88ab0e5d8c88c8dc56d51937990500a33e0d9
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Mon, 27 Jan 2014 09:12:43 +0000 (10:12 +0100)]
Rename Referenced to ManagedRef
First step of removing the templates here and turning this
into a class hierarchy. This is required, so we can move all
member methods into the Ref classes and make objects movable
during GC.
Change-Id: Ie14af07fd3e72a7d84a528d0042189ff12ba21bb
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Sun, 26 Jan 2014 16:46:51 +0000 (17:46 +0100)]
Move Referenced together with Managed
The two classes belong logically together (as the Managed base
type and a generic pointer to a Managed object).
Change-Id: I65691669a7169a4514cadf7ab3e744c090851c6b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Frederik Gladhorn [Thu, 6 Feb 2014 15:52:29 +0000 (16:52 +0100)]
Accessibility: respect password state
Better don't leak passwords via accessibility
Change-Id: Ibdb0f63101dbd71f51de6f1b8ddaceb359f01e30
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
Friedemann Kleint [Thu, 6 Feb 2014 11:16:45 +0000 (12:16 +0100)]
Add a test HTTP server as manual test.
Task-number: QTBUG-36573
Change-Id: Ib930f7c44db4170dfcff30e221c1cc7d94a13de5
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Eskil Abrahamsen Blomfeldt [Thu, 6 Feb 2014 07:37:58 +0000 (08:37 +0100)]
Android: Fix crash when using images in QML
Because qtdeclarative was merged back from stable and qtbase is
still lagging behind, they have become unsynchronized, causing
crashes when trying to get the device name from the platform
plugin and failing. To work around this until the merge goes
through, I've added a simple guard.
Task-number: QTBUG-36658
Change-Id: Ibc399ed325a1fbdeccad85ed8d4841edb7b2ba5d
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Simon Hausmann [Thu, 6 Feb 2014 11:47:43 +0000 (12:47 +0100)]
Fix memory management issue with accessors
The earlier pattern of
Property p;
p.setSetter(new (mm) setterFunction);
p.setGetter(new (mm) getterFunction);
carries the risk of the second allocation garbage collecting the first one.
Consequently we need to put these values onto the JS stack, using a simple
ScopedProperty wrapper.
Change-Id: Ib29ea3b1eab95595dd6dfbb86fea282d23e3d899
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Wed, 5 Feb 2014 11:29:44 +0000 (12:29 +0100)]
[new compiler] Fix crash in qml delegate model
qmlContext(this) is expected in re-implementations of classBegin(), so just
like the VME we have to be careful that we call it after setting the context
on the ddata.
Change-Id: I38ad8d1a4e4093368f62f9d57718de3b8cd0cfd2
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Tue, 4 Feb 2014 14:46:48 +0000 (15:46 +0100)]
[new compiler] Fix propagation of imported scripts for anonymous components
We must take the imported scripts from the creation context. Fixes various
errors in Qt Quick Controls.
Change-Id: I336d8ffa0537cefd4eeac15f98bbf1b0a5c784af
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Ulf Hermann [Wed, 5 Feb 2014 16:00:51 +0000 (17:00 +0100)]
Prevent concurrent access to v4 debugger
Without this new engines can be added to the QV4DebugService while
breakpoints are set from the debugger thread. In rare cases this leads
to a situation where the DebuggerAgent::addDebugger() doesn't see the
new breakpoint and DebuggerAgent::addBreakPoint() doesn't see the new
debugger. Thus the breakpoint will never be set.
This effect is easily reproducible by repeatedly (about 100 times)
running the setBreakpointInScriptOnTimerCallback autotest.
Change-Id: I5da27478bf579ab24f81aebabbdd321f38fae3f4
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Ulf Hermann [Wed, 5 Feb 2014 14:38:51 +0000 (15:38 +0100)]
Unify the interface for QQmlDebugServices
Let the debug server handle adding and removing of engines through
defined interfaces to prepare for multi-engine profiling and debugging.
Change-Id: I7b277e54bdcce1d3e95e723f041a7db6b08b29fc
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Lars Knoll [Sat, 25 Jan 2014 21:22:47 +0000 (22:22 +0100)]
Move PersistenValue and WeakValue into it's own file
They deserve having their own set of files, and it helps
reduce dependencies.
Change-Id: Ifd4394f88ef51cbccc61bf92dd20636f570141d9
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Wed, 5 Feb 2014 15:12:16 +0000 (16:12 +0100)]
Smaller performance fixes
Move commonly used variables in the ExecutionEngine
to the beginning of the struct to increase cache locality.
Keep the engine pointer in a register in the interpreter to
save one memory load per instruction.
Change-Id: If2540c66b62685701511f410aff495c0a20ca694
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Mon, 27 Jan 2014 14:19:23 +0000 (15:19 +0100)]
Remove an unused constructor
Fortunately we don't use this constructor anymore. This also
allows us to fix the assert in qv4managed. Now we finally
enforce that every managed object must have an internal class
and a vtable.
Change-Id: Idf9081c20633b44b79970fec4cc4d1ec5e6a6f7c
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Ulf Hermann [Wed, 5 Feb 2014 10:26:32 +0000 (11:26 +0100)]
Force QML engine debug output to stderr in qmlplugindump
In this case the debug output is actually meant to be read by the user.
Logging it to some system facility, as on BlackBerry doesn't help. To
fix that a message handler that redirects all debug output to stderr
is installed.
Task-number: QTBUG-36378
Change-Id: I16dbca8bc4d07e0aabc2b41ce93b56bd679fa166
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
Lars Knoll [Wed, 5 Feb 2014 13:38:03 +0000 (14:38 +0100)]
Add a special Debug instruction to the interpreter and use it
This avoid having to check for the debugger at every instruction
we execute. Instead we only add debug instructions at the beginning
of every line and every basic block when we have a debugger.
This still allows interrupting the JS execution at any time (as we
can't loop inside a basic block), and single stepping through lines.
But it has no overhead when the debugger is not running and a lot
less when it is running.
Change-Id: Ib17170b42944b608fc6caa1891082205dd2b2763
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Simon Hausmann [Wed, 5 Feb 2014 10:34:04 +0000 (11:34 +0100)]
[new compiler] Fix logic error in enum resolver
Change-Id: I614cc1428439801ed20cdee099cf8260ff930618
Reviewed-by: Liang Qi <liang.qi@digia.com>
Simon Hausmann [Tue, 4 Feb 2014 13:02:51 +0000 (14:02 +0100)]
[new compiler] Fix partial bindings on value types
You can have a binding like this:
property point blah: Qt.point(someX, someY);
and later you can have bindings on
blah.x: { someExpression }
In that case we need to clear the binding on blah.
Change-Id: I27bfa6ab0f104bf989803c5910e6094767429c03
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Tue, 4 Feb 2014 09:21:33 +0000 (10:21 +0100)]
[new compiler] Fix order of alias vs non-alias bindings
qqmlecmascript's alias binding tests expect bindings on non-aliases to be bound
before bindings on aliases, as the latter may override parts of the former.
Change-Id: I23d25c2b7a449f0ed4672ef6865c4a7ef0ed0129
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Mon, 3 Feb 2014 16:07:54 +0000 (17:07 +0100)]
[new compiler] Fix bindings on aliases
When installing bindings on aliases, make sure to follow the alias.
Change-Id: I860a5bf6b5aba838727385f26e50e3d1bf0c8ea8
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Mon, 3 Feb 2014 08:41:20 +0000 (09:41 +0100)]
[new compiler] Set the rootObjectInCreation flag correctly on the root object
Change-Id: Iaf96dabb1b3de81aae75953fd261dfc3b562169c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Mon, 3 Feb 2014 15:30:26 +0000 (16:30 +0100)]
[new compiler] Fix JS ownership of QML created objects
It's allowed to call destroy() on them, so allow for destruction
unless the constructor set ownership upfront.
Change-Id: I3887c5ab1bb6de7de3b0c7b14f4791d4ed1e0979
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Mon, 3 Feb 2014 09:29:04 +0000 (10:29 +0100)]
[new compiler] Fix binding initialization order
Since commit
3d958cec8d53094a1bbab895377e451b07716e1f (loong time ago!)
property bindings are stored in a linked list and newly encounted bindings
at parse time are prepended to the list, causing the binding processing to
happen in reverse order.
There are however exception to the rule. For example list bindings are processed
in declaration order and assignments to the default property are sorted by
location in the file.
In addition various tests rely on value properties being installed first, then
followed by signal handlers and group/attached properties.
Change-Id: I3bcae29faec5b2420fbba362cd81b8ba960ed19f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Mon, 3 Feb 2014 12:30:06 +0000 (13:30 +0100)]
[new compiler] Cleanup empty string handling
Ensure that the empty string always has index 0, that simplifies the code in a
few places and makes it easier to check for the empty string in other places
where there's no access to the string pool itself.
Change-Id: Icd204aec478e8350ef3fee75d89bda1f88cffe26
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Tue, 4 Feb 2014 10:37:36 +0000 (11:37 +0100)]
Fix canvas tests after commit
439f31f128e70ecae16544ee7041695c60e0b2d6
We must make sure that the canvas is created somewhere in the item hierarchy of
a scene-graph initialized (thus visible) window. A Window { visible: true }
type of item is not sufficient, but we can simply use our testcase as
parent/associated item, because that one is equipped with a when: windowShown
condition.
Change-Id: I67a65208fae1a6fd953493eaa2898a324a6cc917
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Simon Hausmann [Tue, 4 Feb 2014 10:35:02 +0000 (11:35 +0100)]
Fix occasional crashes in canvas getImageData and other places
In some places we allocate custom array objects and in the constructor we call
setArrayType, which will allocate the array's data through the GC. In all of
these cases we need to make sure that the array object itself is protected from
garbage collection, because while in the constructor it may not be yet in the
scope the callee has usually set up.
Change-Id: I96b7af4ae00fd809067e12bacd6563984c5e9240
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Ulf Hermann [Tue, 4 Feb 2014 09:20:30 +0000 (10:20 +0100)]
Set breakpoints before connect() in JS debugging unit test
connect() starts the JS engine. Any break point set after that may be
missed because the engine has already passed its location when the
breakpoint request arrives. The problem can easily be visualized by
inserting an artificial delay (e.g. sleep(1)) between connect() and
setBreakpoint().
I'm also removing a piece of dead code that gets that wrong and has
never actually worked.
Change-Id: Ie4410ac3eaf89f02993c653b17148c14048652ab
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Gunnar Sletta [Wed, 4 Dec 2013 14:44:57 +0000 (15:44 +0100)]
Support batching of rotated antialiased elements.
Change-Id: I67d961f23941ba5cfa16fd679b609cd0fc3071c7
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Thiago Macieira [Sun, 2 Feb 2014 22:01:26 +0000 (14:01 -0800)]
Normalize signal & slot signatures in connection
Profiling shows Qt Creator spends 2% of its load time normalizing
Change-Id: I58132e11ab5fc942b04925c3bcc919165784a5d1
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Simon Hausmann [Wed, 29 Jan 2014 09:39:00 +0000 (10:39 +0100)]
Add missing export macro to QQuickTransform
Task-number: QTBUG-34736
Change-Id: Ic0ab7317c76417e6556bc0b26cad50416ba06e54
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Simon Hausmann [Sun, 2 Feb 2014 21:06:11 +0000 (22:06 +0100)]
Fix nasty bug in property cache leading to inaccessible signal parameters
The property cache among other things caches the parameter types and names
of signals (instead of retrieving them from the meta-object each time). When
this cache is created through createArgumentsObject(), the parameter names have
to be provided, but the signature didn't enforce that because of the parameter
names having a default value of an empty list. All call sites however provided
the correct list, except for one in QQmlPropertyCache::methodParameterTypes.
Consequently tst_qqmlecmascript::threadSignal() would fail occasionally because
the first time this cache was "created" was when the "done" signal was emitted,
which caused QQmlBoundSignalExpression::evaluate to call methodParameterTypes. If
the signal data had not been cached so far, a new cache with an empty parameter
name list was created.
Later (in the second half of the test) a new signal handler was compiled and
the property cache reported that the signal took no parameters.
Change-Id: I19230d0fb1ddd54992f3d6251f82c489626662e7
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Sun, 2 Feb 2014 19:38:13 +0000 (20:38 +0100)]
[new compiler] Propagate JS code gen errors
Change-Id: I3b99f3fc762df7ac820b26597bf809a80849b5ce
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Sun, 2 Feb 2014 19:36:39 +0000 (20:36 +0100)]
[new compiler] Fix error reporting for invalid regexp property assignments
After recordError makes sure to return false to indicate the error condition
to the caller.
Change-Id: I7edcda9ea4c6898f1607824085b150dbe295aeb2
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Sun, 2 Feb 2014 19:15:47 +0000 (20:15 +0100)]
[new compiler] Fix context sharing for imported JS files that have no import themselves
They should share the imports from the importing context, which means
context->importedScripts needs to be initialized before calling
scriptValueForContext, because it accesses it.
Change-Id: Ifed22555028e03d597954ba1a18e546bfb901c58
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Sun, 2 Feb 2014 10:37:15 +0000 (11:37 +0100)]
[new compiler] Fix sanity checking of parameter names when connecting to C++ signals
Change-Id: Ie2dc8689786a61fe5f38a0f91ff86f011e965b2d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Sat, 1 Feb 2014 14:01:06 +0000 (15:01 +0100)]
[new compiler] Fix revisioning
Always install the property cache on the ddata, not only for types with
a VME meta object, as the cache has the correct revision cache.
Change-Id: I82352df867c1045b37152013eb924aafde2ee874
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Sat, 1 Feb 2014 13:39:44 +0000 (14:39 +0100)]
[new compiler] Allow function calls during initial binding evaluations and signal handlers
Functions need to be setup first, like in the VME.
Change-Id: I4d1cffa04cb2b3ba7027c3720d55133253a1bad7
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Sat, 1 Feb 2014 07:51:19 +0000 (08:51 +0100)]
[new compiler] Fix error message about final property overrides
Change-Id: Icb8c2dfc633a6c322d4448ce18e3c01e0311b0f4
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Fri, 31 Jan 2014 15:01:10 +0000 (16:01 +0100)]
[new compiler] Fix error messages when trying to create invalid property interceptors
Change-Id: I3dd608bfceb04323f92503596b87bbcb4bf582fc
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Fri, 31 Jan 2014 14:42:20 +0000 (15:42 +0100)]
[new compiler] Fix error message when assigning lists to singular properties
Also adjust the error message for the other compiler when trying to assign
lists to script strings.
Change-Id: I50f833c340f3634a59c5b36f30aeafc53003e65e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Fri, 31 Jan 2014 14:23:30 +0000 (15:23 +0100)]
[new compiler] Don't allow setting the id property multiple times
Change-Id: Ic7f1938dd048db6c6975d78ad4f69d3c646cece5
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Fri, 31 Jan 2014 14:09:46 +0000 (15:09 +0100)]
[new compiler] Fix error messages for binding vs. property declarations
Separate binding errors from property declaration errors - they were
accidentally mixed up.
Change-Id: Id2d5134dc98ee3e1d7ce0c3d356f165e144e0d82
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Fri, 31 Jan 2014 13:00:53 +0000 (14:00 +0100)]
[new compiler] Cleanups
When creating the initial object tree from the AST, encapsulate the
declarations and bindings in the QmlObject class, in order to centralize the
redirection via declarationsOverride as well as the error handling. This also
replaces the hashes to detect duplicate properties/signals from being QString
based to simply use the existing string indices from the compilation unit.
Change-Id: Ia6ceae56977a98b5c5a7a738bf983a731e608d46
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Fri, 31 Jan 2014 11:33:26 +0000 (12:33 +0100)]
[new compiler] Fix invalid id error messaging for empty IDs
When an ID is specified as string literal, which is empty, don't try to
take the literal quotes as ID. Instead it's empty and so an error needs
to be thrown.
Change-Id: I9b42295a33dceb3cc9e57456908c65bbc12eb296
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Fri, 31 Jan 2014 11:18:51 +0000 (12:18 +0100)]
[new compiler] Try to resolve qualified enums at type compile time
... by taking some code from the old compiler. This speeds up some bindings
and maintains compatibility.
Change-Id: If80b1e28214cb655f70fff01a8c885edcb2d3030
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Fri, 31 Jan 2014 08:42:27 +0000 (09:42 +0100)]
[new compiler] Fix location reported on function declaration errors
Change-Id: I7549930a1152c257b3da6951afefef5d8b783f32
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Fri, 31 Jan 2014 08:37:10 +0000 (09:37 +0100)]
[new compiler] Fix datetime property conversion to match 5.1/5.2 behavior
Change-Id: I22c3e3f8e9a06928a23700b657a656a0db37d48d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Fri, 31 Jan 2014 08:26:16 +0000 (09:26 +0100)]
[new compiler] Fix signal handlers that are fuzzily matched
Use the same logic at object creation time as during the signal handler
conversion phase.
Change-Id: Idb48a3849da7b6543ec50c15e1ccbf2939c3ee39
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Thu, 30 Jan 2014 16:07:23 +0000 (17:07 +0100)]
[new compiler] Fix location when reporting signal declaration errors
Change-Id: Iaddb51cb7b0e28048761b98d6e48c70723cd5d00
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Thu, 30 Jan 2014 15:41:22 +0000 (16:41 +0100)]
[new compiler] Fix signal handler parameters for overloaded signals
When extracting the parameters for a signal, make sure to pick the
original variant that has all the parameters.
Change-Id: Ie28cb75ce32d8840812884ce2eef2934d473466c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Thu, 30 Jan 2014 12:31:14 +0000 (13:31 +0100)]
[new compiler] Add support for signal handler objects
Change-Id: I644dcea86fa886a6a2dc7cd230ad6942d165c4c5
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Tue, 28 Jan 2014 09:41:58 +0000 (10:41 +0100)]
[new compiler] Fix property declarations inside group properties
Property declarations inside group properties as well as their initializers go
into into the surrounding object.
Change-Id: I5b2b0f7bc41daea1275eb17ed04560e17052ca42
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Wed, 29 Jan 2014 07:55:02 +0000 (08:55 +0100)]
[new compiler] Fix location of errors in group property objects
Change-Id: I63aa43ec7d9e90c1593c54dfc44890330c8669ae
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Tue, 28 Jan 2014 15:24:15 +0000 (16:24 +0100)]
[new compiler] Fix recursive property validation across component boundaries
Change-Id: Ia2a6e9de534fcc4e3780544ad0d5708e656e11a1
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Gabriel de Dietrich [Sun, 2 Feb 2014 11:34:00 +0000 (12:34 +0100)]
alloca() is declared in stdlib.h on BSD systems
... except on Darwin.
Bonus change: Updated auto-tests trying to include 'alloca.h'.
This is a follow up on
24c43a5748b8502.
Change-Id: I299de00bf0dca7842470b158282daea221a10f2d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Fri, 31 Jan 2014 13:58:14 +0000 (14:58 +0100)]
Use lookups for get/setElement in the interpreter
Significantly speeds up crypto.js
Change-Id: Icd3d59bea3fe4427e93e9e10e3526178e8de859c
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Fri, 31 Jan 2014 13:29:02 +0000 (14:29 +0100)]
Remove unused macro
Change-Id: Ie7044aecad59197fd2cab17d5ddcc7c44ad2ad84
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Sat, 25 Jan 2014 21:13:44 +0000 (22:13 +0100)]
Move ValueRef into qv4value_p.h
The ref class belongs logically together with the value.
Change-Id: I40c0908715cbc8b2a5c51d2544cb06fcd8e25365
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Sat, 25 Jan 2014 20:59:15 +0000 (21:59 +0100)]
Disentangle some includes
ScopedValue should require less dependencies. Hopefully we can then
move it together with the main class definition at some point (ie.
move ScopedValue int qv4value_p.h; similar for the other types).
Change-Id: Ie7b31715cb718a90dba40845c7ae785a29855062
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Sat, 25 Jan 2014 20:41:31 +0000 (21:41 +0100)]
Move Encode into qv4value_p.h
This is where the class logically belongs.
Change-Id: I366013aad2c9b6324ae82ab5f3250f1d9c719da4
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Fri, 24 Jan 2014 21:55:39 +0000 (22:55 +0100)]
Cleanups
Remove SafeValue, it was used to port over to an exact GC. Since
we now have that, we can now safely merge it with QV4::Value
again. Also rename SafeString to StringValue for better naming
consistency.
Change-Id: I8553d1bec5134c53996f6b0d758738a0ec8a2e4d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Fri, 24 Jan 2014 21:13:06 +0000 (22:13 +0100)]
Get rid of the SafeObject class
Having SafeValue is enough, and we can pass an ObjectRef instead
of a SafeObject * for function calls.
Change-Id: I4e1435105403f8091b43eeda01303f9602c74235
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Fri, 24 Jan 2014 21:11:16 +0000 (22:11 +0100)]
Move ArrayElementLessThen to qv4arraydata.cpp
This is the only place the class gets used.
Change-Id: Iebb0cba7af30c1b2da68f67596c349d5e20c5053
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Fri, 24 Jan 2014 14:07:34 +0000 (15:07 +0100)]
Rename some files
Rename qv4value_def_p.h -> qv4value_p.h and qv4value_p.h to
qv4value_inl_p.h.
It makes more sense to have the class definition in the file
that is named after the class and move the inline methods into
a _inl file. Doing this now, as I expect we'll be needing a few
more _inl files soon.
Change-Id: Ib59e9380e9e976254c6b4369574157f39b1b5f51
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Fri, 24 Jan 2014 12:16:55 +0000 (13:16 +0100)]
Implement Lookup::indexedSetter
use this instead of the generic runtime method. This gives
around 10% speedup for array heavy Javascript such
as crypto.js.
Change-Id: Ic8f478c5b18893f2ef49e3f658b1ef24ae22e64f
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Fri, 24 Jan 2014 11:46:28 +0000 (12:46 +0100)]
Fix a bug in qmljs_set_element and improve it's performance
Avoid expensive function calls for setting indexed properties
in the common case. The spec requires us to read the value before
writing it to check whether it's empty. In that case we need to
fall back to the slow implementation that checks the proto chain.
Change-Id: If278ba81f170d35c18135d2f8661459262e7e606
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Ulf Hermann [Thu, 30 Jan 2014 17:21:18 +0000 (18:21 +0100)]
Be stricter about the number of messages when testing profiler service
It's better to fail a test than to crash on invalid array access later.
Change-Id: Ia3d24218eba80f362908979720657312c8c6cd67
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Ulf Hermann [Thu, 30 Jan 2014 11:19:13 +0000 (12:19 +0100)]
Make the QML debug server thread safe
Previously, if instance() was accessed concurrently we could run into
various problems as the initialization wasn't synchronized. By putting
most of the initialization into the constructor, wrapping it into a
Q_GLOBAL_STATIC and discerning between accesses that need to wait for
the initial "hello" packet and ones that don't the situation is
improved.
Change-Id: I182e8e6abf054b851ef7ea5f897d4a197a9da4bf
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Ulf Hermann [Thu, 30 Jan 2014 12:34:21 +0000 (13:34 +0100)]
Make QML import thread safe.
Protect the common qmlEnginePluginsWithRegisteredTypes by a mutex.
Task-number: QTBUG-36542
Change-Id: Ia3c731f030b778d862239486cc6c1bfa441503e6
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Erik Verbruggen [Mon, 27 Jan 2014 14:09:12 +0000 (15:09 +0100)]
V4: remove unused field.
Change-Id: Ic62ac6be99b79aa2f8c37fc386fef6b04b480247
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Gunnar Sletta [Sat, 7 Dec 2013 08:41:44 +0000 (09:41 +0100)]
Visualization modes for rendering.
There are two ways of setting this right now. One is to set it on
startup using an environment varible.
QSG_VISUALIZE=
"batches" - Visualize batchtes in the renderer. Merged batches are
drawn with solid color and Unmerged batches are drawn with a diagonal
line pattern. Few unique colors means good batching. Unmerged batches
are bad if they contain many individual nodes.
"clip" - Visualize clipping as red areas on top of the scene.
"overdraw" - Visualize all items in 3D to highlight overdraws. This mode
can also be used to detect geometry outside the viewport to some
extent. Opaque items are rendered with a green tint while translucent
items are rendered with a red tint. The bounding box for the viewport
is rendered in blue. Opaque content is easier for the scenegraph to
process and it can also be faster to render on some hardware.
"changes" - Changes in the scenegraph are visualized with a flashing
overlay with a random color. Changes on a primitive is visualized with
a solid color while changes in an ancestor, such as a matrix or
opacity changes is visualized with a pattern.
The second way to set the visualization mode is to set it at runtime
through QString QQuickWindowPrivate::customRenderMode. This "API" is
string based so it is not tied to the batch renderer and in theory can
support other custom renderers.
The visualized elements do not respect clipping and rendering order
is arbitrary.
Change-Id: I31efbe53fc905145bf48080ede3e36945cb60dcf
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Ulf Hermann [Thu, 23 Jan 2014 09:39:51 +0000 (10:39 +0100)]
Change QQmlProfilerService::instance to be a getter
Change-Id: Id2eb973443cc73aac3a06f94c98b52334d9766a3
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Ulf Hermann [Wed, 29 Jan 2014 16:30:14 +0000 (17:30 +0100)]
Allow debug plugin registrations from other threads than main GUI
There's no real reason to disallow that. The only thing we want to check
there is that the registration doesn't take place in the debugger
thread. Disallowing registrations from anywhere but the main GUI thread
creates unnecessary problems with threaded QML profiling and debugging.
Change-Id: Ic72d19237e2ddba02cc88f7f5a0743f6640fed4d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Ulf Hermann [Wed, 29 Jan 2014 15:33:39 +0000 (16:33 +0100)]
Properly wait for stdout in test
Assuming all output is available on the first readyReadStandardOutput()
signal leads to flaky test results.
Change-Id: I442d7edc905abc067d6c32a4a55afd42ed03e3c9
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Eskil Abrahamsen Blomfeldt [Wed, 29 Jan 2014 09:01:03 +0000 (10:01 +0100)]
Add test for shaping and rendering Sinhala text
This is currently broken on Mac OS X, but the fix is nigh.
Task-number: QTBUG-36056
Change-Id: I547f7961a2ca8c62301e15de486a6f75de26bc4a
Reviewed-by: aavit <eirik.aavitsland@digia.com>
Simon Hausmann [Mon, 27 Jan 2014 15:55:49 +0000 (16:55 +0100)]
[new compiler] Avoid uncreatable type errors for types that aren't created
QtQuick.Keys for example is not creatable, but it's also never created but
only used as attached properties. Therefore types used as attached properties
create the needCreation = false flag in the referenced types.
Change-Id: I6ca3a3ff677858bf3c55d3e08a0f0fc8ee9160fe
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Mon, 27 Jan 2014 15:00:54 +0000 (16:00 +0100)]
[new compiler] Fix timing of property assignment error handling
Most property assignment errors are now handled at type compile time, just
like in the old compiler. This speeds up the object creation code and
restores behavior expected in the qqmllanguage tests.
Change-Id: If213cd0bfa4dd51d9065c27809a79a6495c9f3ce
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
J-P Nurmi [Wed, 22 Jan 2014 13:38:43 +0000 (15:38 +0200)]
Expose TextEdit::linkAt(x, y)
[ChangeLog][QtQuick] Added TextEdit::linkAt(x,y) method.
Task-number: QTBUG-18946
Change-Id: Id9d061e6c9d857c2f0283ad5042097828d1ed02d
Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
J-P Nurmi [Wed, 22 Jan 2014 12:21:46 +0000 (14:21 +0200)]
Expose Text::linkAt(x, y)
[ChangeLog][QtQuick] Added Text::linkAt(x,y) method.
Task-number: QTBUG-18946
Change-Id: I3b4071c6117ac0ee636f2fdbd2c392eb05b02dd7
Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Friedemann Kleint [Tue, 21 Jan 2014 08:15:49 +0000 (09:15 +0100)]
Skip animations tests for MinGW.
These tests typically fail in the CI.
Task-number: QTBUG-36290
Change-Id: I36a19c2914932d4f70c1df24e1c5ad4a3d0e2795
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Lars Knoll [Mon, 27 Jan 2014 13:43:30 +0000 (14:43 +0100)]
Update TestExpectations
These tests started failing after the upgrade to Unicode 6.3
in qtbase. The reason is that a character in the mongolian range that
is being used in some tests changed character class from whitespace
to being a control character.
Change-Id: I4683d6db239fa0c3d213057dc363650420c1104d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Simon Hausmann [Mon, 27 Jan 2014 12:09:01 +0000 (13:09 +0100)]
[new compiler] Report errors when trying to bind to read-only properties
The only exception are initializers for read-only property declarations.
Also adjusted the error location of one test to point to the correct value
location as opposed to the property location, as with all the other similar
errors.
Change-Id: I2333d3c485fc374b1b39a5f5a4408af5cf08a20f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Fri, 24 Jan 2014 15:49:03 +0000 (16:49 +0100)]
[new compiler] Improved error handling
* When reporting errors with literal bindings, use the correct location for the report,
the place where the literal value is declared.
* Create property caches for group properties, so that later in the property
validator we can do extra checks
* Report an error when trying to declare an object to the default property of a group
property
* Similarlyl report an error when trying to use sub-objects with value type properties
* Temporarily change tst_qqmllanguage::errors() to also try to instantiate the component,
because for the moment some errors are only reported at instantiating time instead of
compile time. That'll be fixed later when move checks get moved into the property validator.
Change-Id: Icaa8d2edc7918c03001c40fba7880ee5cac10e69
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Fri, 24 Jan 2014 12:13:58 +0000 (13:13 +0100)]
Improved error handling for namespaced property bindings
A binding with a qualified name that starts with a name space, must be followed
by a type. For example
MyNamespace.someThing.foo: 100
is not valid, something must be a valid type name and therefore start with an
upper case letter. Similarly an object declaration like this:
MyNamespace.something {
...
}
is not valid neither. The current compiler reported the latter as "Expected type"
and the former as "Invalid attached property name". The message for the latter
is not very good, because we know that "MyNamespace" is a namespace and therefore
"something" cannot be a attached property name, it must be the attached property
type first.
In the new compiler this hits the same code path and thus the same error message.
So this patch introduces the correct error message in the new compiler, adjusts
it for attached properties in the old one and adjusts the test that now passes
with both.
Change-Id: I51c265a2acb80079c1dd62ef5ef77d5ff07d3ac1
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Tor Arne Vestbø [Mon, 27 Jan 2014 14:15:12 +0000 (15:15 +0100)]
Move logic for determining native vs. DF text into single factory function
Makes QSGContext::createGlyphNode() the central point of determining which
glyph node to produce, instead of letting the caller call two different
versions of the factory, each one calling the other in various cases and
behind various ifdefs.
Change-Id: I30fb17cceab45d9e13ddf3ece7a65f220c5e5acd
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Tor Arne Vestbø [Mon, 27 Jan 2014 13:34:10 +0000 (14:34 +0100)]
Allow renderType: Text.NativeRendering on retina displays/devices
Setting the renderType to Text.NativeRendering might be needed in some
cases where distance-field does not produce the expected results, such
as for emoji characters or really large fonts. These use cases are
valid on retina displays as well, so having the setter second-guess
the request from the user to use native rendering is not ideal.
Change-Id: I7c6049766e60574487c29de07fbd5c100ec69a2a
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Ulf Hermann [Mon, 27 Jan 2014 15:05:49 +0000 (16:05 +0100)]
Make sure a profiling range is started for every handled signal
If we allow an endRange() without a startRange() before the range
nesting can get confused. Also, it's enough to check the existence
of the profiler once.
Change-Id: I255675d6e23505b6f29196c0470892f6d778e7b4
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Frederik Gladhorn [Fri, 10 Jan 2014 15:36:05 +0000 (16:36 +0100)]
Accessibility: add states to QQuickAccessibleAttached
This makes it possible to set the state of accessible objects in qml.
Change-Id: Ide70b885dac8fed180d2b221540cf2b699ac78ff
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
Simon Hausmann [Fri, 24 Jan 2014 11:01:33 +0000 (12:01 +0100)]
[new compiler] Fix support for namespaces in attached properties
When doing
import QtQml 2.0 as MyQml
with
MyQml.Component.onComplete: ...
We now store "MyQml.Component" as one string as the type name, in order to get
resolved correctly.
Change-Id: I11a6def88bcb8b98b5fa9548053e27fb58170e62
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Fri, 24 Jan 2014 17:27:50 +0000 (18:27 +0100)]
Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev
Simon Hausmann [Fri, 24 Jan 2014 15:37:45 +0000 (16:37 +0100)]
Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
src/imports/dialogs/qquickmessagedialog.cpp
src/imports/dialogs/qquickmessagedialog_p.h
src/qml/debugger/qqmlprofilerservice_p.h
src/qml/jsruntime/qv4regexpobject.cpp
tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro
Change-Id: Ic8a43366b44d6970966acbf03b206d0dee00c28d
Friedemann Kleint [Fri, 24 Jan 2014 14:16:10 +0000 (15:16 +0100)]
Fix MSVC-warnings about double to float truncation in QML-tests.
Change-Id: Ie58585ca3555f0f7808b59221a00763cc702863a
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Friedemann Kleint [Fri, 24 Jan 2014 13:56:57 +0000 (14:56 +0100)]
Fix MSVC-warning about unused variable in tst_qqmlapplicationengine.cpp
Change-Id: I808e56db47d3967f4361cb8b96644834fafb533a
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Simon Hausmann [Fri, 24 Jan 2014 13:29:40 +0000 (14:29 +0100)]
Allocate the ArrayData object and it's data together
Reduce the amount of allocations required for Arrays, and
allows freeing the array data more easily in the GC.
Change-Id: I3e3213f089c45c83a227038ce444aa60b2735b7f
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Wed, 22 Jan 2014 14:25:50 +0000 (15:25 +0100)]
Change virtual methods in ArrayData to take Object pointer
Pass a pointer to the underlying object instead of the ArrayData
to virtual methods that modify the arrayData. This prepares
for allocating the ArrayData together with the array itself.
Change-Id: I66fe187f8b1e4d382ab243a518dbde5f18a1d16d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Jorgen Lind [Thu, 23 Jan 2014 11:22:43 +0000 (12:22 +0100)]
Dont define CAN_BACKTRACE_EXECINFO when building on uClibc
Change-Id: I06314f0a3a7cf86e5e627c307a522069cf640f78
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Simon Hausmann [Wed, 22 Jan 2014 15:40:46 +0000 (16:40 +0100)]
[new compiler] Fix error message when trying to create uncreatable types
Pass along the no-creation-reason properly, for regular qml types as well as
singleton types. Also don't collect custom signal parameter names as types to
resolve, as we never try to instantiate them anyway. Their type resolution to
meta-type id is done lazily when building the meta-objects.
Change-Id: I49bd51d9b851cf75cbd51afbcee168944f4350cd
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Sun, 19 Jan 2014 13:40:25 +0000 (14:40 +0100)]
[new compiler] Fix crash in loading qtquick controls
Don't create meta-objects for attached properties or group properties by
default.
Change-Id: Ie6263ae45e0186cf0489b45aafe4b951d336550a
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Andrew Knight [Tue, 5 Nov 2013 22:23:44 +0000 (00:23 +0200)]
Fix build on WinRT
Disable JIT and avoid unsupported functions under WinRT.
Also add MSVC's ARM flag to the double conversion white list.
Cherry-picking commit
eeabbf554880f61979fa0a9ecf87ba380cd70863 on top of rebased double-conversion code
Change-Id: Iec899efc9de412bc61172ef6e2a15cd7da12fd03
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Erik Verbruggen [Fri, 1 Nov 2013 11:38:32 +0000 (12:38 +0100)]
Fix various compiler warnings in order to remove warn_off in the near future
Cherry-picking commit
a79e400 on top of rebased double-conversion code
Change-Id: I818fec877ee22d31e7aec6463fb5fbf986433339
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>