aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/memory/qv4mmdefs_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Memory manager: Ensure that internal class is set earlyFabian Kosmale2024-10-111-0/+1
| | | | | | | | | | | | | If the internal class is not set early enough, we will run into a crash if the object to hold the internal class ends up on the markstack, and the markstack gets drained. This can happen when the markstack runs out of space (reaches the softlimit), and does early draining. We force this condition in the test via a test-only function to manipulate the soft-limit. Pick-to: 6.8 Change-Id: I13598797811d697981ef7018c5aa87251331ab17 Reviewed-by: Ulf Hermann <[email protected]>
* Remove the use of Q_QML_PRIVATE_EXPORTAlexey Edelev2024-01-111-1/+1
| | | | | | Task-number: QTBUG-117983 Change-Id: I5790f01d614cd70c7fcc9bd817ec6ace3f3e3730 Reviewed-by: Ulf Hermann <[email protected]>
* Long live incremental garbage collection in QML!Fabian Kosmale2023-12-201-2/+15
| | | | | | | | | | | | | | | | | The design of the garbage collector is described in src/qml/memory/design.md. The gc and gcdone test helpers are adjusted to drive the gc to completion, even when in incremental mode. Parts of tst_qv4mm and tst_qqmlqt need to run with the incremental gc disabled, as they call gc inside QML and assumes that the GC finishes before returning. Initial-patch-by: Rafal Chomentowski <[email protected]> Task-number: QTBUG-119274 Change-Id: I1d94f41bc7a434fad67de0fd46454b6db285f2eb Reviewed-by: Ulf Hermann <[email protected]>
* MemoryManager: Remove grayBitmapUlf Hermann2023-01-271-8/+1
| | | | | | | | | We're not using gray items anywhere. There is no need to waste the memory for the bitmap. Change-Id: I26983cbc005531184ed955cea6026b9a8c5be910 Reviewed-by: Sami Shalayel <[email protected]> Reviewed-by: Fabian Kosmale <[email protected]>
* Avoid -Wshorten-64-to-32 warnings in a few placesFabian Kosmale2022-10-311-5/+5
| | | | | | | | | | ...by explictily casting to int. Add a few comments explaining why we can get at most INT_MAX many elements, and add Q_ASSERTS to check that the assumptions actually hold. Task-number: QTBUG-105055 Change-Id: I1769318a9c04b51efe45fe0cae9fc0d93cfec45e Reviewed-by: Ulf Hermann <[email protected]>
* Use SPDX license identifiersLucie Gérard2022-06-111-38/+2
| | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: I63563bbeb6f60f89d2c99660400dca7fab78a294 Reviewed-by: Shawn Rutledge <[email protected]>
* Cleanup some includesFabian Kosmale2021-03-171-1/+0
| | | | | | | Some were superfluous, others were missing. Change-Id: I6bf3057f97ab3453d735cb7b90da945b8f6b993c Reviewed-by: Ulf Hermann <[email protected]>
* Replace old Q_DECL statements with modern C++Allan Sandfeld Jensen2020-10-311-1/+1
| | | | | | | Since we depend on C++17 now, all of these can go. Change-Id: I0484fd4bb99e4367ec211c29146c316453729959 Reviewed-by: Volker Hilsheimer <[email protected]>
* V4: Fix mark stack overrunsUlf Hermann2020-02-271-11/+31
| | | | | | | | | | | | | | Instead of applying a heuristic on when to call drain() in unrelated code, we check the stack limit on each push(). If the soft limit is reached we try to drain. As drain() itself can push again, we try to limit the stack size by allowing at most 65 recursions of drain(). If none of that helps, we crash with a meaningful error message. This allows us to remove all the hacky drain() calls in other parts of the code. Change-Id: Ib979339470da0e85981de8131e7997755b757c71 Reviewed-by: Simon Hausmann <[email protected]>
* Fix ABI/API symbol taggingSimon Hausmann2018-03-121-14/+14
| | | | | | | | | | | | | | | The findclasslist.pl perl script that produces the linker version script got confused by the "struct name" that was part of a macro and thought that the class "name" in the *_p.h was supposed to be annotated with the private API tag, resulting in a "*4name*" mask in the linker script, which in turn made lots of public symbols "private" that had name in it, such as QQmlProperty::name(). Fixing the indentation works around it and conforms to coding style. Change-Id: I0c66a6bb1d49941d6ec6dd89d9433d9b6ae0c639 Done-with: Thiago Macieira <[email protected]> Task-number: QTBUG-67004 Reviewed-by: Thiago Macieira <[email protected]>
* use nullptr consistently (clang-tidy)Shawn Rutledge2018-02-261-3/+3
| | | | | | | | | | | | | From now on we prefer nullptr instead of 0 to clarify cases where we are assigning or testing a pointer rather than a numeric zero. Also, replaced cases where 0 was passed as Qt::KeyboardModifiers with Qt::NoModifier (clang-tidy replaced them with nullptr, which waas wrong, so it was just as well to make the tests more readable rather than to revert those lines). Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d Reviewed-by: Simon Hausmann <[email protected]>
* Remove duplicated declarationLars Knoll2018-01-261-1/+0
| | | | | Change-Id: I42332ea59fcb5479d49c24c2189d066af569d4fc Reviewed-by: Simon Hausmann <[email protected]>
* Merge remote-tracking branch 'origin/5.10' into devLiang Qi2018-01-091-0/+2
|\ | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/qml/memory/qv4mm.cpp src/qml/qml/qqmlbinding.cpp Change-Id: I98e51ef5af12691196da5772a07d3d53d213efcc
| * Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2018-01-041-0/+2
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/memory/qv4mm.cpp src/qml/memory/qv4mmdefs_p.h src/quick/items/qquickwindow.cpp src/quick/items/qquickwindow_p.h tests/auto/qml/debugger/qqmlprofilerservice/qqmlprofilerservice.pro tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp Change-Id: I7021fa1edf076627a67048f41f7b201220262b09
| | * Re-enable QML memory profilingUlf Hermann2017-11-231-2/+2
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-64674 Change-Id: I48ed1a51f66ef8d55cc026f140d270baaca04fbf Reviewed-by: Lars Knoll <[email protected]>
* | | Bring back markObjects(), this time generatedLars Knoll2017-11-141-34/+27
|/ / | | | | | | | | | | | | | | Doing the marking of objects in a function instead of using the table seems to be somewhat faster. Change-Id: I9ec00cc0264f9a15c69b285db493bee31d99bf96 Reviewed-by: Erik Verbruggen <[email protected]>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-06-061-31/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/qml/jsruntime/qv4argumentsobject.cpp src/qml/jsruntime/qv4arraydata.cpp src/qml/jsruntime/qv4context.cpp src/qml/jsruntime/qv4context_p.h src/qml/jsruntime/qv4errorobject.cpp src/qml/jsruntime/qv4functionobject.cpp src/qml/jsruntime/qv4internalclass.cpp src/qml/jsruntime/qv4lookup.cpp src/qml/jsruntime/qv4managed.cpp src/qml/jsruntime/qv4managed_p.h src/qml/jsruntime/qv4object.cpp src/qml/jsruntime/qv4object_p.h src/qml/jsruntime/qv4qmlcontext.cpp src/qml/jsruntime/qv4runtime.cpp src/qml/jsruntime/qv4vme_moth.cpp src/qml/memory/qv4heap_p.h src/qml/memory/qv4mm.cpp src/qml/memory/qv4mm_p.h src/qml/memory/qv4mmdefs_p.h src/quick/scenegraph/util/qsgdistancefieldutil.cpp src/quick/scenegraph/util/qsgdistancefieldutil_p.h tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp Change-Id: I7ed925d4f5d308f872a58ddf51fdce0c8494ec9c
| * Move the EngineBase class into it's own header fileLars Knoll2017-05-191-35/+0
| | | | | | | | | | Change-Id: Idf87618e4ebff99f3b3c269c950191d67a0182b2 Reviewed-by: Simon Hausmann <[email protected]>
| * Move a few more members from ExecutionEngine to EngineBaseLars Knoll2017-05-191-0/+8
| | | | | | | | | | Change-Id: I5d1e0d2251e04cc871f9c298849aafac17f23fbf Reviewed-by: Simon Hausmann <[email protected]>
| * Free up completely empty Chunks, and return the memory to the OSLars Knoll2017-05-191-1/+5
| | | | | | | | | | | | | | | | Detect any Chunk that's completely empty, deallocate it and return the memory to the OS (as far as that's supported). Change-Id: I6b6a77f2cdf478cbf16aad30a9cae37c98c6500e Reviewed-by: Simon Hausmann <[email protected]>
* | MM: Provide information about object types on sweepRobin Burchell2017-04-201-1/+3
| | | | | | | | | | | | | | | | | | | | | | Helps give an idea about what kind of garbage is being tossed away. v8-bench shows no real change in performance outside "usual" variance, I didn't benchmark QV4_MM_STATS=1 but I assume there will be some penalty there. Change-Id: Ida0c5917289891279d95fd47480bd4869b42b0e6 Reviewed-by: Simon Hausmann <[email protected]> Reviewed-by: Lars Knoll <[email protected]>
* | Separate the stack used for GC from the regular JS stackLars Knoll2017-04-071-1/+21
| | | | | | | | | | | | | | | | This is required to be able to implement concurrent or incremental garbage collection. Change-Id: Ib3c5eee3779ca2ee08a57cd3961dbcb0537bbb54 Reviewed-by: Simon Hausmann <[email protected]>
* | Merge remote-tracking branch 'origin/5.9' into HEADSimon Hausmann2017-03-231-0/+19
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp src/qml/jit/qv4assembler.cpp src/qml/jit/qv4assembler_p.h src/qml/jit/qv4isel_masm.cpp src/qml/jsruntime/qv4context.cpp src/qml/jsruntime/qv4context_p.h src/qml/jsruntime/qv4engine.cpp src/qml/jsruntime/qv4vme_moth.cpp src/qml/memory/qv4mmdefs_p.h Change-Id: I9966750b7cd9106b78e4c4779f12b95a481cca40
| * Complete transition to standard layout classes for JIT accessSimon Hausmann2017-03-211-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | Move the Runtime function pointer array into EngineBase so that we can eliminate the last use of qOffsetOf. For improved cache locality the memory manager point is now also located in the EngineBase. Change-Id: I0b3cf44c726aa4fb8db1206cc414a56c2f522a84 Task-number: QTBUG-58666 Reviewed-by: Lars Knoll <[email protected]>
| * Fix running of 32-bit JIT code generated on 64-bit hostsSimon Hausmann2017-03-171-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The offsets of members encoded in JIT generated code differ between 32-bit and 64-bit architectures. This patch moves some of the ExecutionEngine members into a separate standard-layout EngineBase class (in line with the same class in commit 2a554434a571dcefd26cf10ef8c5ae8b3b7d66db and subject to merging). By ensuring that the members are stored at pointer intervals, we can translate from host pointer size to target when generating the code. Task-number: QTBUG-58666 Change-Id: I1c38a7da059826848b80fd9972ed073214501386 Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Lars Knoll <[email protected]>
* | Optimize Base::mark()Lars Knoll2017-03-091-6/+13
| | | | | | | | | | Change-Id: I7f7b485274c870b39492eb9446d910d35f960124 Reviewed-by: Simon Hausmann <[email protected]>
* | Incremental garbage collectionLars Knoll2017-03-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Add an incremental mode to the garbage collector, that will get used for many collections. This should significantly reduce average stop times for GC. Make sure that manual calls to gc() still do a full collection, to ensure consistency and keep tests that rely on gc() working. Change-Id: I87b13529377b7639ce993dbd99e85ff0a555acd8 Reviewed-by: Simon Hausmann <[email protected]>
* | Implement a real write barrierLars Knoll2017-03-091-0/+11
| | | | | | | | | | | | | | | | | | | | Implement a Steel write barrier for our objects. The barrier is interesting as it can also be used for incremental GC runs by simply turning the barrier on and leaving old objects marked as black. Change-Id: I0b273974d94a990dee3cd9298089b8b202c75bf2 Reviewed-by: Simon Hausmann <[email protected]>
* | move locals over to be write barrier safeLars Knoll2017-03-091-4/+0
| | | | | | | | | | Change-Id: I56b1dab62ff432273ee8549b0496bd0f3fc655ea Reviewed-by: Simon Hausmann <[email protected]>
* | Go through proper set() functions when writing to MemberDataLars Knoll2017-03-091-2/+6
| | | | | | | | | | | | | | | | This is required, so we only have to add the write barrier in one place. Change-Id: I4e8bde823b30ad18f043312ac3f1ed46597b91a7 Reviewed-by: Simon Hausmann <[email protected]>
* | Make every member of a Heap object aware of its offset inside the objectLars Knoll2017-03-091-7/+41
| | | | | | | | | | | | | | | | This will allow adding a write barrier to those fields with manageable effort. Change-Id: I7d06d7ffccbcefe66e2524c64c962353c91c2766 Reviewed-by: Simon Hausmann <[email protected]>
* | Refactor how we define Heap objectsLars Knoll2017-03-091-21/+8
| | | | | | | | | | | | | | | | | | | | Declare the type of Heap object in the Member() macro, instead of deducing it from templates. This allows us to encode the offset of the member in the second template argument to Pointer<> in a second step. Change-Id: I2cfb73785749d3fb991689b4e0554a72b3e5e13f Reviewed-by: Simon Hausmann <[email protected]>
* | Unify mark handling for MemberData and ArrayDataLars Knoll2017-03-091-2/+0
| | | | | | | | | | | | | | | | Introduce a ValueArray class, that defines an array of Values at the end of a Heap Object. Change-Id: I00efbf6f5839a6687dd5bc5fc037ec8f06e0936e Reviewed-by: Simon Hausmann <[email protected]>
* | New mark table implementationLars Knoll2017-03-091-0/+48
|/ | | | | | | | | | | | | | | | | | | Automatically generate a table containing the data where JS Values and pointers are in objects in the JS heap. This will allow making the GC mark phase a lot more efficient. A bit of a special hack is currently required for MemberData and ArrayData, as they have a variable length, and we need to read the size from the object. We keep backwards compatibility with the old markObjects() functions for now (calling them if they are defined). Some further work on QV4::String and in a few other places is required before we can get remove the compatibility. Change-Id: I78528ace67e886bdbe4a4330c9677c7fc9f08a33 Reviewed-by: Simon Hausmann <[email protected]>
* New garbage collectorLars Knoll2017-01-251-1/+8
| | | | | | | | | | | | | This is a block based allocator. We allocate HeapItems from 64k Chunks (except for huge items that get their own chunk). The allocator is block based, and aims to defragment when sweep'ing the blocks. The mark bit is now stored in the Chunk header, not inline in the object anymore. Change-Id: I2845f8b73dd496911ba50b868d54d144501d41e4 Reviewed-by: Simon Hausmann <[email protected]>
* Add data structures that will get used for the new garbage collectorLars Knoll2017-01-251-0/+255
Chunk is a 64k block of memory and the basic structure used in the new GC. HeapItem is a pointer to a slot of unallocated memory. When allocating memory, a number of HeapItems will get converted to a the correct class derived from Heap::Base. Change-Id: Id7c606df2d32501702330fbb6fa68ec66f62d6f9 Reviewed-by: Simon Hausmann <[email protected]>