aboutsummaryrefslogtreecommitdiffstats
path: root/src/3rdparty/masm
Commit message (Collapse)AuthorAgeFilesLines
* Fix MSVC2013 compilationYuchen Deng2013-10-211-0/+2
| | | | | | Change-Id: I79b50e786f46c9a15963f09158c18871c95fe093 Reviewed-by: Peter Kümmel <syntheticpp@gmx.net> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Disable WTF assertions in release buildsSimon Hausmann2013-10-171-0/+2
| | | | | | | Define NDEBUG to disable them. Change-Id: Ie1f08863b9b483216be2c0768b505f2e9e7ccef8 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix build on ARM in ARM mode (instead of thumb2)Simon Hausmann2013-10-173-27/+10
| | | | | | | | | | 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>
* Implement WTFReportAssertionFailureSimon Hausmann2013-10-171-1/+2
| | | | | | | At least do a printf with the failure details, to make debugging easier. Change-Id: I092d31e3408cd0a651c6dd96b5fd94adf4abe3a7 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix ASSERT_VALID_CODE_POINTER for our ARM buildsSimon Hausmann2013-10-171-4/+2
| | | | | | | | | | | 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>
* V4 ARM: extend disassembler.Erik Verbruggen2013-10-172-0/+77
| | | | | | | Added VADD/VSUB/VLDR/VSTR. Change-Id: I25fbb338652c3457e15cc9ef17209d35c63fefe5 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Speed up stack trace generation for the JITSimon Hausmann2013-10-162-0/+10
| | | | | | | | | | | | | | 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>
* V4 disasm: fix sub sp,sp,immErik Verbruggen2013-10-141-1/+1
| | | | | | | | 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>
* V4 ARM: fix disassembler vmovErik Verbruggen2013-10-121-1/+1
| | | | | | | rt is on position 12. See A8.8.345. Change-Id: Ibf380b9bda8d2edd603857935d6c92cd89d0f104 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Optimise code generation for convertTypeToSInt32Lars Knoll2013-10-113-2/+35
| | | | | | | | Add 64 bit code patch and avoid some duplicated calculation in 32 bit mode Change-Id: I0e111de8ac4e733aa8802c49b4b15d785688d7ea Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Add support for showing disassembled ARM JIT codeSimon Hausmann2013-10-106-3/+2775
| | | | | | | | | | Ported the ARM disassembler from upstream trunk. QtQml needs to be configured with qmake CONFIG+=disassembler and QV4_SHOW_ASM=1 enables the dump at run-time. Change-Id: Ia13a98835829fde0d3c5a795cb8f6ef9de951807 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* V4 JIT: implement convertUInt32ToDouble on ARMv7.Erik Verbruggen2013-10-032-0/+12
| | | | | Change-Id: I11caf07a8776bb2c6527639f22d47103f4ca1cef Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* V4: invert conditions when the true block follows the test.Erik Verbruggen2013-10-032-1/+2
| | | | | Change-Id: I5044acd4263b71734e4eb5d7e74b1a4a8414741e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* V4: changed environment variable SHOW_CODE.Erik Verbruggen2013-09-301-1/+1
| | | | | | | | | Use QV4_SHOW_ASM for the generated assembly from the JIT, and use QV4_SHOW_IR to get dumps of the IR. Change-Id: Id85d3d6c87b47088c312475a7c737d54c58c7791 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Allow delayed deallocation in the executable memory allocatorSimon Hausmann2013-09-201-1/+1
| | | | | | | | | Allow for allocations to outlive the allocator itself. When the allocator dies, it invalidates any remaining non-free allocations, making them safe to delete later. Change-Id: I6c71cddbbd5dcaff1ad50f3991a3c710d4f96737 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Android: Fix compilation when doing ARM buildsSimon Hausmann2013-09-181-3/+10
| | | | | | | | | | | Clean up the code to determine when to _disable_ the JIT and add Android to that list when targeting ARMv5 (dubbed armeabi as opposed to armeabi-v7a) Task-number: QTBUG-33507 Change-Id: Id78e08e888df8f8075d5655e15bb754cede70638 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Removed strange character from MacroAssemblerARM.cpp file.Tomasz Olszak2013-09-171-1/+1
| | | | | | | | | | It caused: error: stray ‘\302’ in program error: stray ‘\304’ in program when cross-compiling for ARM with gcc 4.5 Change-Id: Ibd80a21b436b65b355181b1e304ade22f9ff7404 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* V4 JIT: generate code for binary expressions.Erik Verbruggen2013-09-111-0/+6
| | | | | Change-Id: If32ee3528fa0b6a2d04263d6c6abe1d34053d658 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* wince: Build fix, assert() is not present in this platform.Sérgio Martins2013-08-291-2/+2
| | | | | Change-Id: Ib29f1411b9829bc9bf6a94e4fb23a33f955ee1b2 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* wince: Build fix, disable the assembler when JIT is disabled.Sérgio Martins2013-08-293-10/+13
| | | | | Change-Id: Ibd22f27401c3751bc64749c6f1eea3aba57d66eb Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Generate code conversion to double.Erik Verbruggen2013-08-281-6/+4
| | | | | | | | Performance improves by about 15% on fact.3.js when Qt is build in debug mode. Change-Id: I4a1c868fe211c1e0f9e7d9a5652f7726b37405d1 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* wince: vsnprintf is not available, use qvsnprintfSergio Martins2013-08-271-2/+3
| | | | | | | Change-Id: I42c87b2c319ce5b530ac5dc673edc99b067fafd7 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com> Reviewed-by: Björn Breitmeyer <bjoern.breitmeyer@kdab.com>
* Fix compilation with MSVC 2008 (and prospective Windows CE build fix)Simon Hausmann2013-08-222-1/+57
| | | | | | | | | | | | | | | | | * Only 2010 and newer ship stdint.h, so for 2008 we have to provide a little stdint.h compat header, for some of the third-party code we import. Our own Qt code this patch changes to use quint* types instead. * Include math.h and float.h for some math functions. * disable the JIT on Windows CE for now. * Change use of intptr_t to qintptr in Qt code. intptr_t is in inttypes.h, except that with VS 2008 it is indirectly available through stdio.h. Let's avoid the mess and just use the qt type, that's always available. Change-Id: I19055edd89e0a6b147d9edbb3b711798ed3c05a5 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change convertUInt32ToDouble to use an int scratch register.Erik Verbruggen2013-08-202-10/+12
| | | | | | | Only on X86, and still untested. Change-Id: I746daa47ed019ce0017a67a228a719983b1ebaa6 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Disable the udis86 disassembler by defaultLars Knoll2013-08-081-1/+1
| | | | | | | | | It's only required for debugging the JIT, and thus shouldn't be included in a regular build. Enable it with CONFIG+=disassembler Change-Id: I71264da0be00e8618f120ac9d3d06e6cb4b6dfae Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Added convertUInt32ToDouble for X86(_64)Erik Verbruggen2013-07-303-0/+28
| | | | | Change-Id: Ie6c918730d0ece0e9e63254ae97c257ee013f2f4 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Disable the JIT on Windows 64-bit again until the exception support is ↵Simon Hausmann2013-07-301-1/+1
| | | | | | | | | implemented Use the interpreter in the meantime, so that we get sensible test results in the CI system Change-Id: Ib8089836b705433cd15e037d4d2dd662648c941f Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix JIT selection on Android with ARM buildsSimon Hausmann2013-07-051-0/+6
| | | | | | | | | | 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>
* Follow-up to previous commit about forcing thumb builds:Simon Hausmann2013-07-052-2/+5
| | | | | | | | | | 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>
* JIT: support WIN64Erik Verbruggen2013-07-031-1/+1
| | | | | Change-Id: Id657831231ddec66f7d41f32aaac22a71c4c1673 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix another failing assertion with MSVC's STL in debug modeSimon Hausmann2013-06-271-1/+1
| | | | | | | 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>
* Fix module name (QtQml) in the license header under src/3rdpartySergio Ahumada2013-06-2622-44/+44
| | | | | | | | 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>
* Fix failing assertion with MSVC in debug builds in various testsSimon Hausmann2013-06-263-19/+8
| | | | | | | | | | | | | | 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>
* Disable the JIT on Windows/AMD64 as well as on iOSSimon Hausmann2013-06-261-3/+3
| | | | | Change-Id: I7402981caa2f73fd0712975e657488a4065f403f Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix build on Android (part 2)Simon Hausmann2013-06-241-1/+1
| | | | | | | Don't include linux kernel headers from user space just for one constant :) Change-Id: Ia760b3f0cccbdad49f3f2ce31598a109b63ac788 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix build with traditional (non-thumb2) ARMSimon Hausmann2013-06-242-4/+280
| | | | | | | | 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>
* Fix exception handling not working reliably on x86/x86-64 Linux (Part 2)Simon Hausmann2013-05-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The registration of the unwind tables is done through the interposition of the _Unwind_Find_FDE symbol from libgcc. Unfortunately that interposition breaks when libgcc happens to come first in the linker scope. As it turns out, the order is not for us to control, therefore the interposition may not always work and our JIT generated functions may not get their unwind information found at exception throwing time. That results in the program aborting with an uncaught exception. The proposed solution of replacing the interposition approach is two-fold: (1) Go back to calling __register_frame explicitly, but only for functions that exception _may_ pass through. In addition the performance of scalability of the objects registered with __register_frame is a known issue upstream, as the LLVM JIT also triggers the issue. It is being tracked at http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56460 (2) Instead of registering one FDE per function, we can theoretically register one FDE for _all_ JIT generate functions, because they all use the same stack layout that has exactly the same unwinding requirements from any function call site. Since we can't guarantee the presence of all JIT generated code within the same contiguous memory area, we can at least do it per executable memory allocation chunk (page size). One chunk can contain many functions. This patch implements part (2) by moving the per-function unwind info straight to into the executable memory chunk and registering the entire chunk (page) with libgcc. This also separates the regexp JIT executable memory from regular functions, because only for the memory of the latter we need to register unwind info. Change-Id: Ic4d1978686463c6d319436c9083e4d7cf0409829 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add flag to the engine to enable/disable RegExp JITting.Erik Verbruggen2013-05-081-0/+1
| | | | | Change-Id: I4b632e6f8ab7cf20576f94764ed506de8be63efb Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix build on WindowsSimon Hausmann2013-04-291-10/+0
| | | | | | | Move MSVC floating point math workarounds into qv4global.h to avoid inclusion of MathExtras.h from semi-public header files Change-Id: I8c5d672d05c42f653c8aa5c6f5d6e6ee0b3ec2e7 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Suppress unused parameter warning.Erik Verbruggen2013-04-241-0/+2
| | | | | Change-Id: I1dcc3f2c5ee85f3c21035e5c93188c841c727727 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Some build-fixes for pedantic compilers.Erik Verbruggen2013-04-191-0/+2
| | | | | | | | | | | | | Most of the change comes down to just one issue. If you write: extern "C" { void something(); } namespace Nowhere { extern "C" { void something() {} } } .. then any use of something might be considered ambigous by some compilers. This seems to be an edge-case that is not clear in the spec. Change-Id: I90e32539d6bd35b6ecca7816349f18d7573cbd2f Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Rename QQmlJS::VM namespace to QV4Lars Knoll2013-04-192-12/+6
| | | | | | | Simplifies writing code against it (less stuff to type). Change-Id: I8ac03ca2519375a204a3245e82c4be4cf1e793eb Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Use 'template' keyword to treat 'vector' as a dependent template nameTor Arne Vestbø2013-04-171-1/+1
| | | | | Change-Id: I736c0ef531eb302276dc763584da75e44579e643 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* iOS: Don't enable PROT_WRITE and PROT_EXEC at the same timeTor Arne Vestbø2013-04-171-2/+15
| | | | | | | | We define ENABLE_ASSEMBLER_WX_EXCLUSIVE, which we use to limit the page flags to either RW or RX. Change-Id: I253648ea98610438a533c7a7ccbf5c27c3b8230a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Don't use std::vector::shrink_to_fit(), it's C++11, and not enabled on iOSTor Arne Vestbø2013-04-171-1/+1
| | | | | Change-Id: I547df5bcf09837ebac9d64d66a4171ed87627b1a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix build on iOSTor Arne Vestbø2013-04-172-1/+6
| | | | | | | | | | | | Add missing include for sys_cache_control, and make sure we don't define PLATFORM(IOS) or PLATFORM(IOS_SIMULATOR), since we're PLATFORM(QT). Intentionally squashed both changes for easier rebasing against upstream. Change-Id: I2e010aec76d1f1863d177af8a70091cc88bbc999 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Speed up regular expression matchingSimon Hausmann2013-04-165-13/+94
| | | | | | | | Use the Yarr JIT back-end if possible. Speeds up the RegExp v8 benchmark by a factor of 3. Change-Id: I7c6c8086d1d07dcd13400e3cc8bbae408ea67198 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix compilation with built-in v4vm JS engineSimon Hausmann2013-04-151-1/+1
| | | | | Change-Id: Ieda9267e296acf6392a5461f4cfb9233a7a409a0 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix build of the rest of v4vm against WTF/JSC updateSimon Hausmann2013-04-122-1/+14
| | | | | | | | | * Add missing functions to our WTF stubs * Some of the math functions wrapped with MathExtras.h are back in the std:: namespace they belong to Change-Id: I9da43e8344ab8c95edc8db19f44ccdbd91b4ac70 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Apply modifications on top of WTF/JSCSimon Hausmann2013-04-124-16/+9
| | | | | | | | | * Extend FunctionPtr by another overloaded constructor that allows passing 6 arguments * Work around STL <> WTF incompatibilities with iterators * Remove unused printInternal functions that rely on CString/WTFString Change-Id: Ie0cc503288871cb594716e47e03dd509b1b5ac85 Reviewed-by: Lars Knoll <lars.knoll@digia.com>