Gunnar Sletta [Mon, 27 Jan 2014 09:08:14 +0000 (10:08 +0100)]
Add Image::mipmap to support mipmapping of images.
[ChangeLog][QtQuick] New feature: Image.mipmap
Task-number: QTBUG-19961
Change-Id: I13acb2408d5b126790adaf9d324ad4beda1e3646
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Gunnar Sletta [Wed, 12 Feb 2014 07:29:48 +0000 (08:29 +0100)]
Disable Flickable tests on Mac OS X.
Task-number: QTBUG-36804
Change-Id: Ic38e4172f4a6978ad4e9b9a460106cadaaaeff3a
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Jan Arve Saether [Mon, 10 Feb 2014 13:38:52 +0000 (14:38 +0100)]
Fixed wrong baseline alignment for TextInput
[ChangeLog][QtQuick][Fixed wrong baseline alignment for TextInput]
Task-number: QTBUG-36749
Change-Id: I6920fb0681f30d9e9943d1bd01f76cc3ae204f30
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Ulf Hermann [Thu, 6 Feb 2014 15:01:32 +0000 (16:01 +0100)]
Add a debug service for controlling qml engines
Like this we can control the starting and stopping of qml engines from
the client without having to extend each of the other debug services.
Change-Id: I5f1c077b6cfa0e628c32e8bcdea2ec053e310509
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Ulf Hermann [Thu, 6 Feb 2014 13:43:26 +0000 (14:43 +0100)]
Unify initial waiting of debug services
The debug services generally behave in one of two ways when initializing:
Either they block the initializing thread until some configuration is
passed over the network or they just go on. By introducing a generalized
configurable debug service the various ways of waiting on initialization
are cleaned up. The API defined for it also allows for engine-specific
initialization.
Change-Id: Id5685ef17d2a7eb1222629f7caa5ec53076d47b2
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Simon Hausmann [Fri, 7 Feb 2014 16:46:39 +0000 (17:46 +0100)]
Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev
Simon Hausmann [Fri, 7 Feb 2014 15:41:04 +0000 (16:41 +0100)]
Skip mysteriously failing test for now
Task-number: QTBUG-363717
Change-Id: I0085cd7d5bb2b964c8701e061f897926b30cfac0
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Thu, 6 Feb 2014 20:15:54 +0000 (21:15 +0100)]
[new compiler] Fix component attachment linking across sub object creators
This brings up the list view in the components gallery.
Change-Id: Ib91ca3b30b8093acad0343b47be60cf4b51e4da7
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Thu, 6 Feb 2014 15:47:29 +0000 (16:47 +0100)]
[new compiler] Fix tst_qqmlincubator::deleteContext
Protect against QQmlContext deletion during incubation re-using the existing
QQmlContextGuard.
Change-Id: Ia1c0241029765cc2e00a9b0ffcf484127de20606
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Thu, 6 Feb 2014 15:33:15 +0000 (16:33 +0100)]
[new compiler] Allow for interruption during object finalization
The object tree construction and binding allocation remains synchronous, but
the initial evaluation of the bindings is now cooperatively interruptible
again, like in the VME.
Change-Id: Idd037dd481782c81ad43e20e93d922eb12ac8b85
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Thu, 6 Feb 2014 08:35:28 +0000 (09:35 +0100)]
[new compiler] Fix parser status and created bindings allocation
Pre-calculate the amount of space we need for binding and parser status
callbacks at compile time and therefore use a much simpler data structure
(vector) to store the points to the bindings and callbacks. They need to be
stored because during object construction and binding enabling phase, it may
happen that they get destroyed and thus their m_mePtr pointing into the array
gets deleted.
The contiguous vector will also make it possible to interrupt the completion
phase.
Change-Id: Ic7c985bb8325ab355112e30e9d33d6ae4e7476d1
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Thu, 6 Feb 2014 15:23:34 +0000 (16:23 +0100)]
[new compiler] Fix memory management of newly created objects
It may happen that QML created objects get garbage collected, as they'll
be initially JS owned. We don't want that to happen, so we have to
protect them, similar to the qmlBindingWrappers array in the VME.
Change-Id: Iec541dccced46ac8aab447cd0558d22b84e3eac0
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Ulf Hermann [Thu, 6 Feb 2014 12:01:05 +0000 (13:01 +0100)]
Protect list of client plugins from concurrent access
Previously the list of client plugins in the QQmlDebugServer could be
accessed concurrently from receiveMessage() and addService() either
when in non-blocking mode, or if the client uses service discovery or
sends additional hello messages after the first one.
Change-Id: I946243957184210d40ebca728143714c341b1226
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Erik Verbruggen [Tue, 28 Jan 2014 12:25:55 +0000 (13:25 +0100)]
V4: stack slot allocator for the interpreter.
Use the life-time intervals to track which temps go out of scope, in
order to re-use the stack-slots they occupied. This reduces the memory
consumption on the JavaScript stack and allows for deeper call stacks.
For the ECMA tests, this reduces the number of slots needed for the
main/entry function from more than 650 to about 10 (depending on the
test).
Change-Id: Iff4044f5ff7f25e1f88ff1a04f4e80dd99a67590
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Erik Verbruggen [Tue, 28 Jan 2014 12:01:12 +0000 (13:01 +0100)]
V4: fix life range for phi node target that is never used.
When a temp is defined by a phi-node, but never used, still insert the
(very short) life range.
Change-Id: Ia976f496736a1606108fab7597c5d90048d9d55a
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Lars Knoll [Thu, 6 Feb 2014 14:13:33 +0000 (15:13 +0100)]
Remove add/sub/mul instruction specializations for numbers
These instructions did hurt more than help, as they converted
ints to doubles. Since the regular add/sub/mul runtime methods
have fast paths for both ints and doubles, we're better off
using those instead.
Change-Id: I0b7a6f95818943bfc8a0669c1c56f7db4e7246e0
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Thu, 6 Feb 2014 14:05:35 +0000 (15:05 +0100)]
Specialize CJump into JumpEq and JumpNe
This avoids the bool invert in the instruction
stream, and some additional code in the VME.
Change-Id: I0ea675a2e3d07c1b8c5234b888d8d9683bcee330
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Thu, 6 Feb 2014 13:57:52 +0000 (14:57 +0100)]
Avoid some unary plus instructions
Change-Id: Ie01ef2be8beb890b1ca56bbdc990ccea87c1d91e
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Thu, 6 Feb 2014 13:57:09 +0000 (14:57 +0100)]
Remove a memset that is not required
Keep it in debug builds to ease debugging.
Change-Id: I334872d3c0ef30b5f09fb5febfc2129a3b450bca
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Thu, 6 Feb 2014 13:56:32 +0000 (14:56 +0100)]
Add specialized instructions for right and left shift
These give a measurable speedup as the critical code
paths are now inline.
Change-Id: I3cee8a432fbe96d66ba1e6bd277a38e624a50c14
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Thu, 6 Feb 2014 13:53:52 +0000 (14:53 +0100)]
Simplify some runtime methods
This gives as performant but simpler code, as the first line
in toInt() checks if the value is integercompatible.
Change-Id: I15d0ade231719116ca1c6c03a86106b7f5aaa9aa
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Thu, 6 Feb 2014 12:22:36 +0000 (13:22 +0100)]
Remove two unused parameters from VME::run()
These parameters are not used outside the function itself
anymore, so we can safely remove them.
Change-Id: I1694481c05a9927fc78a59ffb7fec43a88e85ac8
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Thu, 6 Feb 2014 12:19:27 +0000 (13:19 +0100)]
Add a MoveConst instruction to the interpreter
This simplifies and speeds up loading of constants
Change-Id: I05b4f7a34abd4ed6416fa800a31debbb28b37104
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
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>