Peter Varga [Wed, 10 Jul 2013 11:00:40 +0000 (13:00 +0200)]
Cleanup: Remove ExternalResource from QV4::Object
Change-Id: Ic512460009ad0f29670d7fae3bd4fe116b0b1c0f
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Simon Hausmann [Tue, 9 Jul 2013 11:42:09 +0000 (13:42 +0200)]
Fix rare crashes in release builds on Windows with exceptions
When throwing exceptions we have a tendency to save a backtrace, using
StackWalk64 on Windows. Before we can do that stack walk, we have to
capture the current processor register state, in particular the frame pointer,
for which we call RtlCaptureContext. Almost naturally that function requires
the caller to have set up a stack frame, which may not have happened when
compiling with release flags.
As a remedy, this patch moves the code that calls RtlCaptureContext into
a separate file, which will be compiled with frame pointer optimizations
disabled.
Change-Id: I3ce53b47c4a421efeaa3e575429d85327540ca97
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Simon Hausmann [Fri, 5 Jul 2013 08:37:15 +0000 (10:37 +0200)]
Fix JIT selection on Android with ARM builds
Debug builds on Android are done as ARM builds instead of thumb because of
problems with debugging thumb builds with older toolchains. However for the JIT
we're not interested in such a choice and prefer to have a consistent choice of
JIT - thumb2 generated code in release _and_ debug builds.
Change-Id: I36b1ec76311b409e36e3fb38c46c6c193adb1be8
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Fri, 5 Jul 2013 08:44:55 +0000 (10:44 +0200)]
Follow-up to previous commit about forcing thumb builds:
Disable the checks of the thumb bit in code pointers when building for Android,
because we want to allow for intermixing of thumb (what the JIT generates) and
arm code (what the compiler generates for run-time functions we call, in debug
builds)
Change-Id: I0bcce4015d18db4e38244a1d1ad89413b3f17152
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Lars Knoll [Fri, 5 Jul 2013 11:29:57 +0000 (13:29 +0200)]
Get rid of the first half of QQmlGuard usage
QQmlGuard was being used as a more performant replacement
for QPointer. QPointer got now fixed in Qt 5.0, making this
class obsolete.
Change-Id: I77eef066c4823af4b074ef32d4d78dbd67c36cd0
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Erik Verbruggen [Mon, 17 Jun 2013 10:37:01 +0000 (12:37 +0200)]
Introduce PhysicalRegister and StackSlot Temps.
Change-Id: I8d0b6a1e85fd0c42772f294fd13bc6041d41c81e
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Erik Verbruggen [Wed, 12 Jun 2013 11:30:28 +0000 (13:30 +0200)]
Rename V4IR::InstructionSelection to V4IR::IRDecoder.
Now it can be used by classes that want to walk the IR but do not
generate instructions, without causing confusion.
Change-Id: Idb220a1aee3ba2bbcd43bdeecd28946d567c9f3c
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Simon Hausmann [Thu, 4 Jul 2013 13:44:40 +0000 (15:44 +0200)]
Fix crashes in tst_qquickvisualdatamodel
Don't try to set the name string pointer of FunctionObject
to itself for these two FunctionObject subclasses.
Change-Id: I4e5a1963ffefd4ce96308022c251a4bdba54dc1e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Thu, 4 Jul 2013 11:45:16 +0000 (13:45 +0200)]
Fix failing GC related tests with gcc in release builds
Our conservative collector might is more likely to find old pointers
to QV4::Objects on the C stack in release builds, when gcc optimizes out
stores that seem unnecessary. These two tests are prone to that due to
temporary QV4::Values potentially ending up on the stack on x86,
because vmeProperty returns then through an invisible first argument that
is a pointer a a location on the stack.
This patch makes those temporaries explicit, clears them out after
usages and adds GCC pragmas to disable optimizations for these two
test functions.
Change-Id: Ie43841e869346792296911fee6fed80c745faeff
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Wed, 3 Jul 2013 14:44:55 +0000 (16:44 +0200)]
Fix regression in tst_qqmlecmascript::signalAssignment
Detect errors in the signal declaration already at compile time, re-introducing
the earlier code in qqmlcompiler.cpp that checked that. This also means that
the parameter string construction can be done once for each signal and not for
each handler.
Change-Id: Icf6242a793939466bbc44d43bf041281164ad1b6
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Erik Verbruggen [Tue, 11 Jun 2013 09:43:55 +0000 (11:43 +0200)]
Add lifetime interval calculation.
This is used in the interpreter to do stack-slot allocation.
Change-Id: I9f4df8fdca35889f4b1154dbbe7d68b579886e18
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
Erik Verbruggen [Wed, 3 Jul 2013 13:36:47 +0000 (15:36 +0200)]
JIT: support WIN64
Change-Id: Id657831231ddec66f7d41f32aaac22a71c4c1673
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Simon Hausmann [Wed, 3 Jul 2013 11:47:26 +0000 (13:47 +0200)]
Cleanup: Remove unnecessary use of ReturnValueRegister
Change-Id: Ic159fa8dcbce3d51db0b39d1cb22d01f9a94e15a
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Simon Hausmann [Mon, 1 Jul 2013 06:48:41 +0000 (08:48 +0200)]
Get rid of the signal expression rewriter
This replaces the entire rewriter with more or less:
expressionToEval = "(function(<named params here>) { " + expr + " } )"
This also fixes crashes at run-time when the signal rewriter was
executed from the loader thread and tried to use a v4 identifier
hash with the same engine that's also in the main thread.
Change-Id: Ib1e4927d330706a593411fbff64ed3da1e23d0e0
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Petr Nejedly [Thu, 27 Jun 2013 19:51:22 +0000 (12:51 -0700)]
QNX-specific implementation of the stack base retrieval.
The garbage collector needs the top of the stack.
On QNX, every thread has the TLS structure at the top
of the stack, then the stack extends below this TLS structure
This is the easiest and fastest way resolve the stack base
of the current thread.
Change-Id: I9cc9592928298d06aeaee0f6110d61bf3cf68e49
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Erik Verbruggen [Wed, 26 Jun 2013 10:31:06 +0000 (12:31 +0200)]
Fix warning from clang.
items/qquicktext.cpp:2160:49: warning: '&&' within '||' [-Wlogical-op-parentheses]
|| vAlign() != QQuickText::AlignTop && heightChanged) {
~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
items/qquicktext.cpp:2160:49: note: place parentheses around the '&&' expression to silence this warning
|| vAlign() != QQuickText::AlignTop && heightChanged) {
^
( )
Change-Id: Id4bc18642228e7fad6d674bbcdf623446bb6a00f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Erik Verbruggen [Tue, 2 Jul 2013 14:43:59 +0000 (16:43 +0200)]
Fix automatic semicolon insertion. Again.
After a do-token, no automatic semicolon can be inserted, because that
would result in an empty statement. The issue was that the correct state
was set when a do-token was found, but the state updating logic would
immediately reset it back, resulting in a semicolon insertion.
Change-Id: If867510dfaa182d0fe8b73a5bb1cab299c4faecc
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Simon Hausmann [Mon, 1 Jul 2013 06:20:15 +0000 (08:20 +0200)]
Replace us of v4 identifiers for object id mapping in qml compiler
The compiler is executed in a separate thread, at which point it doesn't work
very well to access the identifiers data structures of the engine on the main
thread, allocate new strings and potentially also trigger GC.
This patch moves the data into an intermediate QVector and constructs the
identifier hash on the receiving end in QQmlContextData::setIdPropertyData.
Change-Id: I676cf633cf1c55ee2e8f818e6963368ad55913cd
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Mon, 1 Jul 2013 03:49:26 +0000 (05:49 +0200)]
Fix qqmlecmascript::sequenceConversionThreads with aggressive GC
During the deserialization of a sequence, make sure that when the collector
runs during the filling of the array, that partially filled array is marked
properly.
Fixed setting of arrayDataLen in other similar places as well.
Change-Id: I19926f733c7c7d1398b11b48c1c37f43e7099ead
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Fri, 28 Jun 2013 21:59:23 +0000 (23:59 +0200)]
Fix incorrect automatic context memory management when using pushGlobalContext()
The automatic memory management of contexts relies on allocContext() returning
a new context that has its next member set to the previous head of the global
MM::m_contextList. Engine::pushGlobalContext() broke this chain by copying all
fields from *rootContext and thus "resetting" the entire context chain more or
less. That would mean a lot of contexts would suddenly just hang around (never
get collected and more importantly their marked bit not reset) and objects that
would only be kept alive by those contexts (such as QML context wrappers of
signal handler closures) would get erroneously collected.
This patch preserves the next field correctly in pushGlobalContext()
(which we for example use before instantiating qml singletons)
Change-Id: Id28d7112e1cba905d12b8fc7e3d94dab4eea2375
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Petr Nejedly [Wed, 26 Jun 2013 21:36:54 +0000 (14:36 -0700)]
Fix an obvious typo in the pool allocation sizing.
The pooled allocator in V4 preallocates the memory in a reasonably
sized chunks to limit the OS overhead of the allocations.
The chunks are supposed to be exponentially bigger, but the chunk sizes
should not depend on the size of the original allocation request.
Before the fix, the first allocation in every bucket basically
preallocated 64k slots of given size instead of 64k bytes, thus even
a trivial application ended up with 28MB of such heap.
After the fix, the same application is happy with <400kB
of this managed heap.
Change-Id: I1deae95bb6f45b8c67afe71d3a560b787357b31b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Simon Hausmann [Fri, 28 Jun 2013 10:13:06 +0000 (12:13 +0200)]
Fix crashes when GC triggers inside allocation inside initCallContext
initCallContext allocates new managed memory required for the implementation of
the arguments objects. During that allocation a GC may happen itself, and it
may happen in turn that objects the context "owns" don't get marked.
This patch makes sure that newly allocated contexts are included in the chain
of contexts to mark by setting engine->current and context->parent early on,
before init*Context() can do any allocations.
Fixes tst_qjsvalue with MM_AGGRESSIVE_GC=1
Change-Id: Iebd444631691b6d00da8cfd20a1f760a5e73ac56
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Fri, 28 Jun 2013 12:26:05 +0000 (14:26 +0200)]
Prospective MSVC build fix
Change-Id: Ifd739fb83893dbaada946754e9adb381320ffbb8
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Fri, 28 Jun 2013 11:24:44 +0000 (13:24 +0200)]
Fix IdentifierHash::findId()
Change-Id: Ie5e18b82ceeef85a4dc3e36345c5824f907bb122
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Fri, 28 Jun 2013 10:02:29 +0000 (12:02 +0200)]
Fix compilation with clang
Change-Id: I5884d8f10d9d864578376964e038fa8e477dbff2
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Fri, 28 Jun 2013 09:09:35 +0000 (11:09 +0200)]
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>
Lars Knoll [Fri, 28 Jun 2013 06:49:16 +0000 (08:49 +0200)]
Don't convert to a temporary QString just to compute it's hash
Change-Id: I45fbd4a6304dd2f771d75a47a2ddf162705887b5
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Fri, 28 Jun 2013 06:25:05 +0000 (08:25 +0200)]
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>
Lars Knoll [Thu, 27 Jun 2013 21:02:45 +0000 (23:02 +0200)]
Move the IdentifierTable into it's own file
This reduces compile time dependencies.
Change-Id: I7e68ec36022fb0b1dcc10be0cc345aa207ea110c
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Thu, 27 Jun 2013 20:43:47 +0000 (22:43 +0200)]
Convert QV8Engine::illegalNames() to use the identifier hash
Change-Id: I436c2a17e417cb311f10290a4cc6e5b728b4b7be
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Thu, 27 Jun 2013 17:57:46 +0000 (19:57 +0200)]
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>
Lars Knoll [Thu, 27 Jun 2013 14:47:06 +0000 (16:47 +0200)]
Get rid of QQmlIntegerCache
Replace by the new IdentifierIntHash.
Change-Id: Ib210cd898a30ad3e2f9349387e1a74d92ed5f831
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Thu, 27 Jun 2013 14:01:04 +0000 (16:01 +0200)]
Add a replacement for QQmlIntegerCache
Change-Id: Ie3e23e10644ce957a0029e83a43367a2339d5335
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Thu, 27 Jun 2013 07:04:11 +0000 (09:04 +0200)]
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>
Lars Knoll [Thu, 27 Jun 2013 06:57:47 +0000 (08:57 +0200)]
Rename IdentifierHash to IdentifierTable
Change-Id: Ifbf9e947c305e33def311b76a38af17dae90b46b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Wed, 26 Jun 2013 18:53:13 +0000 (20:53 +0200)]
Remove some unused code and forward declarations
Change-Id: I2ab2818159c60b199cae4f7573ea47b01a178e7b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Wed, 26 Jun 2013 13:03:11 +0000 (15:03 +0200)]
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>
Lars Knoll [Wed, 26 Jun 2013 07:43:45 +0000 (09:43 +0200)]
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>
Lars Knoll [Tue, 25 Jun 2013 20:15:08 +0000 (22:15 +0200)]
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>
Lars Knoll [Tue, 25 Jun 2013 20:02:11 +0000 (22:02 +0200)]
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>
Lars Knoll [Tue, 25 Jun 2013 19:53:06 +0000 (21:53 +0200)]
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>
Lars Knoll [Tue, 25 Jun 2013 19:22:47 +0000 (21:22 +0200)]
More correct assertion in QHasheV4String
Change-Id: Id34dcae9c7e52fe0262b4d9480a7307a393226ee
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Tue, 25 Jun 2013 18:28:53 +0000 (20:28 +0200)]
A frozen class is also sealed
Change-Id: Ib4c755cc702155a5cd0428901cf0b8256b76b50a
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Tue, 25 Jun 2013 13:19:27 +0000 (15:19 +0200)]
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>
Lars Knoll [Tue, 25 Jun 2013 09:00:31 +0000 (11:00 +0200)]
Some optimisations for QV4::Script
Change-Id: I468288a537a1a2fa4c38eb188c7b026a390fe13d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Mon, 24 Jun 2013 13:20:13 +0000 (15:20 +0200)]
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>
Simon Hausmann [Thu, 27 Jun 2013 12:04:08 +0000 (14:04 +0200)]
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>
Simon Hausmann [Thu, 27 Jun 2013 10:37:30 +0000 (12:37 +0200)]
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>
Simon Hausmann [Thu, 27 Jun 2013 10:19:50 +0000 (12:19 +0200)]
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>
Simon Hausmann [Thu, 27 Jun 2013 09:49:50 +0000 (11:49 +0200)]
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>
Petr Nejedly [Wed, 26 Jun 2013 21:52:09 +0000 (14:52 -0700)]
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>
Simon Hausmann [Tue, 25 Jun 2013 14:18:30 +0000 (16:18 +0200)]
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>
Sergio Ahumada [Mon, 24 Jun 2013 12:49:13 +0000 (14:49 +0200)]
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>
Simon Hausmann [Wed, 26 Jun 2013 11:33:53 +0000 (13:33 +0200)]
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>
Simon Hausmann [Wed, 26 Jun 2013 11:25:07 +0000 (13:25 +0200)]
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>
Simon Hausmann [Tue, 25 Jun 2013 13:48:26 +0000 (15:48 +0200)]
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>
Simon Hausmann [Wed, 26 Jun 2013 10:44:56 +0000 (12:44 +0200)]
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>
Simon Hausmann [Wed, 26 Jun 2013 10:41:21 +0000 (12:41 +0200)]
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>
Simon Hausmann [Tue, 25 Jun 2013 14:07:41 +0000 (16:07 +0200)]
Disable the JIT on Windows/AMD64 as well as on iOS
Change-Id: I7402981caa2f73fd0712975e657488a4065f403f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Tue, 25 Jun 2013 12:23:35 +0000 (14:23 +0200)]
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>
Simon Hausmann [Tue, 25 Jun 2013 09:17:34 +0000 (11:17 +0200)]
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>
Simon Hausmann [Mon, 24 Jun 2013 15:00:28 +0000 (17:00 +0200)]
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>
Simon Hausmann [Mon, 24 Jun 2013 13:28:00 +0000 (15:28 +0200)]
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>
Simon Hausmann [Mon, 24 Jun 2013 12:31:36 +0000 (14:31 +0200)]
Re-add qtjsbackend
This is not an actual dependency, but required to build with qt.pro in the
CI system. This can be reverted again when merging back to dev.
Change-Id: I48f038553754b971e0ce37587afe43dabf4e50cf
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
Sergio Ahumada [Mon, 24 Jun 2013 11:50:51 +0000 (13:50 +0200)]
Fix module name (QtQml) in the license header
Change-Id: Id78dfee1ac76a3b4d0976864353c4eb50e63c08b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Sergio Ahumada [Mon, 24 Jun 2013 11:45:32 +0000 (13:45 +0200)]
Fix missing license headers for test262.py
Change-Id: I805cf8951fb50518372aad0024fc287ee5955bbd
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Mon, 24 Jun 2013 11:39:58 +0000 (13:39 +0200)]
Remove a ### comment
This has been fixed in a different way already in
commit
19e4901e74fe29cdb11302873bd96641dd9b97da.
Change-Id: I7780b709e3fac3c724b94eeae92e814aae929e52
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Simon Hausmann [Mon, 24 Jun 2013 11:31:32 +0000 (13:31 +0200)]
Prospective fix for sync.profile for CI runs on the branch
Don't try to check out wip/v4 in qtbase and qtxmlpatterns
Change-Id: I1b4cb3f83ba62123414f184e141f52bbaac79827
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
Sergio Ahumada [Mon, 24 Jun 2013 10:07:48 +0000 (12:07 +0200)]
Fix some missing license headers
Change-Id: I758fe0a61d1ecb9418087ac318ac93f227013248
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Mon, 24 Jun 2013 09:26:22 +0000 (11:26 +0200)]
Merge branch 'dev' of ssh://codereview.qt-project.org/qt/qtdeclarative into wip/v4
Conflicts:
src/imports/qtquick2/plugins.qmltypes
src/qml/debugger/qv8debugservice.cpp
src/qml/qml/qml.pri
src/qml/qml/qqmlcompiler.cpp
src/qml/qml/qqmlcomponent.cpp
src/qml/qml/qqmlcontext.cpp
src/qml/qml/qqmldata_p.h
src/qml/qml/qqmlengine_p.h
src/qml/qml/qqmljavascriptexpression.cpp
src/qml/qml/qqmlxmlhttprequest.cpp
src/qml/qml/v4/qv4bindings.cpp
src/qml/qml/v4/qv4irbuilder.cpp
src/qml/qml/v4/qv4jsonobject_p.h
src/qml/qml/v8/qqmlbuiltinfunctions.cpp
src/qml/qml/v8/qv8bindings.cpp
src/qml/qml/v8/qv8contextwrapper.cpp
src/qml/qml/v8/qv8listwrapper.cpp
src/qml/qml/v8/qv8qobjectwrapper.cpp
src/qml/qml/v8/qv8qobjectwrapper_p.h
src/qml/qml/v8/qv8sequencewrapper_p_p.h
src/qml/qml/v8/qv8typewrapper.cpp
src/qml/qml/v8/qv8valuetypewrapper.cpp
src/qml/types/qqmldelegatemodel.cpp
src/quick/items/context2d/qquickcanvasitem.cpp
src/quick/items/context2d/qquickcontext2d.cpp
sync.profile
tests/auto/qml/qjsengine/tst_qjsengine.cpp
tests/benchmarks/qml/animation/animation.pro
tools/qmlprofiler/qmlprofiler.pro
Change-Id: I18a76b8a81d87523247fa03a44ca334b1a2360c9
Simon Hausmann [Mon, 24 Jun 2013 07:31:43 +0000 (09:31 +0200)]
Fix crash on ARMv7 when leaving functions
Don't clobber r6 (ScratchRegister) when adjusting the stack pointer for the
locals, as it is a callee-save register.
Change-Id: Ib14fca0cb0807e7b07d0210d102ae9cc57828741
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Fri, 21 Jun 2013 12:56:21 +0000 (14:56 +0200)]
Fix build on Android (part 2)
Don't include linux kernel headers from user space just for one constant :)
Change-Id: Ia760b3f0cccbdad49f3f2ce31598a109b63ac788
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Fri, 21 Jun 2013 12:12:02 +0000 (14:12 +0200)]
Fix build with traditional (non-thumb2) ARM
Pull in the BSD licensed SegmentedVector (that is based on Vector)
and use malloc/free instead of fastMalloc/fastFree in the constant pool.
Change-Id: I25aeb34a6f778f2c886a331851d8fc1dd0fc1d61
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Fri, 21 Jun 2013 12:05:56 +0000 (14:05 +0200)]
Fix build on Android
Don't include execinfo.h and use open_memstream on Android
Change-Id: I5b45dd4fc7f3b435b35e1951d6e722d4b52a6ea4
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Fri, 21 Jun 2013 06:58:02 +0000 (08:58 +0200)]
Prospective fix for JIT crashes on ARM
Don't do the ret(n) cleanup dance on ARM, as the address of where to
store the return value is provided in r0 and therefore there's nothing
to clean up.
Change-Id: I5b34355e52c9d374d31981361bdfb67193530d38
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Mon, 24 Jun 2013 07:57:15 +0000 (09:57 +0200)]
Mark automatic-semicolon insertion bugs as XFAIL
(but marked as needs-fix in trello)
Change-Id: I7cfebc9494dd0d5cb027b36f8c8cbcd02a520302
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Sun, 23 Jun 2013 18:11:21 +0000 (20:11 +0200)]
Fix tst_qjsengine::jsIncDecNonObjectProperty
With pre increment/decrement expressions, don't rely on the
target expr to be readable after the write to it. In case of
++someString.length for example the value of the property may not
change, but the result of the expression still has to be the
incremented value.
Change-Id: I2389eeee38dbed75aa2764638cb40950e32b8a68
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Sun, 23 Jun 2013 13:45:46 +0000 (15:45 +0200)]
Fix failing tst_qqmlecmascript::qtbug_22843:"with .pragma library"
Try to to load a .pragma library type of script only once, even if
it has a syntax error.
Change-Id: I32d7fb71647f413dc75e339e7bff8d74f7754c87
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Sun, 23 Jun 2013 13:08:13 +0000 (15:08 +0200)]
Fix tst_qqmlecmascripts::importScripts with private imports
* In QQmlContextWrapper::get we must check the calling context before
allowing the get, just like in the Getter() in qv8contextwrapper.cpp
* When trying to call a method on undefined/null, throw a readable error message,
as expected by the test.
Change-Id: Ie39e8ae82a108deef264e4044e12e7b15959caf9
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Sun, 23 Jun 2013 12:31:12 +0000 (14:31 +0200)]
Fix expected error messages in singleonType test
Writing to a property of a frozen object doesn't throw a type error
exception in non-strict mode.
Change-Id: I408078a2a09d16868b95f275f13f2f7a176f66e9
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Sun, 23 Jun 2013 11:35:17 +0000 (13:35 +0200)]
Fix a memory management issues with the name map in internal classes
The string pointer we store in the nameMap is not marked directly, i.e. our
class hierarchy doesn't have a recursive mark() function. So we must otherwise
make sure that that string is marked, otherwise we get dangling pointers that
are likely to point to _other_ strings later. This is hard to reproduce, but it
does happen with MM_AGGRESSIVE_GC=1 and the singletonType test in
qqmlecmascript, when due to the dangling pointer we end up using the wrong
property name in freeze() when iterating through the name map.
This patch fixes that by storing the actual identifier string, that's
guaranteed to get marked.
Change-Id: I28d1a2d2f56fe3abf692229ba008af8b0789189e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
J-P Nurmi [Tue, 18 Jun 2013 07:54:24 +0000 (09:54 +0200)]
Add missing null check to QQuickTextEdit::hoveredLink()
Change-Id: Ie0cb144bb5596f566584b8bb80e334983dd2b50e
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Lars Knoll [Sat, 22 Jun 2013 13:03:27 +0000 (15:03 +0200)]
Fixes to __qmljs_strict_equal
The implementation was broken if we had mixed int/double
values. In addition, this code should be slightly faster.
Change-Id: I5cf0c493902e33ed242c3ca7034fc369e840167f
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Sat, 22 Jun 2013 12:55:05 +0000 (14:55 +0200)]
Small cleanup
Change-Id: If46ef96f0ab64240b4811645f768844ad43ef48d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Sat, 22 Jun 2013 08:02:06 +0000 (10:02 +0200)]
Remove the context argument from Managed::call
Change-Id: I0895f9a94af47c8aab1dc93579921737e9516f7d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Sat, 22 Jun 2013 07:29:23 +0000 (09:29 +0200)]
Remove the context argument from Managed::construct
Change-Id: I39f5c23de787da70cd4259b3cdcd56391ee0dc7b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Fri, 21 Jun 2013 22:52:47 +0000 (00:52 +0200)]
Remove context argument from Object::get/putValue
Change-Id: I981b95e30b7761574ddd7891b5dfc24a0136af7f
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Fri, 21 Jun 2013 22:16:40 +0000 (00:16 +0200)]
Remove context argument from String::makeIdentifier()
Change-Id: I7c02301499cb1a6895e94beb40ec35c2094bb999
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Fri, 21 Jun 2013 22:09:24 +0000 (00:09 +0200)]
Remove context parameter from Manged::put.
Change-Id: Ib99e726ffbb20463d45a8444b4fbdfe32cd6dbef
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Fri, 21 Jun 2013 21:42:08 +0000 (23:42 +0200)]
Remove the context argument from Managed::putIndexed
Change-Id: If311140333a1c45be6c6d5464d43898e09eb4322
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Fri, 21 Jun 2013 21:26:11 +0000 (23:26 +0200)]
Remove context parameter from Managed::get()
Change-Id: I61837e4b17d7475dcda2f31b8a293c0020930d52
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Fri, 21 Jun 2013 20:55:13 +0000 (22:55 +0200)]
Remove context parameter from Managed::getIndexed
Change-Id: Ibc6271dbe789ef5ed063d8650ee36978f7c18021
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Fri, 21 Jun 2013 20:04:54 +0000 (22:04 +0200)]
Remove the execution context from most lookup calls.
Change-Id: I6f2bdfa233ebda1596a5a1d2b9d418cd45033d23
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Fri, 21 Jun 2013 19:48:06 +0000 (21:48 +0200)]
Remove the ExecutionContext parameter from Managed::get/setLookup
Change-Id: I9d3763b97438db83fef899917cbaee2f7cd59f96
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Fri, 21 Jun 2013 18:53:13 +0000 (20:53 +0200)]
Remove the context argument from Managed::hasInstance()
Change-Id: I33937a469c7ad1c6c9913068e7dc898a39d8bf49
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Lars Knoll [Fri, 21 Jun 2013 18:33:39 +0000 (20:33 +0200)]
Remove the context argument from Managed::delete(Indexed)Property
It's not required, as we can always get the current context from
the Managed object for the cases we need it.
Change-Id: I29fb9861a73ece1b3d5aa45f3bc350d8a5f76fa9
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Simon Hausmann [Fri, 21 Jun 2013 19:28:11 +0000 (21:28 +0200)]
Fix GC errors in small objects during construction
When creating small objects with for example only one accessor property,
then that is stored in the inline member allocation, which needs to
be initialized as well to prevent GCs during construction to access
uninitialized members.
Change-Id: Ie20d27a650e09475845f8ee6aa79b8e62a4bb795
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Fri, 21 Jun 2013 19:27:33 +0000 (21:27 +0200)]
Fix GC errors with Error object
Don't forget to properly mark the stack value we're keeping
Change-Id: Ifb002a5e8519e40cd1a4c7f7845171452a585562
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Fri, 21 Jun 2013 14:51:51 +0000 (16:51 +0200)]
Mark qqmlecmascript::hasOwnProperty as xfail
hasOwnProperty is not currently properly supported on dynamic objects that
re-implement get.
Change-Id: Ib6cfe13bbdbe4457adf05cd20e42d3a5e85ac318
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Simon Hausmann [Fri, 21 Jun 2013 14:15:09 +0000 (16:15 +0200)]
Fix qqmlmoduleplugin
Adjust the expected error message after commit
227f7ed60cfb34f7c3d91b27b07ddc5bbd1a2922
Change-Id: I328072dfb0151d6cd9b8452d8d3f9a306a132203
Reviewed-by: Lars Knoll <lars.knoll@digia.com>