aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/memory
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.9' into 5.105.10Liang Qi2018-02-071-0/+15
|\ | | | | | | Change-Id: I3b250545e334f50dcef1a75acdef51820d34079a
| * Add back the optional heaptrack trace pointsAndras Mantia2018-02-061-0/+15
| | | | | | | | | | | | | | | | | | | | | | This approach tracks object allocations only, when slots from already allocated memory segment are used. Change-Id: I514b974d7580c1236264bec96dc1abe594585e86 Reviewed-by: Milian Wolff <milian.wolff@kdab.com> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2018-01-242-103/+73
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/qml/compiler/qv4codegen.cpp src/qml/compiler/qv4compileddata_p.h src/qml/debugger/qqmlprofiler_p.h src/qml/jsruntime/qv4engine.cpp src/qml/memory/qv4mm.cpp src/qml/qml/qqmlcomponent.cpp src/qml/qml/qqmlobjectcreator.cpp src/qml/qml/qqmlobjectcreator_p.h src/qml/types/qqmldelegatemodel.cpp src/quick/items/qquickitem_p.h src/quick/items/qquickwindow.cpp tests/auto/quick/touchmouse/BLACKLIST tests/benchmarks/qml/holistic/tst_holistic.cpp Change-Id: I520f349ab4b048dd337d9647113564fc257865c2
| * Add logging categories for GC statisticsLars Knoll2017-12-112-99/+70
| | | | | | | | | | | | | | | | | | | | | | And use them to dump some useful information. This replaces the old QV4_MM_STATS environment variable and introduces the qt.qml.gc.statistics (for some stats at app exit) and qt.qml.gc.allocatorStats (for stats on each GC run) logging categories. Change-Id: I0a16b25b8663aa7dbfe2adae299d3d990e8e5554 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2018-01-043-17/+36
|\| | | | | | | | | | | | | | | | | | | | | | | 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-233-13/+28
| | | | | | | | | | | | Task-number: QTBUG-64674 Change-Id: I48ed1a51f66ef8d55cc026f140d270baaca04fbf Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Prospective build fix for Integrity OSSimon Hausmann2017-06-201-7/+7
| | | | | | | | | | | | | | | | | | | | If ExecutionEngine is forward declared and the compiler tries to instantiate the Value/Array/etc. templates early on, it may not be able to map ExecutionEngine to EngineBase. That is what the error message suggests. Since we don't need ExecutionEngine let's try EngineBase. Change-Id: Idd18dd431705cce8df79180e7ac08574bbe1170c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-06-065-66/+75
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Get rid of the MemoryManager pointer inside StringLars Knoll2017-05-191-1/+1
| | | | | | | | | | | | | | We can always get the pointer through the internalClass. Change-Id: If68432845e7c67da70d9e19aef1a90ebe1e6056b Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
| * Move the engine() accessor from Object to ManagedLars Knoll2017-05-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | We can easily do this now that Managed has a pointer to an internal class (which always has a back pointer to the ExecutionEngine). Remove the extra engine pointer from ExecutionContext, and clean up tow methods in String. Change-Id: I98d750b1afbdeadf42e66ae0c92c48db1a7adc31 Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
| * Move the prototype into the internal classLars Knoll2017-05-191-7/+12
| | | | | | | | | | | | | | | | | | | | This saves another pointer on all Objects. Currently introduces a slight performance regression on some of the v8 benchmarks, that needs addressing. Change-Id: I87de8e1d198d2683f4e903c467ce2a60ba542243 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Move the internalClass field from Heap::Object to Heap::BaseLars Knoll2017-05-193-10/+20
| | | | | | | | | | | | | | | | | | | | | | | | And do not store the vtable in Heap::Base anymore. This change makes the internal class the main distinguishing feature of all garbage collected objects. It also saves one pointer on all Objects. No measurable impact on runtime performance. Change-Id: I040a28b7581b993f1886b5219e279173dfa567e8 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Move the EngineBase class into it's own header fileLars Knoll2017-05-191-35/+0
| | | | | | | | | | Change-Id: Idf87618e4ebff99f3b3c269c950191d67a0182b2 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Move a few more members from ExecutionEngine to EngineBaseLars Knoll2017-05-191-0/+8
| | | | | | | | | | Change-Id: I5d1e0d2251e04cc871f9c298849aafac17f23fbf Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Free up completely empty Chunks, and return the memory to the OSLars Knoll2017-05-192-9/+27
| | | | | | | | | | | | | | | | 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 <simon.hausmann@qt.io>
| * Re-add some inline property storageLars Knoll2017-05-083-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It turns out that not using any inline property storage comes at a relatively high price in terms of memory consumption, as we always need to also create a memberData for any object. This avoids the memberData creation in quite a few cases, as we use the additional padding we have up to the 32 byte boundary given by the memory manager to store some property data. This complicates property access somewhat. To avoid performance regressions because of this, add specialized QV4::Lookup functions that optimize for properties that are inline or in the memberData struct. Change seems to be performance neutral on v8-bench on x86_64, but reduces peak memory usage when running the benchmark by around 20%. Change-Id: I0127d31a2d6038aaa540c4c4a1156f45ca3b7464 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* | Correctly set the black bit for stack allocated contextsLars Knoll2017-05-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | Set the bit if Qt is configured with -force-asserts, so that the asserts won't trigger wrongly. Task-number: QTBUG-60487 Change-Id: Id256748c74d38ba897c38f448a814a240d978694 Reviewed-by: Robin Burchell <robin.burchell@crimson.no> Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLars Knoll2017-05-021-2/+32
|\| | | | | | | Change-Id: I71275a2076c3d32ee2896571be882067320a2e9e
| * Fix memory leak in the memory managerLars Knoll2017-04-281-2/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was a bug in Chunk::sweep() that would lead to parts of the memory not being freed as it should have been. This happened when an object 'overflowed' into the next index of the estendBitmap, where we then would not correctly clear the extends bits. Fixes performance degradation in qmlbench's delegates_item_empty_jscreation.qml over multiple runs. Change-Id: Ia2cecd2ff218e4258a067a74631b5479589b7a7e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* | Merge remote-tracking branch 'origin/5.9' into devLars Knoll2017-04-221-0/+7
|\| | | | | | | Change-Id: I95266fdaf5c6dc65969bd2e28403da7969367d32
| * Fix GC corruption on macOS and possibly some other OSesLars Knoll2017-04-211-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Marking mmap'ed memory as unneeded, leads to it being zeroed out on both Linux and Windows. Unfortunately that behavior is not defined by POSIX, so BSD based OSes (and possible others as well) do not do this. We do however rely on getting zeroed out memory whenever we allocate a new Chunk for the garbage collector. To work around this, zero out memory we deallocate on those platforms. Task-number: QTBUG-59278 Task-number: QTBUG-59977 Change-Id: Idde812db8537b63b9e9df7de41620ce0df09b6de Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* | MM: Provide information about object types on sweepRobin Burchell2017-04-203-20/+59
| | | | | | | | | | | | | | | | | | | | | | 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 <simon.hausmann@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Cleanups: Remove Steele barrier codeLars Knoll2017-04-073-95/+8
| | | | | | | | | | | | | | | | | | | | | | Remove the code related to the Steele write barrier and incremental garbage collection. This is in preparation for a fully concurrent GC, that will not have and incremental mode and will use a Yuasa write barrier. Change-Id: I155a85211c5be61e792e056321fbceaee47c0d87 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Separate the stack used for GC from the regular JS stackLars Knoll2017-04-074-48/+79
| | | | | | | | | | | | | | | | This is required to be able to implement concurrent or incremental garbage collection. Change-Id: Ib3c5eee3779ca2ee08a57cd3961dbcb0537bbb54 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | CleanupsLars Knoll2017-04-072-58/+67
| | | | | | | | | | | | | | | | | | | | | | * Only call ExecutionEngine::markObjects() on a full GC, it doesn't do anything in the incrementall case anyway. * Move the marking of child objects into it's own method for clarity * Move collection of gray items down to happen directly before we drain the mark stack Change-Id: I41067e17d483067bd1c4d60da22c5628482dae78 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Avoid stack overflows during GC runsLars Knoll2017-04-071-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | When marking very large objects, the old code could overflow the GC stack, as it would push all it's children onto the GC stack. Be more careful about this and drain the mark stack from time to time if required. Change-Id: If11ca521f405ce63b894d4e43a83b68d33a844af Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Don't use incremental GC for nowLars Knoll2017-03-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | Revert back to not using the incremental garbage collector for now, as it apparently doesn't play well with weak values. This should fix the crashes seen in Qt Quick Controls 2 in CI Task-number: QTBUG-59600 Change-Id: I8e35e761d5d6e9022e1d183883cb5a9cb39b4975 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | 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>