aboutsummaryrefslogtreecommitdiffstats
path: root/src/3rdparty/masm/stubs
Commit message (Collapse)AuthorAgeFilesLines
* JIT: When making memory writable, include the exception handlerUlf Hermann2020-12-181-3/+8
| | | | | | | | | | | | | makeWritable() rounds the memory down to the next page boundary. Usually we include the exception handler this way, unless the offset from the page boundary is less than the exception handler size. Make it explicit that we do want the exception handler to be writable, too. Fixes: QTBUG-89513 Change-Id: I2fb8fb0e1dcc3450b036924463dc1b40d2020c46 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 86a595b126bc6794380dc00af80ec4802f7d058c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix -Wdeprecated-copy warningsFabian Kosmale2020-05-281-1/+0
| | | | | | | | Mostly by avoiding custom functions when the compiler generated ones work just fine Change-Id: If8152fd24c9084bd85be3741fc218709e50fc375 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Remove use of wrapper macros for feature detectionTor Arne Vestbø2019-12-161-1/+1
| | | | | Change-Id: Ic9cd7e4ff2c5d253879b0aeaa15dbc25cad82891 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Upgrade Yarr to latest version from WebKitUlf Hermann2019-02-261-0/+9
| | | | | | | | | This is an upgrade to commit cbb0aa18662bc26da31de91e2104c030eaa6ead2 in webkit. It causes some more ecmascript tests to pass. Fixes: QTBUG-73915 Change-Id: I8bb5ff9b37907d17b1020576ba64f0b3aed2f1b3 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-12-121-1/+2
|\ | | | | | | | | | | | | Conflicts: tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp Change-Id: Ic1dace832ad4b29023d24808b8617b5dcc915eb5
| * Fix an ambiguity with gcc 4.9Ville Voutilainen2018-12-071-1/+2
| | | | | | | | | | | | | | | | | | | | The detection of make_unique seems brittle. Luckily, gcc 4.9 sets a feature-testing macro for it, so adding that to the conditional of masm's own make_unique avoids the problem. Change-Id: I43a988eba7bc0f0795a3d47c70b7a8d121a0ed2d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | V4: Generate function tables on 64bit windowsUlf Hermann2018-12-031-0/+1
|/ | | | | | | | | | | | | | In order for global exception handlers to be called reliably, the runtime needs to unwind through JIT-generated code. This can be facilitated by installing a "function table" for each JITed function that specifies "use the frame pointer". Also make sure to generate a function table for JIT'ed regular expressions. Those were forgotten also in the linux case. Fixes: QTBUG-50061 Change-Id: Ib0b8ae9356ed80afe1cab017e36efa4ccbe73f90 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.12.0' into 5.12Qt Forward Merge Bot2018-11-161-1/+2
|\ | | | | | | Change-Id: I7623438dde316ae1e97802f91991f2e7ccc205a5
| * Add a configure test for std::make_uniqueLars Knoll2018-11-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | Seems like this is the only reliable way to determine whether we have std::make_unique() or need to provide our own version. Change-Id: I5b162e0a2d2448d7bc519958c6e85a075812135a Fixes: QTBUG-71448 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | masm: Don't call fclose(nullptr) and initialize staticsUlf Hermann2018-11-141-1/+1
|/ | | | | | | Otherwise our disassembler crashes on QV4_SHOW_ASM. Change-Id: I63b20c0932452fe852773f91ebecaa7f31dd040d Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Fix compilation in C++11 modeLars Knoll2018-10-151-0/+11
| | | | | | | | std::make_unique() doesn't exist in C++11, so add a polyfill. Task-number: QTBUG-71010 Change-Id: I6f1f32447be6fb7411c66fa2c986df5bf4346ee2 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.11' into 5.12Liang Qi2018-10-011-2/+2
|\ | | | | | | | | | | | | Conflicts: src/quick/items/qquickevents_p_p.h Change-Id: I8c699aeb46903e2ea80a97a346cb5af460859a98
| * Fix Integrity OS allocator memory attributesJanne Koskinen2018-09-281-2/+2
| | | | | | | | | | | | | | | | | | Correctly set the attributes when allocation is extending to more than one page. Code spanning multiple pages can now be executed. Task-number: QTBUG-70350 Change-Id: I02af1add274f80befda5662d9670bfd2052c3c52 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | V4: Add JIT kind to disassemblyErik Verbruggen2018-08-301-3/+3
| | | | | | | | | | Change-Id: I6dd1cd6f795a93a186e84f5ab1c606f7e23fb85d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Update Yarr to the latest version from WebKitLars Knoll2018-08-1017-8/+598
|/ | | | | | | | | | | Updated Yarr to a to commit 4d2a53d60487cb1f8b2a9a1e9f684af336fd7d2c in WebKit. Adjusted the yarr code base to work with our older version of wtf and masm. Change-Id: I04b4593ece051e1d7aa087b87aa08c92595d1098 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Enable JIT on INTEGRITY ARM64Kimmo Ollila2018-04-261-0/+8
| | | | | | | | This patch enables JIT on INTEGRITY s820Am and other ARM64 builds Change-Id: I2fa130f41a6c5bc6aa86bcfd5a01c2d431300561 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Nikola Velinov <nvelinov@ghs.com>
* Fix symbol clash with QtScript when linking staticallyVladyslav Brovko2017-09-071-0/+5
| | | | | | Task-number: QTBUG-63050 Change-Id: I18c8cfae3cc4d8a6d2c82515541693b7b5194f76 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix crash when generating cache filesSimon Hausmann2017-02-081-1/+6
| | | | | | | | | Make sure that the allocator in bootstrap builds really just allocates memory for the generated code and otherwise doesn't try to allocate executable memory. Change-Id: Ic40724903706ae98ef272a028e7d8299400e232b Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Include the ARMv7 assembler in the qmldevtools bootstrap buildSimon Hausmann2017-02-011-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Even when the C++ target is not ARMv7 we want to include it in order to be able to generate QML cache files with code ahead of time. This requires a few changes: * The Jump classes need to move from the AbstractMacroAssembler super-class into the concrete assembler sub-class, in order to use it in specializations. * Some of the template specializations in LinkBuffer for example or for platform dependent operations need to be pre-processor enabled when bootstrapping * The generic loadPtr/addPtr etc. functions need to move to the concrete assemblers to be able to call the correct 32-bit or 64-bit variations. * We need to force what looks like a loss of precision to the compiler in the 32-bit ARMv7 linking code when linking jumps. Finally then we can explicitly instantiate at least QV4::JIT::Assembler for ARMv7 when bootstrapping. Currently only on x86-64 hosts, but that is a temporary limitation. Change-Id: I501db2360e1fded48f17f17d9e87252d47f8537e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Remove support for WinRT 8.1 and Windows Phone 8.1Maurice Kalinowski2017-01-191-11/+2
| | | | | | Task-number: QTBUG-57288 Change-Id: Id106f09dc824fbd95780dc5b479e16802d183e57 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.7' into devAndy Nichols2016-04-053-4/+7
|\ | | | | | | Change-Id: I57b06e2e98beb010a56dd0593d93e078ecf76eea
| * Remove dummy implementation for Pass*Ptr operator=().Rolland Dudemaine2016-04-042-4/+3
| | | | | | | | | | | | | | | | This resolves a lot of warnings when building with the GHS toolchain. Change-Id: I061dac0bf42f6a8158afe8eee9c898e8f7ee4dd7 Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
| * QNX: Fix compilationRafael Roquetto2016-03-091-0/+4
| | | | | | | | | | | | | | QNX only export library functions into the std namespace. Change-Id: Id5c479bb8b4540e26edabd6f50bc0f3f32e72432 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Remove Windows CE.Friedemann Kleint2016-03-101-53/+0
|/ | | | | | | | Remove #ifdef sections for Q_OS_WINCE and wince .pro file clauses. Task-number: QTBUG-51673 Change-Id: I33ab74f0c2ce9086c3610c5fa727f281197b6b55 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* Updated license headersJani Heikkinen2016-01-1921-294/+420
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: Ic36f1a0a1436fe6ac6eeca8c2375a79857e9cb12 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* V4: add Aarch64/ARM64 support.Erik Verbruggen2016-01-191-0/+7
| | | | | | | | | | This uses the JavaScriptCore assembler rev. 195098. It is tested on iOS (for which it is disabled, as it only allows marking pages as executable when running from Xcode). Testing on Linux will be done when hardware arrives. Change-Id: I650e15fec03c27d4b326a2d70863a89b85cfc5c3 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* WinRT: Enable JIT for x86/x64 target platformsMaurice Kalinowski2016-01-161-0/+5
| | | | | | | | | | | | | | | | | | | | | This only works for Windows 10 and later. Setting the "Code Generation" capability in the manifest, WinRT applications can use JIT for Windows 10 Desktop. Update the Allocator in regards to this and also update the VirtualProtectFromApp section. When the engine gets initialized, check for marking an area as executable. If it fails, fallback to interpreter mode. This does not affect ARM platforms, as we do not have calling conventions yet. It is implicitly disabled as V4_ENABLE_JIT is not defined. [ChangeLog][WinRT] Enable JIT for x86/x64 targets on Windows 10 and later. Change-Id: Ie05add5263f71387c5ce98456b9bec86c6c07ceb Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* V4 JIT: Switch all platforms to W^X for the ExecutableAllocator.Erik Verbruggen2016-01-151-22/+52
| | | | | | | | This also fixes makeWritable, which needs to work in order to add more c0d3 to used pages. Also finish the WinRT parts. Change-Id: Idaa4187b1ec256e65c881285a608f3a51fdbeebd Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* QML: Sanitize reading environment variables.Friedemann Kleint2015-10-221-1/+1
| | | | | | | | | | | Where possible, use qEnvironmentVariableIsSet()/ qEnvironmentVariableIsEmpty() instead of checking on the return value of qgetenv(). Where the value is required, add a check using one of qEnvironmentVariableIsSet()/Empty(). Change-Id: Ia8b7534e6f5165bd8a6b4e63ccc139c42dd03056 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* WinRT: fix warningsMaurice Kalinowski2015-05-191-0/+3
| | | | | | Change-Id: If11db499d743cbe79959145ecfcbcfec896a6845 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-1221-147/+147
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9 Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
* QML 3rdparty: revert unnecessary change.Erik Verbruggen2015-01-122-4/+4
| | | | | | | | It is the change to DataLog.h, which in turn forces the other changes in order to match types. Change-Id: Ie17e7efbd6a4d380a3b7383b0fd0243c6f68d0d5 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Update license headers and add new licensesJani Heikkinen2014-08-2521-399/+231
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* V4 JIT: enable disassembler on windows.Erik Verbruggen2014-03-032-2/+9
| | | | | Change-Id: I55a2a96a1a774c79cc2146c6b47d441fede1d102 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix build on WinRTAndrew Knight2013-11-061-0/+2
| | | | | | | | Disable JIT and avoid unsupported functions under WinRT. Also add MSVC's ARM flag to the double conversion white list. Change-Id: I22ec340a20b113fdeefb802ac61812f78a527895 Reviewed-by: Simon Hausmann <simon.hausmann@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>
* 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>
* 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-221-0/+55
| | | | | | | | | | | | | | | | | * 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>
* Fix module name (QtQml) in the license header under src/3rdpartySergio Ahumada2013-06-2620-40/+40
| | | | | | | | 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-261-18/+5
| | | | | | | | | | | | | | 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>
* 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>
* Suppress unused parameter warning.Erik Verbruggen2013-04-241-0/+2
| | | | | Change-Id: I1dcc3f2c5ee85f3c21035e5c93188c841c727727 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>
* Speed up regular expression matchingSimon Hausmann2013-04-163-6/+90
| | | | | | | | 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>