Commit Graph

6667 Commits

Author SHA1 Message Date
Lars Knoll e0b511204f Fix IdentifierHash::findId()
Change-Id: Ie5e18b82ceeef85a4dc3e36345c5824f907bb122
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-06-28 14:56:43 +02:00
Lars Knoll f1d79eeb1b Fix compilation with clang
Change-Id: I5884d8f10d9d864578376964e038fa8e477dbff2
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-06-28 14:56:41 +02:00
Lars Knoll 4648ee42c7 We need to allow storing the value of UINT_MAX as an identifier
As this number is not a valid array index, setting it on an
object will store it in the property table.

Avoids a crash in tst_qjsengine.

Change-Id: Idfacde241609e4818d9da79c35705219c733e50d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-06-28 14:56:38 +02:00
Lars Knoll 85ccf50e35 Don't convert to a temporary QString just to compute it's hash
Change-Id: I45fbd4a6304dd2f771d75a47a2ddf162705887b5
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-06-28 14:56:35 +02:00
Lars Knoll bc9c9ca653 Reuse the hash value inside identifier to hash them
Hashing on the pointer value of an identifier doesn't
really make sense. We already have a good hash value
for the identifier, so let's re-use it. In addition, this
allows to look up strings that aren't identifiers.

Change-Id: I9bdb4aa89ae36410f24b3e58c641339e115e4c5f
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-06-28 14:56:31 +02:00
Lars Knoll 8dab9e5d11 Move the IdentifierTable into it's own file
This reduces compile time dependencies.

Change-Id: I7e68ec36022fb0b1dcc10be0cc345aa207ea110c
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-06-28 14:56:29 +02:00
Lars Knoll b83abcb398 Convert QV8Engine::illegalNames() to use the identifier hash
Change-Id: I436c2a17e417cb311f10290a4cc6e5b728b4b7be
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-06-28 14:56:26 +02:00
Lars Knoll de7d66ba02 Convert IdentifierHash to be template based
Make it a template based class, so we can store
more then just integers here and replace more
StringHash'es with it.

Change-Id: I21442d13c6260f184bc7b63a8a58e826699f0c83
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-06-28 14:56:22 +02:00
Lars Knoll 7259642e35 Get rid of QQmlIntegerCache
Replace by the new IdentifierIntHash.

Change-Id: Ib210cd898a30ad3e2f9349387e1a74d92ed5f831
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-06-28 14:56:20 +02:00
Lars Knoll f418bbb883 Add a replacement for QQmlIntegerCache
Change-Id: Ie3e23e10644ce957a0029e83a43367a2339d5335
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-06-28 14:56:17 +02:00
Lars Knoll d33025fe10 Rewrite identifier table
Use a hand written hash table for the identifiers. This
saves quite some memory, speeds up the table, and allows
converting 8bit strings into identifiers.

Change-Id: Id289764097b50bf6c1fc83b1b8c930b5e62a7538
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-06-28 14:56:14 +02:00
Lars Knoll 53819f0ca9 Rename IdentifierHash to IdentifierTable
Change-Id: Ifbf9e947c305e33def311b76a38af17dae90b46b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-06-28 14:56:11 +02:00
Lars Knoll 8cb3b01688 Remove some unused code and forward declarations
Change-Id: I2ab2818159c60b199cae4f7573ea47b01a178e7b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-06-28 14:56:09 +02:00
Lars Knoll 1b3e648a83 Introduce an Identifier class
Identifier are now (opaque) pointers. They contain the
string and it's hash value making conversion from Identifier
back to it's string value a no-op.

Change-Id: Ied7e845a981514890ff6a686e0e3e3057e6b6fbf
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-06-28 14:56:06 +02:00
Lars Knoll f7d727f62c Get rid of QHashedV4String
This was required while we were using V8, but now
we can simply pass QV4::String pointers.

Change-Id: If6338e4a455d6132fe14e5e603e4fe9e477d1ffb
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-06-28 14:56:04 +02:00
Lars Knoll 553b41c407 Remove a potentially dangerous optimisation
The code could fail in case the hashing would happen to return
the same value for both strings.

Change-Id: I7c256754b38aafd8c49b9fbbd2f01b9cc0346a2b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-06-28 14:56:01 +02:00
Lars Knoll e7249321a9 Remove the symbol optimisation from hashed string
Simplify the code, so we can move over to identifiers later.

Change-Id: I42cb164840ecfd3f765049ab9fa46746a0d4a85b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-06-28 14:55:58 +02:00
Lars Knoll 4a3d5537dd Remove an overoptimisation that was only used (wrongly) in one place
Let's simplify this code. The goal is to replace most of the
code in qhashedstring with an identifier based hash table.

Change-Id: I2f9a38ad0bb2f43a2b2b87914823c23ed231f48c
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-06-28 14:55:55 +02:00
Lars Knoll dfbec73b35 More correct assertion in QHasheV4String
Change-Id: Id34dcae9c7e52fe0262b4d9480a7307a393226ee
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-06-28 14:55:52 +02:00
Lars Knoll 6b48a85488 A frozen class is also sealed
Change-Id: Ib4c755cc702155a5cd0428901cf0b8256b76b50a
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-06-28 14:55:49 +02:00
Lars Knoll d76a81cfc9 Don't use a PersistentValue in QHashedV4String
The class is only used on the stack and critical to
performance in a couple of places. This speeds up
some QML benchmarks quite a bit.

Change-Id: Id36682487396d42ddacdc71f7a32792a09318cf9
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-06-28 14:55:46 +02:00
Lars Knoll 04add96a86 Some optimisations for QV4::Script
Change-Id: I468288a537a1a2fa4c38eb188c7b026a390fe13d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-06-28 14:55:44 +02:00
Lars Knoll 9b72f5780d Speed up QV4::InternalClass
the old code used QHash to store the id to index
mapping, which got detached whenever a new internal
class gets created.

Replace this with a much cheaper custom made hash table.
The new hash table actually doesn't require a detach for
the first transition to a new internal class. This saves
significant memory and time esp. for very large objects
such as the Qt object.

Change-Id: Id1e3af4db59cff39d44ff1c211d46f37ff117ea6
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-06-28 14:55:39 +02:00
Simon Hausmann 73649e80c0 Fix daylight savings code on Windows altogether
Reverted the previous change, the local timezone adjustment should not include
the daylight savings, because in a long running program that runs across the
DST boundary, the timezone doesn't change, but the DST adjustment does. That
is why LocalTZA is always used in conjunction with a call to DaylightSavingTA,
which unfortunately had a silly bug on Windows:

It was assumed that _localtime64_s returns zero on failure, similar to
localtime_r on Unix. However it is exactly the opposite, zero is returned
on success and an error code is returned on failure.

Change-Id: Ib324f09f290870630b66793882c5b121de445f05
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-06-27 18:16:43 +02:00
Simon Hausmann 36d45a1585 Fix a whole bunch of time conversion test failures on Windows
Take the daylight bias into account if GetTimeZoneInformation reports that the system is in a dayligh savings aware time zone

Change-Id: I4af7d284aa9147651c246b873c6f9d613b414832
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-06-27 14:23:28 +02:00
Simon Hausmann fa60142520 Fix another failing assertion with MSVC's STL in debug mode
Try to avoid derefencing an empty vector, even when the result is not used.

Change-Id: I8a8d8363f42dc3cea8ee702dc8555494b67a165d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-06-27 14:23:28 +02:00
Shawn Rutledge 74438ef7c1 QtQuick.Dialogs: sync the docs with the implementation
We've been using URLs instead of strings for some time now, just
forgot to change the docs until now.

Task-number: QTBUG-31847
Change-Id: I49a42282aeefb95e4d367397e2f290f4af65687e
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
2013-06-27 13:06:39 +02:00
Frederik Gladhorn a1922317f8 Merge remote-tracking branch 'origin/stable' into dev
Change-Id: I59f34fafd795694981dd1edffca1d322657f1ae6
2013-06-27 12:59:04 +02:00
Simon Hausmann 0a70ad14c4 Fix semingly random failing assertions in DefUsesCalculator
Add a default constructor to DefUse to ensure that the pointer members are
properly initialized to zero.

Change-Id: I80a1858be2662c246f0f1ecd2fa6f795bbdabf87
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-06-27 11:50:43 +02:00
Alan Alpert a8e904c69a Switch to non-streaming version of qWarning()
Allows us to drop the qdebug.h include in a public and frequently used
header.

Change-Id: I2cb05fbec6298ba600020db684e9eea4093ce663
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Christopher Adams <chris.adams@jollamobile.com>
2013-06-27 10:11:10 +02:00
Petr Nejedly 906852f412 Enable ARM unwind support on QNX/ARM as well.
The QNX/gcc behaves the same as Linux when it comes to ARM unwinding
tables. Use the same support as on ARM. It may not work flawlessly yet,
but at least it fixes one of the QNX compilation issues.

Change-Id: I1592a18d62fd8d8738c5254a75c73e3608b3d38b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2013-06-27 07:58:27 +02:00
Alan Alpert a73aae28ee Undo presumably accidental line deletion
Change-Id: I7ddb3ef9b45cfb95c48c2060dc62acd4ed9d64f9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-06-27 02:26:12 +02:00
Simon Hausmann ab6124728f Fix try/catch on ARM
When returning _to_ tryWrapper we pass the address on where to continue
execution in r0. So in our leaveStackFrame() we shouldn't clobber r0
and in fact there's little value in restoring r0-r3 given that they're
used to pass arguments and don't require save/restore.

Change-Id: Iba0091e19eb74347472e698ffc7687e647a5e5be
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-06-26 19:52:13 +02:00
Marco Bubke ffe861a078 Request paint if scene changes for the canvas item
Otherwise for every scene the canvas is simply not painted anymore in the
designer. For example if you change the parent.

Change-Id: I4883eab44d73a59381230755f7caa596f2b6569f
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
2013-06-26 16:53:11 +02:00
Sergio Ahumada 6acdbab5cf Fix module name (QtQml) in the license header under src/3rdparty
Also updating the copyright year to 2013

Change-Id: I743d93d13d1841e13600f7353c4fe3e05bbd7c32
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-06-26 15:50:19 +02:00
Simon Hausmann 3fd2415e91 Fix tst_QJSValue::engineDeleted with MSVC
Don't return void in a non-void function :)

Change-Id: I467347a9471655d3c3472dbe3690e9d26cad7e46
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-06-26 15:46:07 +02:00
Simon Hausmann 8c0b5be802 Fix failing assertion with MSVC in debug builds in various tests
We re-implemented Vector::begin() and end() by means of dereferencing the return
value from std::begin() and then taking the address of it. That causes a failing
assertion in MSVC's STL (rightly so!). We did this only to avoid modifying
the original YarrJIT.cpp code.

This patch instead simplifies our Vector.h stub again and just fixes the two
small occurrences in YarrJIT.cpp where it expects vector->begin() to return a
pointer instead of an iterator.

Change-Id: I2ad137be91ea969ccb310333dffa8d98e5825f8f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-06-26 15:46:04 +02:00
Simon Hausmann b24bf4fc0c Fix build with MingW
We can use the same win32 functions here to get the stack base address.

Change-Id: I7f26434b2c479772eaee94b8a9f7e1eba7f0721f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-06-26 15:46:01 +02:00
Simon Hausmann 62f6c0dc84 Fix crash in qqmlecmascript::sequenceSort with MSVC in debug builds
ArrayPrototype.sort allows specifying a compare function implemented in JS,
which we "wrap" and then pass on to std::sort. std::sort with MSVC has
an assertion verifying that the less-than compare function provided is
perfectly consistent in its return values. We don't want JS to easily crash
the entire application and therefore resort to qSort().

Change-Id: Id2c758a7d2bee60f31a7a3971172bca9b3c69af6
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-06-26 15:45:59 +02:00
Simon Hausmann 500f3c2848 Fix crashes with MSVC on x86
When returning a struct like QV4::Value from a function, the compiler can
either place the return value into the stack by expecting the caller
to provide a hidden first argument (pointer to where to store the value)
or pass it in eax:edx. The choice of which approach to pick depends on
whether the type is known at function declaration time. In this case we
had a mismatch where qv4serialize.cpp had a function that returned a value
and it is implemented by calling another function that would return the value.
QV4::Value was forward-declared, and so when compiling the function, the
compiler would assume that the caller provided an invisible first argument
for return value storage. The caller (in qquickworkerscript.cpp) however
had fully visibility of QV4::Value at call time and therefore assumed that
the value is returned in eax:edx. This mismatch caused naturally all sorts
of funny crashes.

The approach chosen is to eliminate any forward declarations of QV4::Value
and instead include the definition where appropriate.

Change-Id: I33303d86964239d3be30d1096806c605cddb7bbc
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-06-26 15:45:55 +02:00
Simon Hausmann 972094c109 Disable the JIT on Windows/AMD64 as well as on iOS
Change-Id: I7402981caa2f73fd0712975e657488a4065f403f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-06-26 15:45:52 +02:00
Simon Hausmann 8df7aa9d15 Fix build with msvc2010 in 32-bit mode
It cannot map a function pointer that returns a structure that isn't known
at declaration time.

Done with Lars.

Change-Id: I02a241695a6f6a94883507eb2c4988852cc9b912
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-06-26 15:45:50 +02:00
Simon Hausmann eb0703eb0f Various build fixes for Windows:
* Fix processor #defines in stack trace generation code
* Fix return type of doEdgeSplitting. It doesn't actually return anything.
* Work around internal compiler error in the array construction in qquickworkerscript.cpp

Change-Id: I8fac4bc2e8ca7447f4eeff260d8502d70ff6faf6
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-06-26 15:45:46 +02:00
Simon Hausmann 2444fce505 Prospective CI system build fix for Ubuntu 10.04's gcc
Change-Id: I4293c3a75e6a98cafd8f41a68012102628416610
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-06-26 15:45:44 +02:00
Simon Hausmann 55a34924dc Fix compilation with namespaced Qt
This also moves the extern "C" symbols back into the QV4 namespace

Change-Id: Id6d137df8610010588554bf0660228b357477823
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-06-26 15:45:39 +02:00
Jerome Pasion 02bf3ca59e Doc: Setting navigation variables for Qt Quick Dialogs
-for the navigation bar

Change-Id: I0971406e531e515b6afebacc0fe847c51f175d3b
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
Reviewed-by: Martin Smith <martin.smith@digia.com>
2013-06-26 12:31:39 +02:00
Shawn Rutledge 98a0fa0149 photosurface: add C++ boilerplate launcher; open button
Creator refuses to build it for Android otherwise, and this is a good
demo for tablets.  Also added a button to re-open the FileDialog.

Task-number: QTBUG-31898
Change-Id: I9f90de316fcaa2679484f8a875737ffafa774f31
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
2013-06-26 12:06:29 +02:00
Shawn Rutledge 4e2153a1d5 Declarative dialog improvements for the non-Window use case
Platforms like Android and EGL don't support multiple top-level
windows, so we have to avoid trying to use widget-based dialogs
(because a widget dialog on top of a scene graph will result in a
second window), allow the QML dialog to be an Item, and decorate it
to look like a window.

Task-number: QTBUG-31898
Change-Id: I9af049f3265188e8be677a05a8bc6d1699b4cd00
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2013-06-26 12:06:20 +02:00
Frederik Gladhorn a50c8a2573 Merge "Merge remote-tracking branch 'origin/release' into stable" into refs/staging/stable 2013-06-26 01:02:37 +02:00
Frederik Gladhorn c0f6bdd395 Merge remote-tracking branch 'origin/release' into stable
Change-Id: I6e060496b8c252fb4e2d5d2d40ae16bf950e2ec4
2013-06-25 23:26:56 +02:00