aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/memory/qv4mm_p.h
Commit message (Collapse)AuthorAgeFilesLines
* QtQml: Provide an easy way to run non-incremental gcFabian Kosmale2024-03-191-1/+2
| | | | | | | | | | | We want the GC to run to completion on every invocation in that case. We want the same behviour for the gc() method in QML for compatibility reasons. Task-number: QTBUG-119911 Change-Id: I50b50ec9d3cdf7d5193d906dd687fb9f0fd557f6 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* qv4mm: Update non-managed memory limits at correct point in timeFabian Kosmale2024-03-051-10/+3
| | | | | | | | | | | | With the incremental gc, we might have not freed any memory at all after the gc call, as we might only be in the marking phase. Instead, update the limits when we know that we're done, after sweeping has completed. Additionally, move the assertion that the gc does not lose memory there, too, so that it also is called in all sweep calls. Change-Id: I444ff8817f39153f6f81bb6d21b6b87ae253a5f9 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qv4mm: Rework interaction between allocation and incremental gcFabian Kosmale2024-03-051-3/+1
| | | | | | | | | | | | We simplify the runGC logic as follows: - runGC is now only used to start the gc cycle. - MemoryMananger::onEventLoop now directly calls GCStateMachine::step instead of fiddling with gcBlocked and calling. - allocate calls runGC (as before) if no gc is ongoing; but due to the changes above it doesn't have to modify gcBlocked. Change-Id: If858b68416b1bca07a6193c66adaf150ff149720 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qv4mm: Handle running out of native heap memoryFabian Kosmale2024-03-051-3/+59
| | | | | | | | | | | | | | | | | With the current setup, we would have risked running out of native heap space if the incremental garbage collection takes too long. Remedy this by forcing the current gc run to complete immediately once we overshoot the limit by a factor of 3/2. We still need to respect that the gc must not run in a critical section: Handle this by rechecking the condition when leaving the critical section, and only forcing a gc run at that point if necessary. Note that we currently update the gc limits before the gc cycle finishes, so that the effective limit might actually not be 3/2 in that case. This will be remedied in an upcoming patch. Change-Id: I19c367bd1ff6ffc129293fc79e39b101f0728135 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qv4mm: Make sweep incremental, tooFabian Kosmale2024-03-051-1/+7
| | | | | | | | | | | | | | | This commit splits the sweep phase into multiple sub-phases. Note that this is safe, as we already are careful about running user code in sweep for Component.onDestruction callbacks; for JS objects, we don't execute arbitrary code in their finalizers, so that's also safe. The one thing we need to be cautious about is that we don't split the nulling of the weak values (mainly QObjectWrappers) from actually freeing the pending QObjectWrapper; otherwise the isUndefined/empty check could report a wrong result. Task-number: QTBUG-119274 Change-Id: I57210ac161c897d5946f7c000162d0a30701af19 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QV4 garbage collection: Allocate white during gc runFabian Kosmale2024-03-051-6/+0
| | | | | | | | | | | | | Now that we properly employ the WriteBarrier, we no longer need to use black allocations. This reduces the amount of floating garbage, and avoids potential bugs with heap classes like QV4::MemberData where we rely on it being marked so that its constituents don't have to be protected during initialization – which would fail when we it is already black, as it wouldn't be pushed on the MarkStack afterwards. Fixes: QTBUG-121910 Change-Id: Ie5e0f9461fa5c0e4a293da3d3c978da73743e417 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Prepare for white allocations during gc (9/9): ExecutableCompilationUnitFabian Kosmale2024-03-051-1/+3
| | | | | | | | | | | | | | | | | | | | | | | ExecutableCompilationUnits are meant to be part of the roots as far as the gc is concerned. However, they can be created at any point in time, notably also while the GC is running. This was safe so far because all allocations are black, and the compilation unit will only reference freshly allocated heap items. As we want to move away from that pattern, we have to change this: We could use the typical combination of QV4::Scope and usage of the WriteBarrier, however that would add overhead for a very uncommon case (except when using QV4_MM_AGGRESSIVE_GC). Instead, we temporarily block the garbage collection, reset the state of an ongoing garbage collection and at the end of the setup of the ExecutableCompilationUnit, we mark the ExecutableCompilationUnit if the GC was already running. Introduce a new blocked state (CriticalSection) to distinguish between the normal blocked state (gc is running) and the new state where we must not even run an incremental gc to completion until the section has finished. Task-number: QTBUG-121910 Change-Id: I1dba3cc8a4f8d2b741a1a5e84fdfe7736b08e166 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Long live incremental garbage collection in QML!Fabian Kosmale2023-12-201-2/+83
| | | | | | | | | | | | | | | | | 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 <rafal.chomentowski@ge.com> Task-number: QTBUG-119274 Change-Id: I1d94f41bc7a434fad67de0fd46454b6db285f2eb Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qv4mm: Document and extend allocManaged overload setFabian Kosmale2023-10-061-1/+30
| | | | | | | | | Add some helper overloads to centralize the sizeof computation. Add a doc note about the various variants of allocManaged, including a note why we even need the size parameter. Change-Id: I4e0c485217e87c339a7433c306cb05d6614d30e1 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* MemoryManager: Remove grayBitmapUlf Hermann2023-01-271-6/+0
| | | | | | | | | 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 <sami.shalayel@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* 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 <shawn.rutledge@qt.io>
* Upgrade std::is_trivial::value to C++17 std::is_trivial_vIvan Tkachenko2021-08-241-1/+1
| | | | | | | | | Since Qt 6 requires at least C++17, we can finally make use of some of its goodness. Change-Id: I56a318bc0b1b60d1e2b0186f335f8feda7622df4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* 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 <volker.hilsheimer@qt.io>
* MemoryManager: Forward arguments to init()Ulf Hermann2020-03-121-10/+10
| | | | | | | | | | The templating transforms references into their base types. Passing those through involves copying, and refcount ping-pong for QQmlRefPointers. Use forwarding references and std::forward to avoid this. Change-Id: I2524b53b9e06fadcc67a78c6ebf04f5bc2da354b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Trigger the garbage collector when allocating InternalClass objectsUlf Hermann2019-03-261-2/+42
| | | | | | | | | | | | | | | | | As we check the icAllocator's slots on shouldRunGC() we should also check shouldRunGC() when adding slots. Otherwise we might never run the GC when only allocating InternalClasses. In addition, account for the "unmanaged" size of the PropertyAttributes that are part of the InternalClass objects. Those can be large. In cases where an excessive number of large InternalClass objects is created the garbage collector is now invoked frequently, which costs a significant number of CPU cycles, but prevents the memory usage from growing indefinitely. Task-number: QTBUG-58559 Change-Id: Icf102cb6100f6dba212b8bffe1c178897880eda0 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add support for WeakSetLars Knoll2018-08-281-0/+2
| | | | | Change-Id: I5cee2bf0c6a45ad2c14b52e1a4fc5ef015e01042 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Implement support for WeakMapLars Knoll2018-08-281-0/+3
| | | | | Change-Id: Id23e80fe5918ba7dc897568123bf3db4d35e9092 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Make the statistics variables members of the memory managerLars Knoll2018-05-021-0/+3
| | | | | | | | Otherwise this will show wrong stuff when running multiple engines in different threads (and create noise in thread sanitizers) Change-Id: Ia90054f5a54ee2c43870c8d839f25b195b09698c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Remove some scopes in the memory managerLars Knoll2018-04-121-8/+6
| | | | | | | | | | These allocation functions only perform a single allocation. Since all live objects have to be reachable by the GC before calling into it, these scopes are not required. Change-Id: Ia7e89791d6ff2bfe87b7c5462191d28e04688df1 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* garbage collect InternalClassLars Knoll2018-04-121-15/+39
| | | | | | | | | | | | | | | | Internal classes are now allocated and collected through the GC. As they are important to the deletion of other objects (because of the vtable pointer living inside the internal class), they need to get destroyed after regular objects have been sweeped. Achieve this by using a separate block allocator for internal class objects. Our lookups do often contain pointers to internal classes, so those need to be marked as well, so we don't accidentally collect them. Change-Id: I4762b054361c70c31f79f920f669ea0e8551601f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Disambiguate different allocation functions in the memory managerLars Knoll2018-04-121-1/+1
| | | | | | | | | | | Some compilers (in this case MingW 5.3) don't manage to properly disambiguate the template overloads, and try to instantiate the wrong template function. Solve this by renaming the one of the template functions. Change-Id: I3574e617fe96c4bd52920a0127a1dfe39cc3d302 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Cleanup MM::allocObject()Lars Knoll2018-04-121-3/+1
| | | | | | | | The prototype argument has been unused for quite some time, finally remove it. Change-Id: Ifcebe413a1951ed972b370afc48640bd22969943 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Optimize MM::allocManaged()Lars Knoll2018-04-121-4/+1
| | | | | | | | We can manage without calls to changeVTable() here, as the set of classes allocated with this is rather limited. Change-Id: I804e4850b91c61ebbca8a04edbe51deac911928d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Simplify allocation functions in the memory managerLars Knoll2018-04-121-150/+16
| | | | | | | Reduce code duplication by using variadic templates. Change-Id: Ia12b67184f66190b433c99fb2157fca4e46cb2b6 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix issue with allocating huge objects in the memory managerLars Knoll2018-03-081-0/+2
| | | | | | | | | | | | | | We shouldn't allocate objects that are larger than the size of a standard memory segment through the chunk allocator, as this can lead to problems when freeing the segment and then re-using it again. Instead allocate a private MemorySegment for these objects, and free it when the object gets garbage collected. Task-number: QTBUG-66732 Change-Id: Ic24ff65d204977f313ab0adaf7a8132883e525f0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* use nullptr consistently (clang-tidy)Shawn Rutledge2018-02-261-6/+6
| | | | | | | | | | | | | 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 <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.10' into devLiang Qi2018-02-021-16/+9
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp src/qml/compiler/qqmlirbuilder.cpp src/qml/compiler/qqmlirbuilder_p.h src/qml/compiler/qqmltypecompiler.cpp src/qml/compiler/qv4codegen.cpp src/qml/compiler/qv4codegen_p.h src/qml/compiler/qv4compileddata_p.h src/qml/compiler/qv4compiler.cpp src/qml/compiler/qv4compilercontext_p.h src/qml/compiler/qv4isel_moth.cpp src/qml/compiler/qv4jsir.cpp src/qml/compiler/qv4jsir_p.h src/qml/jit/qv4isel_masm.cpp src/qml/jsruntime/qv4engine.cpp src/qml/jsruntime/qv4functionobject.cpp src/qml/jsruntime/qv4runtimecodegen.cpp src/qml/jsruntime/qv4script.cpp src/qml/jsruntime/qv4script_p.h src/qml/qml/qqmltypeloader.cpp src/quick/items/qquickanimatedimage.cpp src/quick/items/qquickanimatedimage_p_p.h src/quick/scenegraph/compressedtexture/qsgpkmhandler.cpp tests/auto/qml/qmlplugindump/qmlplugindump.pro tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp tools/qmlcachegen/qmlcachegen.cpp tools/qmljs/qmljs.cpp Done-with: Shawn Rutledge <shawn.rutledge@qt.io> Done-with: Lars Knoll <lars.knoll@qt.io> Done-with: Ulf Hermann <ulf.hermann@qt.io> Change-Id: I010e6525440a85f3b9a10bb9083f8e4352751b1d
| * Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2018-01-241-16/+9
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-111-16/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.10' into devLiang Qi2018-01-091-5/+7
|\| | | | | | | | | | | | | | | | | | | | | | | | | | 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-5/+7
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-4/+6
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-64674 Change-Id: I48ed1a51f66ef8d55cc026f140d270baaca04fbf Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Raise minimum supported MSVC version to 2015Friedemann Kleint2018-01-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove code for older versions and streamline #ifdefs. Remove the helpers macros Q_STATIC_ASSERT_FOR_SANE_COMPILERS and V4_ASSERT_IS_TRIVIAL. Task-number: QTBUG-40658 Task-number: QTBUG-51673 Change-Id: Ifa4fab653b10ce7858739adef08364cddc6507cf Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Remove stuff related to simple call contextsLars Knoll2017-08-101-59/+0
| | | | | | | | | | | | | | | | | | | | | Those are not being used anymore. Change-Id: Ia33dd7c3c7ea7828caef0fbf397253249580a4e1 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Unify QV4::Function::internalClass and the ic used in CallContextLars Knoll2017-08-031-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | Set the internal class of the V4 function on the CallContext, as that one is describing it's layout, and use it to lookup variables. Change-Id: I49d9b9afe1f504fbd059d6a350b7a4e62e2e505b Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* | | Unify SimpleCallContext and CallContextLars Knoll2017-07-051-2/+2
|/ / | | | | | | | | | | | | Plan is to completely remove the need for the simple call context. Change-Id: Ie5e4673a6746dc110adbf526e45188f218fd7bfc Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-06-061-18/+30
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-191-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Re-add some inline property storageLars Knoll2017-05-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | MM: Provide information about object types on sweepRobin Burchell2017-04-201-3/+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 <simon.hausmann@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Cleanups: Remove Steele barrier codeLars Knoll2017-04-071-2/+1
| | | | | | | | | | | | | | | | | | | | | | 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-071-5/+4
| | | | | | | | | | | | | | | | This is required to be able to implement concurrent or incremental garbage collection. Change-Id: Ib3c5eee3779ca2ee08a57cd3961dbcb0537bbb54 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Don't grow GC memory after an incremental GCLars Knoll2017-03-091-0/+1
| | | | | | | | | | | | | | | | | | 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>
* | Better MM debuggingLars Knoll2017-03-091-2/+2
| | | | | | | | | | | | | | | | 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-091-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | 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-091-6/+7
| | | | | | | | | | | | | | | | | | | | 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>