aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/memory
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge remote-tracking branch 'origin/5.9' into devSimon Hausmann2017-03-271-1/+1
|\| | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4functionobject_p.h Change-Id: I4bbed45f1fe02cf64df3c8a5f92f811e38e772f3
| * Merge "Merge remote-tracking branch 'origin/5.8' into 5.9" into refs/staging/5.9Simon Hausmann2017-03-251-1/+1
| |\
| | * Merge remote-tracking branch 'origin/5.8' into 5.9Simon Hausmann2017-03-151-1/+1
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qqmltypecompiler.cpp src/qml/compiler/qqmltypecompiler_p.h src/qml/qml/qqmltypeloader.cpp src/qml/qml/qqmltypeloader_p.h Change-Id: I4894555ab7a0879b56bbda7a46d16d1c40c19e7c
| | | * Fix accidental assignment in assertionSimon Hausmann2017-03-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I5b63697c0607f4300b7f203eeac74914f3fb43af Reviewed-by: Holger Freyther <holger+qt@freyther.de> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | | Fix possible loss of data warningJesus Fernandez2017-03-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data Amends merge resolution of 24d0266ee45cf6a3c5b9142453966199702fbf90. Change-Id: I55eca8d853bb957e5b4ea792036aaa0b2f122b38 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | | Merge remote-tracking branch 'origin/5.9' into HEADSimon Hausmann2017-03-234-3/+43
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | Fix handling of huge memory segmentsLars Knoll2017-03-221-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allocating a MemorySegment larger than 4M was not working correctly. We would in this case reserve the right amount of memory, but where not able to use it, leading to an assertion in the HugeItemAllocator. Fix this by ensuring we can properly allocate the memory that was reserved in the Segment. Change-Id: I1e3d2b3beebdde0a509fd123ad2aa8b1bc35a26b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * | | 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 <lars.knoll@qt.io>
| * | | Protect ExecutionContext member usage against word size differencesSimon Hausmann2017-03-171-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure the offsets we're taking from ExecutionContext members in the JIT code generator can be translated from host architecture sizes to target architecture, using assertions and a memory layout that we already have in the dev branch with commit 4de7e48ab160dacc7a09360e80264eac4945a8f4. Task-number: QTBUG-58666 Change-Id: I26cdbd1ddb995b116624fab16f7caba5d21c13b5 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * | | 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 <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Don't grow GC memory after an incremental GCLars Knoll2017-03-092-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | If the last GC was incremental, it would not clean up all garbage. Thus we should not look at the used memory after such a GC to determine whether we need to allocate additional memory. Change-Id: I57c33eeec63c16310920bc3dae074f4dcbb73d27 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Output mark/sweep times in micro secondsLars Knoll2017-03-091-4/+5
| | | | | | | | | | | | | | | Change-Id: Iaef7f23c9a58f8df761a35ed0fa681f8b404a4a6 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Optimize allocObjectWithMemberDataLars Knoll2017-03-091-19/+27
| | | | | | | | | | | | | | | | | | | | | Use only one call into the block allocator in the common case. Change-Id: Ic9be82f03ba66c1eff3e27407458343b6cd6d30c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Optimize Base::mark()Lars Knoll2017-03-091-6/+13
| | | | | | | | | | | | | | | Change-Id: I7f7b485274c870b39492eb9446d910d35f960124 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Better MM debuggingLars Knoll2017-03-092-24/+49
| | | | | | | | | | | | | | | | | | | | | | | | Add some more verbose debugging output when we're not using a release build. Change-Id: I4fec5991263e970899a4cc33f9551f4abb21f5ea Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Incremental garbage collectionLars Knoll2017-03-094-17/+162
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <simon.hausmann@qt.io>
* | | Implement a real write barrierLars Knoll2017-03-095-18/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <simon.hausmann@qt.io>
* | | Mark where we need a write barrier in the JITLars Knoll2017-03-091-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Separate the loadAddress calls into loadAddressForReading and loadAddressForWriting. In the second case, add an out argument that specifies whether the write will need a barrier. Pass the write barrier type that is required for a store down into the actual store methods. Change-Id: I3f7634ab82d82f1b20dab331e083d1a662cd314e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Add an actual write barrier and centralize it in one placeLars Knoll2017-03-093-21/+154
| | | | | | | | | | | | | | | | | | | | | | | | All stores into the Heap from C++ and Moth should now go through the write barrier. Change-Id: Iae9347754b90d68c10fade9f345842e86ec460cd Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | move locals over to be write barrier safeLars Knoll2017-03-092-5/+1
| | | | | | | | | | | | | | | Change-Id: I56b1dab62ff432273ee8549b0496bd0f3fc655ea Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | 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 <simon.hausmann@qt.io>
* | | Make all write operations to Pointer<> types go through a set() methodLars Knoll2017-03-093-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | The new set() method also taked an ExecutionEngine pointer. This makes it trivial to now add a write barrier for those operations. Change-Id: I321eccfe6fb279cc240b5c84910e6854f71759f6 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Make every member of a Heap object aware of its offset inside the objectLars Knoll2017-03-093-9/+45
| | | | | | | | | | | | | | | | | | | | | | | | This will allow adding a write barrier to those fields with manageable effort. Change-Id: I7d06d7ffccbcefe66e2524c64c962353c91c2766 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Refactor how we define Heap objectsLars Knoll2017-03-093-31/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <simon.hausmann@qt.io>
* | | Separate SimpleCallData and CallDataLars Knoll2017-03-091-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SimpleCallData doesn't need any loca variables, so move it into a separate CallData Heap object. This also allows getting rid of the manual markObjects() implementation for CallContext. Change-Id: I9014eb2f815d3e2fe63a951a9d126c38e8aaa0a3 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Unify mark handling for MemberData and ArrayDataLars Knoll2017-03-092-14/+5
| | | | | | | | | | | | | | | | | | | | | | | | Introduce a ValueArray class, that defines an array of Values at the end of a Heap Object. Change-Id: I00efbf6f5839a6687dd5bc5fc037ec8f06e0936e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | New mark table implementationLars Knoll2017-03-094-5/+102
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <simon.hausmann@qt.io>
* | Fix assert on QT_POINTER_SIZE != 8BogDan Vatra2017-02-151-1/+1
| | | | | | | | | | Change-Id: I8fa64fc8d67b6093eb368866d17d967644514577 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | QtQml/qv4mm.cpp: Fix type of debug helper lastAllocRequestedSlotsFriedemann Kleint2017-02-151-1/+1
| | | | | | | | | | | | | | | | | | | | Fix MSVC 64 developer build: memory\qv4mm.cpp(653): error C2220: warning treated as error - no 'object' file generated memory\qv4mm.cpp(653): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data memory\qv4mm.cpp(689): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data Change-Id: Ia8c28e960027877eb4d45f12db7406902e755c03 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Make better use of the remaining memory before calling GCLars Knoll2017-02-131-1/+19
| | | | | | | | | | | | | | | | | | | | Some slots still have free memory available. If we only need to allocate a small object, check if we can split up one of these slots before giving up and starting a GC cycle. Change-Id: I11fb9d53c607274dbb5fd0bc02088ed94bfe7c4e Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* | Fix a bug in Chunk::sortIntoBins()Lars Knoll2017-02-131-58/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bug lead to us not sorting all freed memory into the bins for the allocator to find. The lead to memory being 'lost' in the garbage collector. Add an assertion that checks for lost memory when we're running with aggressive GC. Also make sure we don't run GC twice in a row when aggressive GC is enabled. Change-Id: I4fb6732acce8a2e66258fa70fb7d8f1f939cfd9f Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* | Inline creation of simple call contextsLars Knoll2017-01-251-2/+9
| | | | | | | | | | | | | | And avoid zero initializing stuff that's already 0 Change-Id: If90a808815b2b735bab661d22cbd498acc96b029 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Get rid of the inline member data in ObjectLars Knoll2017-01-252-11/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead allocate a MemberData at the same time as the object if required. Turns out this is faster now, and significantly simplifies some of our internal logic to access member properties. In addition, we can properly setup the inline member size to use the full extent of the memory reserved by the memory manager. This avoid some needless reallocations of MemberData objects. Change-Id: I36daeeaf6df16f2268103662fc78d600b4058ef8 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Let allocData/allocString return 0 initialized memoryLars Knoll2017-01-252-4/+6
| | | | | | | | | | | | | | | | | | | | | | There's no point in having the memset inline. In theory, the compiler could optimize by combining this with later on inline initialization code, in practice this doesn't happen anyway, and we have some options of avoiding or combing the memsets in the allocator. Change-Id: I4502ef947ae235223726269821f9482ad62e1070 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Get rid of MemoryManager::DataLars Knoll2017-01-252-55/+30
| | | | | | | | | | | | | | | | Inline the few remaining members into the MemoryManager class itself. Change-Id: If5fef74581daa89df3e8cc237329c27395ce2289 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Cleanup Heap::BaseLars Knoll2017-01-251-21/+3
| | | | | | | | | | | | | | | | Since the markbit is not stored in line anymore, we can now simply store the pointer to the vtable in the object. Change-Id: I81b616c825dd4f3f2140838daab1f62bd6ecc812 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | New garbage collectorLars Knoll2017-01-254-261/+407
| | | | | | | | | | | | | | | | | | | | | | | | | | 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 <simon.hausmann@qt.io>
* | New allocator for huge itemsLars Knoll2017-01-252-54/+73
| | | | | | | | | | | | | | Use a new Chunk based allocator for very large items. Change-Id: Ie61a72efb6340cd9ef54e4fdd957d7ca36c8729f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Allocate simple call contexts from a special allocatorLars Knoll2017-01-252-0/+97
| | | | | | | | | | | | | | | | | | | | | | | | We used to allocate those on the C stack, but this doesn't work anymore with the new GC, as the mark bit is not stored inside the object anymore. Instead use a special allocator for these contexts that operates like a stack. Change-Id: I381ac3914ca866945312a1e79883aefe72662d2c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Implement an allocator for ChunksLars Knoll2017-01-252-2/+173
| | | | | | | | | | Change-Id: I7c054cda95d016ce8bb0b341730378afc15a3522 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Always allocate in 64k chunksLars Knoll2017-01-251-40/+1
| | | | | | | | | | | | | | | | Cleans up the code a bit in preparation of the new GC. Has minimal effect on performance these days. Change-Id: Ifa6afea9acf8b6f086412e7eab7fa37c5387c624 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Align allocations to multiples of Chunk::SlotSizeLars Knoll2017-01-251-1/+2
| | | | | | | | | | Change-Id: I13612d055b50331afa5eb9a9b61f4fd2d29b90bd Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Add data structures that will get used for the new garbage collectorLars Knoll2017-01-252-2/+257
| | | | | | | | | | | | | | | | | | | | 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 <simon.hausmann@qt.io>
* | Simplify handling of non GC managed heap dataLars Knoll2017-01-222-13/+4
|/ | | | | | | | | Let the destroy() method in QV4::String clean up the unmanaged heap size instead of having a special hook in the code that sweeps the GC heap. Change-Id: I989ee99604f0cc67b896d3acc94e200dd5e56a60 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Get rid of the GCBlockerLars Knoll2016-12-282-32/+0
| | | | | | | | | It's a hack we needed when we still had a conservative GC, but it is not required anymore. The only thing we still need is the protection against running the GC recursively. Change-Id: I55cd51d4929c828db5b61b38e781467c5bf77314 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Clean up duplicated checks whether a Value is a ManagedLars Knoll2016-11-291-11/+5
| | | | | Change-Id: Ib044be254dbb41bd9fb4a6e0baa3bd3c007e6a2a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.6' into 5.8Simon Hausmann2016-10-131-1/+1
|\ | | | | | | Change-Id: I175b27337b534c0b8f46a4a792d2c43cde73ffc4
| * V4: Fix usage of QV4::Value tags/typesErik Verbruggen2016-10-131-1/+1
| | | | | | | | | | | | | | | | These two were mixed, but have completely different values. Task-number: QTBUG-56471 Change-Id: Ifbf6da3032335ea89bfbc3acde17f64a571b9dc0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-10-101-5/+4
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/quick/quickwidgets/quickwidget/main.cpp src/qml/jsruntime/qv4jsonobject.cpp src/qml/jsruntime/qv4qobjectwrapper.cpp src/qml/jsruntime/qv4qobjectwrapper_p.h src/qml/qml/qqmlengine.cpp src/qml/qml/qqmlpropertycache.cpp src/qml/qml/qqmlpropertycache_p.h src/quick/items/qquickanimatedsprite.cpp src/quick/items/qquickitem.cpp src/quick/items/qquickitem.h src/quick/items/qquickitem_p.h src/quick/items/qquickview_p.h src/quick/scenegraph/qsgcontext.cpp src/quick/scenegraph/qsgdefaultrendercontext.cpp Change-Id: I172c6fbff97208f21ed4c8b6db3d1747a889f22b
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-10-051-5/+4
| |\| | | | | | | | | | Change-Id: I081d9b15796b4133d2ba6f1a862f15b873a4846d