Lars Knoll [Tue, 15 Oct 2013 20:27:10 +0000 (22:27 +0200)]
Some minor optimizations
Change-Id: Ib2e08e7c89ca59a48f8fd52b30981e5d7e60803b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Bernd Weimer [Tue, 15 Oct 2013 14:28:02 +0000 (16:28 +0200)]
Increased precision in shader example
On BB10 the shader effect displayed as a black rectangle.
Change-Id: I9cd12e66875c07cc7ecfa2aec6d7e5912926511e
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Shawn Rutledge [Wed, 16 Oct 2013 13:39:06 +0000 (15:39 +0200)]
QtQuick.Dialogs: deploy qml files only for debug builds
QML_FILES are installed with the qml plugin they belong to. This is
helpful for debugging, but redundant because the same QML is also
packaged as resources (after
8780af05b1bc63aa71c3a318972465ffdb830070).
Task-number: QTBUG-31565
Change-Id: I0b277b62b48e0a742f3ef2ff6ee2a81cc071295e
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
Simon Hausmann [Thu, 17 Oct 2013 11:18:30 +0000 (13:18 +0200)]
Fix ARM thumb2 mode detection
__TARGET_ARCH_THUMB may not always be defined, but __thumb2__ for example
is also a good indicator that we can generated and run thumb2 code and
thus enable the JIT.
Change-Id: I987d0af5883d9bb844c4c99a0691a12aedc94ff5
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Thu, 17 Oct 2013 13:51:26 +0000 (15:51 +0200)]
Fix iOS builds
Other tools in tools could theoretically be using QML modules, so qt.prf
tries to use the qmlimportscanner on them. That means we have to build it
before all the other tools.
Change-Id: I5ee49d0f3f4f3bf73183a6be9414c8d0e926bdf1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Fabian Bumberger [Thu, 10 Oct 2013 19:45:19 +0000 (21:45 +0200)]
Fix crash in FolderListModel
Change-Id: I8d012e9a356676dd3dad246579c7339eaddc1e91
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Kai Koehne [Thu, 17 Oct 2013 07:24:09 +0000 (09:24 +0200)]
Fix flaky QQmlProfilerService::scenegraphData test
QSGRenderThread::syncAndRender first triggers the frameSwapped() signal,
and only then adds the SceneGraphRenderLoopFrame message. We're waiting
for the frameSwapped signal to stop profiling, and therefore can't be sure
whether we'll get the final SceneGraphRenderLoopFrame message or not.
Task-number: QTBUG-33024
Change-Id: I3216667e8e5cdc79f210290ce22cc6b08c579b6a
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Kai Koehne [Fri, 11 Oct 2013 14:53:10 +0000 (16:53 +0200)]
Make sure v8 service sends a finished signal
Otherwise Qt Creator will block forever ...
Change-Id: I2ffe5e826c10338aeb4ded7079154fe83710c108
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Simon Hausmann [Thu, 17 Oct 2013 08:55:47 +0000 (10:55 +0200)]
Disable WTF assertions in release builds
Define NDEBUG to disable them.
Change-Id: Ie1f08863b9b483216be2c0768b505f2e9e7ccef8
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Wed, 16 Oct 2013 15:18:29 +0000 (17:18 +0200)]
Fix build on ARM in ARM mode (instead of thumb2)
We don't support the traditional ARM assembler (yet), only JIT on thumb2. In
order for us to reliably check that, we have to wait until the pre-processor
runs, which this patch achieves by moving all JIT enable/disable decisions into
qv4global_p.h
Change-Id: I7eff5b4fbf1cd26297a08dee16984ad867358113
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Thu, 17 Oct 2013 08:45:58 +0000 (10:45 +0200)]
Implement WTFReportAssertionFailure
At least do a printf with the failure details, to make debugging easier.
Change-Id: I092d31e3408cd0a651c6dd96b5fd94adf4abe3a7
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Thu, 17 Oct 2013 08:45:13 +0000 (10:45 +0200)]
Fix ASSERT_VALID_CODE_POINTER for our ARM builds
We want to allow intermixing thumb and ARM for all builds, not only Android.
Modified the macro to do a thumb-compatible null pointer check.
This also works around a miscompilation on QNX where the compiler appeared to
make incorrect assumptions about the address of functions we are taking.
Change-Id: Ib8fc400178e0c2621bde2ca94b3f94041591e19a
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Erik Verbruggen [Thu, 10 Oct 2013 11:34:12 +0000 (13:34 +0200)]
V4 ARM: extend disassembler.
Added VADD/VSUB/VLDR/VSTR.
Change-Id: I25fbb338652c3457e15cc9ef17209d35c63fefe5
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Wed, 16 Oct 2013 12:50:57 +0000 (14:50 +0200)]
Fix performance regression when doing property lookups for non-existant properties
Commit
84627464eb11ca1149d46946b12e3c82eb54a8bf introduced a performance
regression of falling back to reading the QMetaObject, when the lookup for a
property in QML failed, after we've tried in the property cache. This is very
very expensive to do and was only due to QQmlPropertyMap not correctly
invalidating the property cache.
Instead remove the property cache from the property map's QObject and on the
lookup side rely on the property cache being correct in the result (positive or
negative).
Change-Id: I8a013483203f2007d48b71feafa10b3ea02c53fd
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Wed, 16 Oct 2013 12:03:48 +0000 (14:03 +0200)]
Speed up exception propagation
Avoid catch (...) with re-throw as it turns that this is very slow because it
throws a new exception and the unwinder starts from scratch. Instead use stack
allocated objects and cleaning destructors to restore state before continuing
with the propagation of exceptions.
Change-Id: I6d95026bcd60b58cb6258a9dae28623a46739532
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Wed, 16 Oct 2013 08:50:08 +0000 (10:50 +0200)]
Speed up stack trace generation for the JIT
It turns out that in QML it is not unusual that during early binding
evaluations due to the undefined order, the evaluation tries to look up
properties in objects that aren't initialized yet and thus exceptions are
thrown. Eeach thrown exception saves a stack trace, which is expensive to
generate when using the JIT, as it does full stack unwinding.
This patch implements a more light-weight approach by storing the instruction
pointer in the context before leaving JIT generated code.
Change-Id: I95e1cfd01179247dfc2c1df949828f474a23161b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Laszlo Agocs [Wed, 16 Oct 2013 11:02:41 +0000 (13:02 +0200)]
Avoid infinite loop with distance fields disabled
createGlyphNode() and createNativeGlyphNode() kept calling each other
on GLES whenever QML_DISABLE_DISTANCEFIELD was set.
Change-Id: Ic1c2cfe0c4c7301f82cbbcce1cb512bd515b52ef
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Shawn Rutledge [Mon, 7 Oct 2013 09:35:17 +0000 (11:35 +0200)]
Dialogs: use resources for QML and images
All the qml and image files are embedded in the QtQuick.Dialogs plugin.
If DefaultFileDialog.qml is missing from the installation directory,
loading from resources will be enabled. Otherwise, the files will be
loaded from the local path.
This is analogous to change
b2e5d1acb1aca93157a6d4d0a026153134f9ad01
in Qt Quick Controls: it reduces the number of files that need to be
installed, but also preserves ease of debugging whenever the QML files
are separately installed.
Task-number: QTBUG-31565
Change-Id: Idbe6be5d818eb6a25367f2053ea52bc7ac1485bc
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
Albert Astals Cid [Tue, 8 Oct 2013 08:51:03 +0000 (10:51 +0200)]
Fix infinite loop in QQmlIncubator::forceCompletion
Without this change I'm getting this backtrace
3 0x4025b9f2 in QQmlIncubatorPrivate::incubate (this=0x18daa78, i=...) at qml/qqmlincubator.cpp:273
4 0x4025c1c2 in QQmlIncubator::forceCompletion (this=0x1527360) at qml/qqmlincubator.cpp:592
5 0x404e1626 in QQuickVisualDataModelPrivate::object (this=this@entry=0x13909f8, group=QQuickListCompositor::Default, index=index@entry=1, asynchronous=asynchronous@entry=false) at items/qquickvisualdatamodel.cpp:900
6 0x404e1f7e in QQuickVisualDataModel::item (this=<optimized out>, index=1, asynchronous=<optimized out>) at items/qquickvisualdatamodel.cpp:968
Note: This is with patched 5.0.x, change QQuickVisualDataModel to QQmlDelegateModel for >= 5.1
and line numbers may be a bit off
What is happening:
QQmlIncubator::forceCompletion is doing
while (Loading == status()) {
while (Loading == status() && !d->waitingFor.isEmpty())
static_cast<QQmlIncubatorPrivate *>(d->waitingFor.first())->incubate(i);
if (Loading == status())
d->incubate(i);
}
Calling QQmlIncubatorPrivate::incubate on the first item of d->waitingFor
Then, that item is getting to QQmlIncubatorPrivate::incubate and happens that
progress is QQmlIncubatorPrivate::Completed and waitingFor is not empty,
so the only thing that QQmlIncubatorPrivate::incubate ends up doing is
calling a few calls over vmeGuard and returning, that way the inner
waitingFor items never finishe incubating and you end up in an inifite loop inside
while (Loading == status() && !d->waitingFor.isEmpty())
static_cast<QQmlIncubatorPrivate *>(d->waitingFor.first())->incubate(i);
This patch basically replaces this loop with a loop that does
while (QQmlIncubator::Loading == status && !waitingFor.isEmpty())
static_cast<QQmlIncubatorPrivate *>(waitingFor.first())->forceCompletion(i);
This way we make sure we incubate the waitingFor items of our waitingFor items
Change-Id: I4298efc7ba9d8af624bb138e64b92a40ed4c4dc9
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Kai Koehne [Tue, 8 Oct 2013 09:02:24 +0000 (11:02 +0200)]
Improve output of test case
Change-Id: Ib36583120ca42835534f0f8494637aeb9618f317
Reviewed-by: Aurindam Jana <aurindam.jana@digia.com>
Kai Koehne [Tue, 8 Oct 2013 08:59:28 +0000 (10:59 +0200)]
Fix segfault in autotest
Do not re-declare variable in local scope!
Change-Id: I4f66081603ce86d78965ac12368bda66d86ff0c4
Reviewed-by: Aurindam Jana <aurindam.jana@digia.com>
Kai Koehne [Mon, 7 Oct 2013 14:18:23 +0000 (16:18 +0200)]
Fix deadlocks in debugger infrastructure on Mac
Set QReadWriteLocker to recursive. This is needed e.g. to allow
_q_changeServiceState to get a read lock when called from inside
receiveMessage.
Change-Id: I287a7c7f44e94005c0458825f8f6d1877ee914dd
Reviewed-by: Aurindam Jana <aurindam.jana@digia.com>
Lars Knoll [Tue, 15 Oct 2013 14:00:49 +0000 (16:00 +0200)]
Turn on exact garbage collection by default
Keep conservative GC as a fallback for testing
Enable all tests again that were skipped due to
GC issues.
Change-Id: I8e0fa728207bdd39a96d0acf95e27841157d8402
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Simon Hausmann [Tue, 15 Oct 2013 10:42:24 +0000 (12:42 +0200)]
Fix cleanup handlers on Android when exceptions are thrown
When an exception is thrown and we traverse a frame that requires only cleanup
(i.e. call QV4::Scope::~Scope), control is first transferred to the generated
cleanup code. Afterwards the unwinding is resumed (on ARM) by calling
__cxa_end_cleanup, which resides in libsupc++ (libgnustl_shared).
__cxa_end_cleanup first calls __gnu_end_cleanup and then resumes the process of
stack unwinding by calling _Unwind_Resume (per specification). Given the
linking situation on Android, this will end up calling _Unwind_Resume inside
libgnustl_shared, which sidesteps our statically linked copy of the unwind
code in QtQml (libgcc.a). Therefore any further unwinding through JIT generated
frames will fail.
This patch introduces the same EABI symbol exported in libQt5Qml, which will
direct control to the correct JIT aware unwinder.
This relies on https://codereview.qt-project.org/#change,68206 in order to
ensure that libsupc++.a is gone from all link lines (not needed) and that
gnustl_shared is after libQt5Qml.
Task-Number: QTBUG-33892
Change-Id: I6ed691db3ceb287475a70b7af8cf3cd7b4ddfdd6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Richard Moe Gustavsen [Tue, 15 Oct 2013 08:10:20 +0000 (10:10 +0200)]
qqmlimport: avoid deadlock by scoping the usage of QWriteLocker
Change
a9cf828559b00bc70f59250b7f3cf38458774715 refactored
QQmlImportDatabase::importPlugin() to be used for both dynamic
and static plugin loading. In the process, the scope of a
QWriteLocker protecting a call to registerTypes ended up to wide.
That caused a deadlock to occur for some static qml applications
since the lock remained active during a subsequent call to
initializeEngine.
So narrow the the scope down to be exactly as it wore before the
change. This will remove the deadlock.
Change-Id: Ibb15c953c0f693fe75dab24f0093c3bddb3f0cbb
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Tue, 15 Oct 2013 13:56:10 +0000 (15:56 +0200)]
Initialize Variable
Change-Id: I60262620eab4b653108f431a4c64a745e4312177
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Tue, 15 Oct 2013 13:00:24 +0000 (15:00 +0200)]
Fix GC issues with usage of raw RegExp pointers
Properly protect them through Scoped values.
Change-Id: I5a0a1d5580d55ecff493419baa8959751a65f1d3
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Tue, 15 Oct 2013 12:59:57 +0000 (14:59 +0200)]
Remove debug output
The output messes up some auto tests
Change-Id: I9b9b2b4fdf023bc9953939b814872e860c84f484
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Tue, 15 Oct 2013 12:59:39 +0000 (14:59 +0200)]
Remove duplicated forward declaration
Change-Id: Ie3c4e7d500dc9d327aa081c8f701d88ca6d4ca40
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Tor Arne Vestbø [Tue, 15 Oct 2013 10:56:20 +0000 (12:56 +0200)]
Don't use constructor function to initialize providers
It complicated static linking for no good reason.
Change-Id: I8eb1548b799128bfab9451963cb80c72239b961c
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Jerome Pasion [Fri, 11 Oct 2013 15:40:53 +0000 (17:40 +0200)]
Doc: Renamed links to "QML Applications".
"QML Application Developer Resources" is too long and the visible text
is usually shortened to "QML Applications".
The article in qt5/qtdoc changed title to "QML Applications".
Change-Id: I301f3b4659bd87631269b912bcc36f6f00fdeb2c
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Lars Knoll [Tue, 15 Oct 2013 11:58:52 +0000 (13:58 +0200)]
Make QQmlIncubatorPrivate refcounted
This fixes possible bugs and crashes where the incubator
could get deleted through GC while constructing the
component.
Change-Id: Ibe0c5d4e172f0b5505ace0c3ea0369169b8b48a5
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Tue, 15 Oct 2013 10:43:57 +0000 (12:43 +0200)]
Make sure the incubated object survives the statusChanged call
QQmlComponent::statusChanged() marked the incubated object
as destructable when it was done loading. This implied
that any gc call afterwards could clean it up. To fix, push
the object on the GC stack so it lives until the method returns.
Also renamed the WrapperIncubator to QQmlComponentIncubator.
Change-Id: I5a8f478a1fd65ea73ddff310392219709a935a70
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Mitch Curtis [Wed, 9 Oct 2013 10:44:13 +0000 (12:44 +0200)]
Fix MSVC2010 warnings.
Change-Id: Id7a2465db4f9b1cd4d3b7ecd61538ee7110893df
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Shawn Rutledge [Wed, 25 Sep 2013 12:22:29 +0000 (14:22 +0200)]
QtQuick.Dialogs: on single-window platforms, don't resize the window
m_dialogWindow only needs to be set if the dialog has its own window,
because otherwise setters such as QQuickAbstractDialog::setHeight
(introduced in
37492efee021ccc6e550ecb67a3240b76eb2219e)
will result in reshaping the main application window instead of the
dialog. Also the window decoration's translucent "veil" should
expand to fit the whole application.
Change-Id: I16fdb48c54dbc5e758dfec1f18063579ac2bbb05
Reviewed-by: Liang Qi <liang.qi@digia.com>
Lars Knoll [Mon, 14 Oct 2013 20:42:06 +0000 (22:42 +0200)]
Fix some more issues with exact GC
Get the formal and local names of function object from the
compilation unit to avoid creating another set of strings.
Use a ScopedFunctionObject in eval()
Change-Id: I6693aec2e88818df9c160b3780db12d8df79c2fe
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Mon, 14 Oct 2013 14:48:30 +0000 (16:48 +0200)]
Fix GC issue with incubators
Never use multiple inheritance with Managed subclasses,
as this can easily mess up garbage collection. In this
case the vtable from the QQmlIncubator would be added
before the start of the Managed pointer. That would
not work correctly for the memory manager that casts
void pointers to Managed pointers.
Change-Id: I1c1ebc6c44bd9cb77eea49738e86ce3374c7ef80
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Sun, 13 Oct 2013 19:03:44 +0000 (21:03 +0200)]
inline get_element calls
Inline calls to get_element if the base is an
object with a simple array structure, and the index
is an integer number.
Implemented for 64bit only for now, saves ~25% on crypto.js
Change-Id: I3e34a6409169d90d3937f62264707d52a6c2f9f7
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Sun, 13 Oct 2013 20:08:59 +0000 (22:08 +0200)]
Avoid creating array attributes if possible
Holes in arrays should be represented by an empty
value, not by creating/setting array attributes.
Reason is that the creation is irreversable, and slows
down execution. This speeds up crypto.js by 10%
Change-Id: I2e5472575479a5f2dbe53f59ecb8ed3aeab1be7a
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Mon, 14 Oct 2013 11:08:58 +0000 (13:08 +0200)]
Fix performance regression introduced by 6adb06
The global scope is compiled as EvalCode. Because of this
we were never using global lookups anymore, slowing down
the v8 test suite by ~20%.
Change-Id: I6c47ccf90f4d9ec3bf531bbb689d3f1511f69968
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Mon, 14 Oct 2013 06:54:44 +0000 (08:54 +0200)]
Fix a small bug in conversion to SInt32
If the truncation from double returned out of bounds,
the code was not generating the right call to the fallback
method on 64 bit.
Change-Id: I6a126dd013c5b6373762beef0c1459fae1c26ef2
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Mitch Curtis [Mon, 14 Oct 2013 13:40:50 +0000 (15:40 +0200)]
Touch up QJSEngine::evaluate documentation.
Change-Id: I350ad1ccb8a6cf522787e4579292fa4ba1c8e043
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Erik Verbruggen [Mon, 14 Oct 2013 13:20:31 +0000 (15:20 +0200)]
V4 JIT: fix stack size calculation on 32bit.
Registers containing outgoing parameters for calls are saved as Value
(so, 8 bytes long) instead of native register size. For 64 bit this is
the same, but not for 32 bits.
Change-Id: If1d55e9d552a301782816c9228390dc5611c6d00
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Erik Verbruggen [Mon, 14 Oct 2013 13:18:54 +0000 (15:18 +0200)]
V4 disasm: fix sub sp,sp,imm
This is a special-case instruction, where the immediate needs to be
multiplied by 4.
Change-Id: I86e5ab9d39d65b8eab99fae859969896c6e5630c
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Giulio Camuffo [Fri, 11 Oct 2013 12:48:28 +0000 (14:48 +0200)]
Don't leave a window current when removing it
The window may be deleted before any other window is make current,
and that would lead to memory corruption with Mesa's EGL.
Change-Id: I414b972fd517f60c28d194fa059bf7871e422872
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Morten Johan Sørvig [Fri, 4 Oct 2013 10:29:03 +0000 (12:29 +0200)]
Fix the QML import search.
Match the algorithm used by QML, look for the most
specific version of an import first.
Change-Id: Ibf1370af227c8154f657cc2d8a1c1d1ae28d2f39
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Morten Johan Sørvig [Thu, 26 Sep 2013 09:24:30 +0000 (11:24 +0200)]
Make qmlimportscanner report plugin classnames.
Change-Id: Ifbe72e6dcc569c8cb311d46e4f265da348b353ea
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Morten Johan Sørvig [Thu, 26 Sep 2013 09:05:53 +0000 (11:05 +0200)]
Add classnames for QML import plugins.
Needed for static builds. qmlimportscanner will
read the "plugin" and "classname" entries.
Change-Id: I31939451366ad3e771d516ac426525c8bcdba57d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Fri, 11 Oct 2013 21:20:16 +0000 (23:20 +0200)]
Implement >>> inline for the JIT backend
The unsigned right shift operations can use a signed int as input, unifying
the handling with the other shift operations. The only difference now is
in the type of the return value.
Change-Id: Ia9b83568951d1c1c77322d07cd734e2c37d34573
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Erik Verbruggen [Fri, 11 Oct 2013 16:28:54 +0000 (18:28 +0200)]
V4 JIT: fix register allocator after change to s/uint32 usage.
Now that shifts can take a signed int32, reflect it in the check if a
binop will generate a call.
Change-Id: I3cab436bace31cdda327cf6132aa873b6c5456b1
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Erik Verbruggen [Fri, 11 Oct 2013 13:21:57 +0000 (15:21 +0200)]
V4 JIT: clean-up conversion functions and add toUInt32.
Change-Id: I7ac685145fa41db2a0e02c4d15d1d287d80621f8
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Erik Verbruggen [Thu, 10 Oct 2013 11:06:00 +0000 (13:06 +0200)]
V4 ARM: fix disassembler vmov
rt is on position 12. See A8.8.345.
Change-Id: Ibf380b9bda8d2edd603857935d6c92cd89d0f104
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Lars Knoll [Fri, 11 Oct 2013 20:02:38 +0000 (22:02 +0200)]
Remove some unused flags from Managed
Change-Id: I94399489823d5b0d4d40f300e1999272dc2da5c9
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Simon Hausmann [Wed, 9 Oct 2013 07:37:08 +0000 (09:37 +0200)]
Compile signal handler expressions in the loader thread
Handle them similar to function declarations, except that we need to synthesize
the expression into a function declaration that includes the signal parameter
names. This is done quite similar to the code path in the new compiler.
Change-Id: I751081f7f1052692da6e2ed60c7f5c017372d829
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Tue, 8 Oct 2013 22:24:55 +0000 (00:24 +0200)]
Compile JS functions as part of the QQmlCompiler run in the loader thread
...instead of extracting the function body as a string and compiling it in the
GUI thread.
Change-Id: I3c3108f6e35464b5581a2d8b5799e7285858ce4d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Tue, 8 Oct 2013 09:44:57 +0000 (11:44 +0200)]
Compile binding expressions in the QQmlCompiler
This is done by re-using the JS code generator from the new compiler. A few bugs were
fixed on the way:
* The index into the compiledData->runtimeFunctions array is not the same as the function
index when they are collected (from the AST), as for example binding expressions may create
extra V4IR::Function objects that break the 1:1 mapping. Therefore the JS code gen will return
a mapping from incoming function index to V4IR::Module::Function (and thus runtimeFunction)
* Binding expressions in the old backend get usually unpacked from their ExpressionStatement node.
The reference to that node is lost, and instead of trying to preserve it, we simply synthesize it
again. This won't be necessary anymore with the new compiler in the future.
* Commit
1c29d63d6045cf9d58cbc0f850de8fa50bf75d09 ensured to always look up locals by name, and so
we have to do the same when initializing the closures of nested functions inside binding expressions
(in qv4codegen.cpp)
* Had to change the Qml debugger service auto-test, which does toString() on a function that is now compiled.
Even if we implemented FunctionPrototype::toString() to do what v8 does by extracting the string from the
file, it wouldn't help in this test, because it feeds the input from a string instead of a file.
* In tst_parserstress we now end up compiling all JS code, which previously was only parsed. This triggers
some bugs in the SSA handling. Those tests are skipped and tracked in QTBUG-34047
Change-Id: I44df51085510da0fd3d99eb5f1c7d4d17bcffdcf
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Fri, 11 Oct 2013 12:56:15 +0000 (14:56 +0200)]
Fix failing assertion (index != -1) when trying to re-declare a function parameter
Testcase: (covered in parserstress)
function foo(x) {
var x = 42;
}
In variableDeclaration, the lookup for "x" with findMember will return -1, and
instead code for checking against arguments using indexOfArgument is needed.
The easiest fix is to simply use identifier(), which handles this accordingly.
Change-Id: I6a738d6196d4bff1fc987f111aebbaa83ed8f88f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Fri, 11 Oct 2013 11:50:23 +0000 (13:50 +0200)]
Fix determination of lookup mode in V4 code generator
In order to determine the type of lookup we need (name or directly in
environment members), we used Codegen::_mode, which is set to the currently
suitable mode depending on the function (parameter to defineFunction). However
that's not quite correct, the look-up mode depends on the function itself, not
where it was called from. This patch corrects that by moving the compilation
mode into the Environment itself.
This is needed by follow-up patches.
Additionally the "bool deletable" parameter to the builtin_declare_vars was
always set to false, because it used mode instead of _mode, which was never set
to Eval or QmlBinding. This will be cleaned up in a future patch.
Change-Id: I878f187945e5de091689ab5d70a0f33eb5a9e38f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Fri, 11 Oct 2013 12:35:51 +0000 (14:35 +0200)]
Fix crash in duplicate labelled statement check
Testcase (part of parserstress in tests/auto/qml):
outer: {
do {
inner: {}
} while (false)
}
The labelled statement visitor, when hitting the outter label, would call
enterLoop(), which sets _labelledStatement back to zero. That then gets added
to the Loop object the do-while loop creates, and the duplicate labelled
statement check then for inner would unconditionally dereference
loop->labelledStatement.
In all other places where we access loop->labelledStatement we have a null
pointer check, so let's have one here as well.
Change-Id: I9d5925a2abf4db691c49c0cdec3550938ee02efa
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Lars Knoll [Fri, 11 Oct 2013 12:58:45 +0000 (14:58 +0200)]
Fix possible crashes
This can (and does crash) when a gc gets triggered during the
linking stage of a compilation unit.
Change-Id: I06f1299adab68ff8e0a4755d02e246870797e7f2
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Jan Arve Saether [Fri, 11 Oct 2013 13:12:14 +0000 (15:12 +0200)]
Correct a small typo to QtQuick::Grid::horizontalItemAlignment
Change-Id: I09d56b69d9d958e7ad4bebd78dd66316a84a50b6
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Eskil Abrahamsen Blomfeldt [Fri, 11 Oct 2013 08:48:57 +0000 (10:48 +0200)]
Android: Skip tools built for target architecture
Android apps require packaging to be usable, so they need to be
built individually, not as part of the subdirs build. The build would
fail during make install due to this.
Task-number: QTBUG-34023
Change-Id: Id68f5fbdd4eeb6f130d20a0f4b831c6c24639471
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Lars Knoll [Fri, 11 Oct 2013 11:29:44 +0000 (13:29 +0200)]
Correctly set the vtbl for Boolean and NumberObject
Also accept a boolean primitive as input to
Boolean.prototype.valueOf()
Change-Id: I5b94d8d65b86e26860b9844eb4bf823577c8e924
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Fri, 11 Oct 2013 10:26:27 +0000 (12:26 +0200)]
Fix the remaining objects against self destruction
This makes pretty much all test cases pass with exact
garbage collection.
Change-Id: Ia874e3c17c3984afb7cfe370f9bd3ad8fe46699a
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Fri, 4 Oct 2013 13:38:42 +0000 (15:38 +0200)]
Optimise code generation for convertTypeToSInt32
Add 64 bit code patch and avoid some duplicated
calculation in 32 bit mode
Change-Id: I0e111de8ac4e733aa8802c49b4b15d785688d7ea
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Simon Hausmann [Fri, 11 Oct 2013 11:22:19 +0000 (13:22 +0200)]
Fix build on Android with -developer-build
That configuration implies -Werror for some kind of warnings. This patch fixes
* Mix of different types in conditional (qv4isel_masm.cpp)
* Noreturn function returning instead of calling another noreturn function at the end (qv4engine_cxxabi.cpp)
* An out-of-line function being declared inline
Task-Number: QTBUG-33998
Change-Id: I3ba58dcadeac6774c5de63e6bb551354a2f23332
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Richard Moe Gustavsen [Tue, 13 Aug 2013 12:16:26 +0000 (14:16 +0200)]
Support statically linked module plugins
Up til now, QQmlImports would always assume module plugins are
dynamically linked, and as such, go looking for them on the file
system. This would fail for plugins linked in statically.
This patch will hook into QQmlImports at the place where it
iterates through all plugins in a qmldir and try to load them
dynamically. If some plugins cannot be resolved, we now do an
extra interation over static plugins to check if any
of them has the correct uri specified in their metadata.
Hooking into the loading process this late, will ensure that as
much code as possible is shared between dynamic and static plugin loading
so that setting up base urls, namespaces and guards will remain the same.
Note: this patch is one out of several patches that is needed to build
QML2 apps statically, and depends on plugins reporting their URI
through the plugin meta data system. This will be injected
automatically by qmake+moc.
Task-number: QTBUG-28357
Change-Id: If9a204e942ca7003448e188a1a47eec69b34c37b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Gunnar Sletta [Thu, 10 Oct 2013 07:41:43 +0000 (09:41 +0200)]
Fix and re-enable constantUpdateOnWindow test.
Change-Id: I0015ea58bfd673352405642153a038b72d44aa37
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Gunnar Sletta [Mon, 7 Oct 2013 11:05:36 +0000 (13:05 +0200)]
Unskip test which now passes.
Change-Id: Ifccab1ef822a9bb455d442f6b13711887a399d6e
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Lars Knoll [Thu, 10 Oct 2013 17:52:49 +0000 (19:52 +0200)]
Protect a few constructors against self destruction
This gets most of qqmlecmascript to pass with aggressive and
exact garbage collection.
Change-Id: I93ecbfe55f62af68227cdf3b1ec2bd066f1cbdef
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Thu, 10 Oct 2013 14:17:28 +0000 (16:17 +0200)]
Smaller cleanups
Change-Id: I0a7eee96ef7c92ad4a3c5963010e3ac66fe6ed3a
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Thu, 10 Oct 2013 10:21:12 +0000 (12:21 +0200)]
Remove usage of String pointers where not required
Change-Id: Ia533308a1641fab263d8faa8316455e8ade1c859
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Thu, 10 Oct 2013 09:29:19 +0000 (11:29 +0200)]
Mark strings stored in the lookups
Change-Id: I4cb72a3eee9f87305316137b0a1bfd4a003de840
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Mon, 7 Oct 2013 10:23:38 +0000 (12:23 +0200)]
Remove more direct usages of Managed pointers
Change-Id: I32f61b7919797eef51a8705695787175b76244c4
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Fri, 4 Oct 2013 19:31:34 +0000 (21:31 +0200)]
Small optimisation for bit shift operations
We don't need the right side of the shift operation as uint.
Converting it to int is cheaper and more then enough, as all
but the lowest 5 bits are ignored anyway.
Change-Id: I8833e6cc4e565b8bd1e35a22250e03a9b34938df
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Simon Hausmann [Thu, 10 Oct 2013 18:53:32 +0000 (20:53 +0200)]
Fix build on iOS
On 32-bit ARM, iOS uses SJLJ for exceptions, which is probably why
_Unwind_Backtrace is not available (it's hard to implement reliably without
unwind tables). Don't use it there, we don't need it (because we can't JIT).
Task-Number: QTBUG-33979
Change-Id: Ifafbb59a32fd23c9b2e93228779535b2324ac4a3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Simon Hausmann [Thu, 3 Oct 2013 11:03:18 +0000 (13:03 +0200)]
Add support for showing disassembled ARM JIT code
Ported the ARM disassembler from upstream trunk. QtQml needs to be configured
with qmake CONFIG+=disassembler and QV4_SHOW_ASM=1 enables the dump at
run-time.
Change-Id: Ia13a98835829fde0d3c5a795cb8f6ef9de951807
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Martin Smith [Tue, 8 Oct 2013 13:56:44 +0000 (15:56 +0200)]
qdoc: Added excludedirs to qtquickdialogs.qdocconf
Added excludedirs += ../qml to qtquickdialogs.qdocconf.
Task-number: QTBUG-33966
Change-Id: I08a74061ed82301712239bc0979ed6fcea0a2448
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Erik Verbruggen [Wed, 9 Oct 2013 08:47:11 +0000 (10:47 +0200)]
V4 runtime: add some more counters.
Change-Id: I872f259a9fd4580e8faeae664f4d34f59a785c4e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Erik Verbruggen [Tue, 8 Oct 2013 08:48:57 +0000 (10:48 +0200)]
V4 JIT: ISel for bitwise or/xor.
Removes another 4mln calls when running v8-bench.js.
Change-Id: I7fd777e4e6303f989391c4d1e361277cc24b37e8
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Erik Verbruggen [Fri, 4 Oct 2013 14:06:16 +0000 (16:06 +0200)]
V4 JIT: generate some strict (not) equal conditions
Checks for strict (not) equal to null, undefined, or a boolean value
can be generated without reserving extra registers, or doing a call.
This reduces the amount of runtime calls from >25mln to ~6500 for
v8-bench.js
Change-Id: If08d1124b2869227654b1233a89833c5b5e7b40c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Erik Verbruggen [Fri, 4 Oct 2013 11:47:12 +0000 (13:47 +0200)]
V4 JIT: do not generate inline fall-back code for strings types.
Change-Id: I30ac6fcbc7d03f412ff03e87f2ecf61fd2617108
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Erik Verbruggen [Fri, 4 Oct 2013 09:55:38 +0000 (11:55 +0200)]
V4: Remove more jumps.
Do not generate jump instructions when the target immediately follows
the current basic block, even if there are intermediate jumps in between
as long as they jump to the same basic block. In the IR snippet below,
no jumps will be generated at all.
…
L8: goto L6;
L12: goto L6;
L6: goto L4;
L11: goto L4;
L4: goto L2;
L10: goto L2;
L2: ….
Before this change, the gotos in L8, L6, and L2 were still generated.
Change-Id: I718ed0d41c603a6905f2279b782cd9e9cafb7d55
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Kai Koehne [Mon, 7 Oct 2013 12:22:02 +0000 (14:22 +0200)]
Use common prefix for environment variable
Change-Id: Idbbdcad42106d30451000fc6593428a0bac4bc04
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Gunnar Sletta [Tue, 8 Oct 2013 06:54:38 +0000 (08:54 +0200)]
Be explicit about precision specifiers.
Task-number: QTBUG-33912
Change-Id: I4b6988e7385bcf9167e5f44d0bde7c80fbc1e117
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Gunnar Sletta [Mon, 7 Oct 2013 08:17:56 +0000 (10:17 +0200)]
All matrices in a batch need to be 2D safe when merging.
If we merge geometry nodes that make actual use of the
z-coordinate, this information becomes lost when merging
and the result is that we end up with an arbitrary
wrongfully applied transformation to the merged element.
Task-number: QTBUG-33897
Change-Id: I6129243e9bb890949023c35dc6b7bce30d31709a
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Gunnar Sletta [Fri, 4 Oct 2013 13:42:35 +0000 (15:42 +0200)]
Several smaller fixes to Animators.
Backwards animations are not supported for animators as the
animation system cannot handle uncontrolled backwards animations.
Make sure we write back values only for the animators that have
run at all.
Clockwise rotation to 0 can easily end up on 360 as a result
the _q_interpolateClockwise function not being entirely correct.
Change-Id: If69b8555a1361f46600a40e80419b65438c18097
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Robin Burchell [Mon, 7 Oct 2013 23:23:15 +0000 (01:23 +0200)]
Delay calculation of offline storage path as long as is practically possible.
This avoids calculating it incorrectly in the case that something later clobbers
argv, such as a zygote or booster-type mechanism.
Change-Id: Ifab16c7c94e9ee3fded0dfda2266a12c910858ee
Reviewed-by: Matthew Vogt <matthew.vogt@qinetic.com.au>
Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
J-P Nurmi [Mon, 7 Oct 2013 09:43:59 +0000 (11:43 +0200)]
Fix qquickframebufferobject.h syncqt warning
QtQuick: WARNING: qquickframebuffe robject.h includes QQuickItem when
it should include QtQuick/QQuickItem
Change-Id: Ia702bab8881ade601693cbee495b1dc6a5e14abb
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Thiago Macieira [Fri, 4 Oct 2013 04:54:18 +0000 (21:54 -0700)]
QStringRef has toInt(), so no need to create a new QString
Saves up on memory allocations.
Change-Id: I0f7c82521b0b10085861fc62fed9b9d591169b5a
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Friedemann Kleint [Fri, 4 Oct 2013 08:28:23 +0000 (10:28 +0200)]
Reshuffle inlined functions to fix MinGW-warnings.
When compiling QtQuick:
qv4value_p.h:80:17: warning: 'QV4::Managed* QV4::Value::asManaged() const'
redeclared without dllimport attribute after being referenced with dll
linkage
^
qv4value_p.h:180:14: warning:
'static QV4::Value QV4::Value::fromManaged(QV4::Managed*)' redeclared
without dllimport attribute after being referenced with dll linkage
^
qv4value_p.h:285:16: warning:
'QV4::String* QV4::Value::asString() const' redeclared without dllimport
attribute after being referenced with dll linkage
Change-Id: I548a2f8049b8eca06ab1061f56416a332820dc01
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Michael Brasser [Fri, 4 Oct 2013 02:14:08 +0000 (21:14 -0500)]
Fix regression in pressDelay behavior.
Don't deliver a press event when a Flickable is moved before
the pressDelay expires. This prevents delegates flickering
between pressed and unpressed states when beginning to
flick a Flickable.
Fixes regression introduced by
429af6244518172e19abf7fecd7112f26bac6b31/
d02131e743597b9bd3070d986c61a1c91ea8317a.
Task-number: QTBUG-31168
Change-Id: Id4e853fabe99000837df3681acd8fc4e76d2e9b3
Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
Gunnar Sletta [Fri, 4 Oct 2013 08:39:20 +0000 (10:39 +0200)]
Respect DirtyForceUpdate in QSGBatchRenderer.
There is a way this could have been done slightly more efficitently.
If we moved all "combined" logic out of the scene graph and into the
Node shadow tree, we could ignore the forceupdate all
together. However, this is a quite large change for what is currently
a non-common case. It would also increase overall memory consumption a
bit as we would have superfluous combined matrix and opacity in the
QSGNodes.
Task-number: QTBUG-33838
Change-Id: I06c486ace2be15bef1f1dc72a8b41cb649d7c813
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Erik Verbruggen [Wed, 25 Sep 2013 13:16:39 +0000 (15:16 +0200)]
V4 JIT: enable register allocator for linux/x86.
Change-Id: I9424838139a419beb2e207f168fc25c0c47c64e3
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Erik Verbruggen [Wed, 25 Sep 2013 13:17:16 +0000 (15:17 +0200)]
V4 JIT: fix visitRet for 32-bit architectures.
Change-Id: I004fe8d5de0f5a932c23393ed06a04738b8e8bf1
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Petr Nejedly [Fri, 4 Oct 2013 05:18:54 +0000 (22:18 -0700)]
Signal no region descriptors follow the ETH table.
In our implementation, the 2-word EXIDX is directly followed
by a 3-word ETH for personality 2 unwind interpretter.
According to ARM EHABI 9.2, "region of interest" descriptors
should follow, finished by a single zero word.
As the generated functions don't have any such regions,
only the closing zero needs to be present.
Change-Id: I65fde548371cf12a31aac3e8829275965e034f3a
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Gunnar Sletta [Thu, 3 Oct 2013 07:01:51 +0000 (09:01 +0200)]
Make sure to markDirty the node from UniformAnimator.
Failure to do so will not repaint scene graphs which only
has changes from the animator.
Change-Id: Id420775d704df17379ca9b0eecd543fd3829fd00
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Gunnar Sletta [Thu, 3 Oct 2013 06:52:39 +0000 (08:52 +0200)]
Make sure we apply the last transformation step.
Change-Id: Ie9b9a04cf41033bb475875f419b16ce91f6a477d
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Gunnar Sletta [Thu, 3 Oct 2013 07:00:08 +0000 (09:00 +0200)]
Make transform and opacity animators work when layer.enabled: true
Change-Id: I6d9ece93a75782d524c211fc81a43f4311a38571
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Gabriel de Dietrich [Thu, 3 Oct 2013 15:04:40 +0000 (17:04 +0200)]
Remane private QQuickAction into QQuickStateAction
This avoid symbol conflicts when statically linking with Qt Quick
Controls, that has its own QQuickAction class and which may become
public some day. (QQuickPropertyAction might be a more apt name, but
it's already taken).
Change-Id: Ia9514d63d38295603a89d8ec5a88815a651380f7
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>