Lars Knoll [Mon, 21 Oct 2013 07:50:27 +0000 (09:50 +0200)]
Properly propagate parse errors
Replace all try/catch statements used when parsing
with checks for engine->hasException.
Change-Id: I4493cb600d5a3eb095c2003bb88bd031403e47c9
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Mon, 21 Oct 2013 11:07:33 +0000 (13:07 +0200)]
Exit the codegen in case we have thrown a parse error
This makes sure we get the right exception in the engine
in case there are multiple parse errors in the code, and
avoids running into assertions.
Change-Id: I8a11c6d043d09caf57a3e4c6aad5834e99cc1761
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Wed, 23 Oct 2013 12:03:09 +0000 (14:03 +0200)]
Implement new exception handling for moth
Add the required instructions and check for
exceptions in the engine before storing any
results.
Change-Id: Ibfaf904d659859e8012920270825211ba202c63d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Mon, 21 Oct 2013 15:07:45 +0000 (17:07 +0200)]
Rework IR code generation for try/catch/finally
Simplify the generated code. Add a special block to catch
exceptions thrown inside a catch() statement.
store the exception on the stack when entering finally and
rethrow it at the end. This ensure correct behavior for
break/continue/return statements inside finally.
Don't check for exceptions after calling push_catch_scope
and pop_scope in the JIT'ed code. This can lead to infinite
loops when throwing inside an exception handler.
Change-Id: I67e9325794e2fd25b0773b21e02fbaadb43faab0
Change-Id: Ic1ea9c0c43eec1d49177dc1ab4552a1da04e96fe
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Fri, 18 Oct 2013 13:42:17 +0000 (15:42 +0200)]
Rework exception handling
Start the work to remove c++ exceptions from our JS
exception handling. Rather rely on engine->hasException.
Check the flag after we return from any runtime call in the
JIT.
Implement new try/catch handling code in qv4codegen and
for the JIT that doesn't rely on exceptions. As an added
bonus, we can remove the Try statement in the IR.
Change-Id: Ic95addd6ae03371c43c47e04cac26afdce23a061
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Tue, 29 Oct 2013 09:29:27 +0000 (10:29 +0100)]
Disable the stack slot allocator
The allocator doesn't work correctly and sometimes assigns
temps with overlapping ranges to the same stack slot.
This fixes crypto.js and qt quick controls autotests running
with the interpreter.
Change-Id: If3d0f90edfac669f89da5174cd58eb345d48f2b8
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Gunnar Sletta [Thu, 24 Oct 2013 18:44:17 +0000 (20:44 +0200)]
Fix rendernode bug and enable rendernode test.
The bug in the renderer was that the viewport was set before
we called the render node, leaving us with the viewport
set by the render node as opposed to the viewport of the
renderer.
The render node API is a crude and intrusive hack which was added for
webkit back in the day. With the introduction of webengine it becomes
less relevant, but it should still work.
Change-Id: I66a1e3047e018ad6c0bb28044851e9fc65da59cc
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Shawn Rutledge [Fri, 25 Oct 2013 13:24:50 +0000 (15:24 +0200)]
QtQuick.Dialogs: resolution-independent controls use actual resolution
logicalPixelDensity ended up hard-coded on Android, which made the
buttons and the FileDialog too small again.
Change-Id: Ic1805246c4466d7167d422ba48ae5ec37978d332
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Shawn Rutledge [Fri, 25 Oct 2013 13:16:46 +0000 (15:16 +0200)]
Screen attached property: expose pixelDensity property
Because logicalPixelDensity is different than physical density on
multiple platforms, having the actual density is critical to be able
to design resolution-independent controls.
Change-Id: I06bbdc6e6869718058a796ca737668ce69802f2b
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Gunnar Sletta [Thu, 24 Oct 2013 17:59:12 +0000 (19:59 +0200)]
Make sure QQuickBorderImage sets its pixmapChanged dirtyflag
Task-number: QTBUG-34298
Change-Id: Ie66f0bdd705335491496f5d583193b32cb7749f3
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Antti Piira [Wed, 23 Oct 2013 20:53:38 +0000 (13:53 -0700)]
Use finalUrl in QQmlTypeLoader::Blob::addPragma to fix a bug.
There was a bug in addPragma where url() was being used instead of
finalUrl(). This resulted in an error finding the type if selectors
were used. This patch includes the fix and adds a unit test to cover
the use case.
Change-Id: I18b6c73e96af2e1464931de76f1f8fd804746d82
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Tor Arne Vestbø [Fri, 18 Oct 2013 15:12:15 +0000 (17:12 +0200)]
Explicitly mark subdirs as host_builds in SUBDIRS template
Allows post-processing code to exclude recursing into host_build subdirs.
The alternative would be to have the SUBDIRS logic pre-parse the subdir
project to check if it's a host_build, but that might have a performance
impact, so it's better to leave the information explicit in the subdir
project file.
Change-Id: I468ceeaedce54b13bf672f82b9dcf04cc19d15e1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Oswald Buddenhagen [Fri, 18 Oct 2013 10:18:07 +0000 (12:18 +0200)]
simplify host_build logic again
qt_tool handles bootstrapping fully automatically.
This reverts commit
0fc040ef70513ccaeb9e96f7ca05a3df4d6c7879,
and adds some more.
Change-Id: Icffcf7f487dbf660678c7ee622f94b1063fef7e3
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Oswald Buddenhagen [Tue, 22 Oct 2013 10:06:56 +0000 (12:06 +0200)]
sanitize dependencies surrounding qmlimportscanner
the tool's subdir must come before its dependants, otherwise qmake -r is
broken (ok, that's mostly academical nowadays).
also remove the unnecessary dependencies.
Change-Id: Idf785522d466d4abb5f864ef4b66784024322339
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Oswald Buddenhagen [Tue, 22 Oct 2013 10:03:53 +0000 (12:03 +0200)]
untangle SUBDIRS
this also excludes qmlprofiler on android, as it is not a host tool.
Change-Id: I0bc2582fa4b951ea1f871cd67ef05d0d15ed9763
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Oswald Buddenhagen [Fri, 18 Oct 2013 10:26:14 +0000 (12:26 +0200)]
remove useless CONFIG-=app_bundle
qt_app.prf does this for us.
Change-Id: Ifdbed1028a170f1a5040d9ef38c0adc89ed6da52
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Tasuku Suzuki [Sat, 12 Oct 2013 02:59:09 +0000 (11:59 +0900)]
Make qtdeclarative compile with -no-gui
Change-Id: I079f5e09a0099550348388379c496fc8f8cfa27c
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Shawn Rutledge [Fri, 25 Oct 2013 06:53:52 +0000 (08:53 +0200)]
Item documentation: visibleChildren is a list of items, not a real
Followup to I5ec541226fabd72c05ce8ccb8bb7e56f6ec7717a
Task-number: QTBUG-22724
Change-Id: I3f74fda29faba4054c5bb97aad4735f7c5f0f278
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Alan Alpert [Wed, 23 Oct 2013 20:20:39 +0000 (13:20 -0700)]
Clear text node references after sub-tree has been cleaned up.
Task-number: QTBUG-34181
Change-Id: I861e192cee2c683efee79e7404a5c9d70b60691f
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Venu [Wed, 23 Oct 2013 13:53:49 +0000 (15:53 +0200)]
Doc: Fixed broken links
There were many links (including the broken) on the Qt Quick
index page and QML type reference page using the html file name
to link to a page or a section within a page. Using html file
reference in a link is not a good approach as qdoc does not give
complete control to the author to define the html file name. This
change updates all such links to use the page \title and \target
names, which are considered to be better ways to link.
Task-number:QTBUG-33360
Change-Id: Ibd1b1e3223a7e205bbdcf21b1b7f6e515749c5c9
Reviewed-by: Nico Vertriest <nico.vertriest@digia.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Erik Verbruggen [Wed, 11 Sep 2013 11:46:27 +0000 (13:46 +0200)]
V4 debugger: retrieve formals and locals.
Change-Id: I47507a4d7d1b429b9c43ed3a7822079efe577327
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
John Brooks [Thu, 24 Oct 2013 02:56:08 +0000 (20:56 -0600)]
Allow " in QQuickStyledText
QString::toHtmlEscaped generates ". QQuickStyledText should be
symmetrical with that function.
Change-Id: I67ea0abe446b5fa1edb53258dca58b84af910e28
Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
Venu [Tue, 22 Oct 2013 11:47:20 +0000 (13:47 +0200)]
Doc: Added a QML module page for Qt Quick Test
This should avoid the TestCase and SignalSpy
types being listed in the All Classes page, which
is meant for the C++ classes.
Task-number: QTBUG-33316
Change-Id: I0f2f9e557df89f46f656a8820602fe5712c64073
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Simon Hausmann [Wed, 23 Oct 2013 09:49:19 +0000 (11:49 +0200)]
Win32: Remove dependency to DbgHelp DLL
This was used for natice stack trace determination, which is done
differently now.
Change-Id: Id983f2bf6805aaf3f7081a16196268be88c98951
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Gatis Paeglis [Tue, 22 Oct 2013 14:20:11 +0000 (16:20 +0200)]
Make LocalStorage more verbose
Change-Id: I4f3dd475156941f1a1d2815a4db57ad9abf8f27d
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
J-P Nurmi [Mon, 21 Oct 2013 12:43:19 +0000 (14:43 +0200)]
Avoid crash when a QML signal is connected to a non-void slot
Don't pass a QVariant pointer for the return value when we're
not interested in it and the return type might not even be a
QVariant (that would be only true for QML methods).
Task-number: QTBUG-32801
Change-Id: I8f14e40d8f94caef7e3d086b776735f0484dbf0e
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Kai Koehne [Tue, 22 Oct 2013 08:22:09 +0000 (10:22 +0200)]
Re-enable debugger autotests on Mac
Partially revert
8ed38c70 to also test qqmlprofiler, qqmlinspector
on Mac. The tests were unreliable before, but that was fixed with
816e7f11f
in qtbase.
Change-Id: Icca7ff6617ea18d069d4cd95905d76fe59b92e31
Reviewed-by: Aurindam Jana <aurindam.jana@digia.com>
Gunnar Sletta [Mon, 21 Oct 2013 13:22:23 +0000 (15:22 +0200)]
Remove ancient and unused leftovers
Change-Id: Ia3a2aa2244748c2f3f2df8853f5bddfbbc4bc19f
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Simon Hausmann [Mon, 21 Oct 2013 08:28:33 +0000 (10:28 +0200)]
Rename v4 to qmljs
We don't want to officially support this binary in our release builds, so
give it a "safer" name and enable it only in developer builds.
Change-Id: Iaa007bc2ccdb133635161aae01d140efe0f44e23
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Gunnar Sletta [Mon, 7 Oct 2013 09:03:05 +0000 (11:03 +0200)]
Make example work on Windows
Change-Id: I75a035939a390de8cdae03c11599efa0b7ed68df
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Gunnar Sletta [Mon, 21 Oct 2013 10:06:59 +0000 (12:06 +0200)]
Re-enable working test.
Task-number: QTBUG-33517
Change-Id: I05ec6085b26a8d002cb904fecc172fa2eefbf79d
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Antti Piira [Tue, 24 Sep 2013 19:49:10 +0000 (12:49 -0700)]
Add support CompositeSingleton to the new V4 compiler.
Implements QQmlCodeGenerator::visit(AST::UiPragma *) to process any
pragma statements in a QML file for the new V4 compiler approach.
Only pragma Singleton is supported, others will generate errors.
Also adds necessary hooks to treat types as Singletons. Basic
functionality is working, but three of the QML Singleton unit tests
fail. Some of them are dependent on other language capabilities that
seem to have problems.
In addition removes unnecessary toString() call in the equivalent
visit(AST::UiPragma *) function of the old parser.
Change-Id: Iec9fa887f953b80b7f9a11878d846637a8f519ef
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Sean Harmer [Sat, 19 Oct 2013 13:21:31 +0000 (14:21 +0100)]
Don't use reserved keyword "texture" as uniform variable name
The "texture" keyword is a function name in OpenGL core profile. This
commit is in preparation for making the Qt Quick 2 renderer and
materials work with a core profile context.
Change-Id: Iad243e64ab8db739fc46b85bb626bdb8b9ceb208
Reviewed-by: James Turner <james.turner@kdab.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Yuchen Deng [Sun, 20 Oct 2013 06:54:25 +0000 (14:54 +0800)]
Fix MSVC2013 compilation
Change-Id: I79b50e786f46c9a15963f09158c18871c95fe093
Reviewed-by: Peter Kümmel <syntheticpp@gmx.net>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Simon Hausmann [Fri, 18 Oct 2013 13:42:10 +0000 (15:42 +0200)]
Revert commit
d818575966e2e2000fe2b7ee390c620f595d9825
This reverts the commit that deprecated the with statement and added
a note to the docs that binding expressions will be compiled in strict
mode in Qt 5.2.
It turns out that we had to keep the with statement and enabling strict
mode breaks just too much unfortunately.
Change-Id: Id38c27f684fbfcb6b6b848be8f691658089d1adb
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Gunnar Sletta [Tue, 15 Oct 2013 07:12:09 +0000 (09:12 +0200)]
Prevent badly formed texture nodes in the scene graph.
A texture based node without a valid texture is not allowed,
as the material and the renderer will only tolerate
well-formed nodes. If a node is missing any part of its material
state it should not be in the scene graph in the first place.
Because of an "optimization" in QSGDefaultImageNode::setTexture
and QSGSimpleTextureNode::setTexture, we must temporarily set
the texture to 0 to ensure that it gets updated properly. This
temporarily puts the node into an invalid state which can lead
to crashes when QSGNode::markDirty() reaches the renderer.
Task-number: QTBUG-34062
Change-Id: Ic1735c9b974b90b3684262de9589133c961bac6e
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Sergio Ahumada [Fri, 18 Oct 2013 17:26:30 +0000 (19:26 +0200)]
tests: Replace Q_OS_MACX -> Q_OS_OSX
Use the correct identifier for the OS X operating system.
Change-Id: Iff433d312c7c808ddce13466be3db628cf3a9890
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Oswald Buddenhagen [Fri, 18 Oct 2013 11:37:23 +0000 (13:37 +0200)]
suppress qml import scan for the tools which don't need it
Change-Id: Iefdaf60edbe47d2941a0696d96e7b79a67b46d8d
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Albert Astals Cid [Wed, 16 Oct 2013 15:20:59 +0000 (17:20 +0200)]
Reset on model layout changed
Otherwise the next dataChanged from the model may not be received
Change-Id: I16b859d92fdb1823c4a56c297d4451abe438fbb1
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Simon Hausmann [Fri, 18 Oct 2013 13:36:40 +0000 (15:36 +0200)]
Qml JavaScript code generation cleanups
* Run the binding expressions, functions and signal handlers through
the V4 codegen _per_ component, and run the isel at the end for the
entire file. We need to do per-component codegen because we want to
set up the correct id and object scopes, which are different for the
root component and anonymous components.
* Changed V4IR::Module to allow for the concept of "qml modules" where
there is no root function defined. This is a logical consequence of
running v4 codegen multiple times with different input but the same
V4IR::Module.
Change-Id: Ib3a719f83507cbab7c2e4e145ccad5b663c795cf
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Fri, 18 Oct 2013 12:02:56 +0000 (14:02 +0200)]
Cleanup: Avoid unnecessary irModule->functions.indexOf calls
With a growing number of functions per module, these calls become
expensive and are unnecessary. defineFunction in the code generator
can simply return the correct index right away.
Change-Id: I8ab56a3083bf215674a1b46c502b415be694e465
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Lars Knoll [Thu, 17 Oct 2013 06:56:51 +0000 (08:56 +0200)]
Remove internal method from public API
QQmlError is public API and shouldn't expose an internal
method.
Change-Id: I7caf06af9340fefec5c96103395fe74acbf19497
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
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>