| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
(cherry picked from commit c99abf1851bbbfcec11eb77173df620746940ab0)
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
Task-number: QTBUG-64674
Change-Id: I48ed1a51f66ef8d55cc026f140d270baaca04fbf
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
| |
We can always get the pointer through the internalClass.
Change-Id: If68432845e7c67da70d9e19aef1a90ebe1e6056b
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
| |
Change-Id: Idf87618e4ebff99f3b3c269c950191d67a0182b2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
| |
Change-Id: I5d1e0d2251e04cc871f9c298849aafac17f23fbf
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|\ |
|
| |\
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| | |
| | |
| | |
| | |
| | |
| | | |
Change-Id: I5b63697c0607f4300b7f203eeac74914f3fb43af
Reviewed-by: Holger Freyther <holger+qt@freyther.de>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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>
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| | |
Change-Id: I8fa64fc8d67b6093eb368866d17d967644514577
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| | |
And avoid zero initializing stuff that's already 0
Change-Id: If90a808815b2b735bab661d22cbd498acc96b029
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Inline the few remaining members into the MemoryManager
class itself.
Change-Id: If5fef74581daa89df3e8cc237329c27395ce2289
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| | |
Use a new Chunk based allocator for very large items.
Change-Id: Ie61a72efb6340cd9ef54e4fdd957d7ca36c8729f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| | |
Change-Id: I7c054cda95d016ce8bb0b341730378afc15a3522
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| | |
Change-Id: I13612d055b50331afa5eb9a9b61f4fd2d29b90bd
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
|/
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
| |
Change-Id: Ib044be254dbb41bd9fb4a6e0baa3bd3c007e6a2a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|\
| |
| |
| | |
Change-Id: I175b27337b534c0b8f46a4a792d2c43cde73ffc4
|
| |
| |
| |
| |
| |
| |
| |
| | |
These two were mixed, but have completely different values.
Task-number: QTBUG-56471
Change-Id: Ifbf6da3032335ea89bfbc3acde17f64a571b9dc0
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| |\|
| | |
| | |
| | | |
Change-Id: I081d9b15796b4133d2ba6f1a862f15b873a4846d
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Getting the current time from QTime is expensive as it adheres
to the locale timezone. To measure elapsed time in a code block,
using the monotonic QElapsedTimer is much faster.
Change-Id: Ibea390d7bc5270a20cf35111dfc919e37be7001e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This allows for a compiler to do dead-store elimination for zero-
initialized memory that gets overwritten directly after the allocated
chunk is returned.
Change-Id: I6493aae8fdabc2306e7cfa1233f917b1775c4451
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Check that the destroy() method of Heap::Base was called when a Managed
object needs destruction. This checks if a call to the parent's
destroy() method was accidentally omitted.
Change-Id: Id025ecd6d4744bf3eab23503fbe317ed2a461138
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
GCC6 might dead-store-eliminate out our secret write to Base::mmdata,
because it expects all memory content to be "undefined" before
constructor calls. Clang might take the same approach if the constructor
of Heap::Object is removed.
By making these structs trivial, it also makes them memcpy-able.
Change-Id: I055b2ad28311b997fbe059849ebda4d5894eaa9b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | |
| | |
| | |
| | |
| | | |
Change-Id: Ia8eda67c9d59069d3a64363699720a79ba1348a1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This removes the destructors of subclasses of Base, making them nearly
trivial.
Change-Id: Ia6f7d467e87899b5ad37b8709a8f633a51689d59
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|