| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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]>
|
|
|
|
|
|
| |
Change-Id: Ibe5690673401c442bd3ba1f82aaaa5ef6fa3a2d3
Reviewed-by: Qt CI Bot <[email protected]>
Reviewed-by: Ulf Hermann <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The logic in our IdentifierHash assumes that every entry is a
StringOrSymbol; however, IdentifierTable::asProperyKey will convert keys
that look like numbers to ArrayIndex instead.
This is noramlly what we want, and not an issue, except for
setContextPropery where the user can pass an arbitrary string that is
not necessarily a valid identifier. In an ideal world, we would just
disallow such identifiers, but for backward compatibility change the
code to handle this case (avoiding a Qt internal assert).
We only need to modify the QString overloads, as those are the only ones
that interact with unsanitized user input.
A later commit will modify setContextPropery to warn if the key is
numeric.
Fixes: QTBUG-115319
Pick-to: 6.6 6.5 6.2 5.15
Change-Id: Ifc4e4d2bc99321836e6976c4cbd0c5ff687b430c
Reviewed-by: Ulf Hermann <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.
Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.
Task-number: QTBUG-99313
Change-Id: I601bf70f020f511019ed28731ba53b14b765dbf0
Reviewed-by: Shawn Rutledge <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a semantic patch using ClangTidyTransformator as in
qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8:
auto QtContainerClass = anyOf(
expr(hasType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes))))).bind(o),
expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o));
makeRule(cxxMemberCallExpr(on(QtContainerClass),
callee(cxxMethodDecl(hasAnyName({"count", "length"),
parameterCountIs(0))))),
changeTo(cat(access(o, cat("size"), "()"))),
cat("use 'size()' instead of 'count()/length()'"))
a.k.a qt-port-to-std-compatible-api with config Scope: 'Container',
with the extended set of container classes recognized.
Change-Id: Idb1f75dfe2323bd1d9e8b4d58d54f1b4b80c7ed7
Reviewed-by: Fabian Kosmale <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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]>
|
|
|
|
|
|
|
|
|
|
|
| |
We only have to create QV4::String if the entry doesn't exist, yet.
Also, make sure the identifier of a new QV4::String inserted for an
array index is actually populated.
Change-Id: I223d191905baea5e537f483a9b3aa3db26f891b2
Reviewed-by: Fabian Kosmale <[email protected]>
Reviewed-by: Andrei Golubev <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
| |
QV4::IdentifierHashData doesn't need to be visible to all the clients.
Furthermore, it can be completely inline. The public functions of
QV4::IdentifierHash need to be out of line, but the private ones can be
all inline. This shouldn't make much of a difference as most of the
public functions call at least one private function. Finally, the files
should be named by the class names.
Change-Id: I931f2aa71103e41fdd3dae9cc47d204edece0e12
Reviewed-by: Fabian Kosmale <[email protected]>
|
|
|
|
|
|
|
|
|
| |
Make it completely inline, move the (4 times duplicated) primeForNumBits
function into its own file, address some warnings, move
QHashedString::compare into qhashedstring.cpp.
Change-Id: I778bb3d3e176cfec45eda9be9d7e5982585e6474
Reviewed-by: Simon Hausmann <[email protected]>
|
|\
| |
| |
| |
| |
| |
| | |
Conflicts:
src/qml/qml/qqmlimport.cpp
Change-Id: I6add6267297ea50a646d43d212027a168dca8916
|
| |
| |
| |
| |
| | |
Change-Id: Ia42c0d732e0f6ccfa2c70b86edccd9eb471aac7c
Reviewed-by: Simon Hausmann <[email protected]>
|
|/
|
|
|
|
|
|
|
|
|
| |
Technically UINT_MAX is actually a valid array index, although that is
an academic problem right now. However, we do have a method
isArrayIndex() and should just use that to determine if a PropertyKey is
an array index.
Fixes: QTBUG-73893
Change-Id: I302e7894331ed2ab4717f7d8d6cc7d8974dabb4e
Reviewed-by: Erik Verbruggen <[email protected]>
|
|
|
|
|
| |
Change-Id: I634f30ceb520af440c668e597a82b09b3c0024c9
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Sweeping the table in place is extremely tricky due to possible
holes and possible interleaving of identifiers with different
keys.
So do a straightforward algorithm instead, where we malloc a
new table and insert all marked identifiers into that new
table.
Change-Id: Id34f62f35408a505857d57d2e7e4811b335d5998
Task-number: QTBUG-70205
Reviewed-by: Erik Verbruggen <[email protected]>
Reviewed-by: Liang Qi <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When an identifier overflows into the next bucket and its original spot
becomes free, it is not only important to move that identifier into the
now free spot. It is also necessary to shift the entries in the bucket
overflowed into one entry to the left, to avoid an accidental terminator
in the bucket. Such a terminator can make entire strings disappear from
the hash table. That in turn may result in repeated insertion of strings
that are otherwise identical, leading to internalClass lookups failing
(despite the members existing) after a GC.
Task-number: QTBUG-70205
Change-Id: Idf931287896a8ff730af98d36de703157e9792d3
Reviewed-by: Liang Qi <[email protected]>
Reviewed-by: Lars Knoll <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Different property names are mapped to the same property key through a
the identifier hash table. In the case of QTBUG-69280 we map a for-in
loop "for (var prop in testCase)" in TestCase.qml to an internal
iterator object, which signals whether it's finished or not by setting a
"done" property on the iterator result object to a boolean. On the
setter side, the property is specified via
result->put(engine->newString("done"))
and on the getter side the code uses
result->get(engine->id_done())
For this to work, the newly created string has to map to the same
identifier, otherwise we end up with differing property keys and wrong
values.
The test failure of QTBUG-69280 reproduced a scenario where two strings,
"pathChanged" and "done", mapped to the same index in the hash table
after a rehashing (growing), despite different string hash values. As a
consequence of the hash collision they had adjacent entries in the hash
table, with "pathChanged" coming first.
A subsequent garbage collection run ended up with "pathChanged" being
not marked and subject to removal from the identifier table.
IdentifierTable::sweep() wiped the entry for "pathChanged" and lastEntry
to the now free index and also remembered the exact string hash value.
In the next iteration, sweep() looked at the entry for "done", which
should move to the now free slot, as both strings map to the same index.
However sweep() didn't do that because the comparison of string hash
values failed.
The fix is to compare table indices (covered by
sweepFirstEntryInSameBucketWithDifferingHash) and respect bucket boundaries
(covered by dontSweepAcrossBucketBoundaries).
However it may happen that entries that would map to the same bucket end
up after another bucket because of the insertion order. This would lead
to
Q_ASSERT(table[lastIdx] == nullptr);
failing right after
lastIdx = (lastIdx + 1) % alloc;
Instead the determination of the next free slot must follow the same
logic as in addEntry, by finding the first null entry. This is covered
by sweepAcrossBucketBoundariesIfFirstBucketFull.
Task-number: QTBUG-69280
Change-Id: I284f53418d0a75e2edb631f8bacca8c5a596e603
Reviewed-by: Qt CI Bot <[email protected]>
Reviewed-by: Ulf Hermann <[email protected]>
|
|
|
|
|
|
|
| |
identifier -> asPropertyKey
Change-Id: I4e6f33bdad12e901303ec6101dd2b8d6b0e99ac4
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
| |
Change all uses of Identifier to use the new PropertyKey class
and get rid of Identifier.
Change-Id: Ib7e83b06a3c923235e145b6e083fe980dc240452
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
|
|
| |
Rename from/asHeapObject to from/asStringOrSymbol and fix
the signature.
Add a isStringOrSymbol() method and redefine isValid() to also
include array indices.
Change-Id: Ic8272bfbe84d15421e2ebe86ddda7fdaa8db4f3e
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
| |
Make sure we never add strings that represent array indices into
the identifier table.
Change-Id: Ib4a500d44b6ff58a71b7a55053c9be9f2580aea8
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
| |
Change-Id: I5fde731b3a1a6d7c15154881ed82549b2800d104
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implemented by storing a backpointer to the Heap object
in the identifier.
Since identifiers now point back to their originating
String or Symbol, we can now easily mark all identifiers
that are still in use and collect those that aren't.
Since Identifiers are 64bit also add support for holding an
array index in there. With that an identifier can describe
any kind of property that can be accessed in an object. This
helps speed up and simplify some code paths.
To make this possible, we need to register all
IdentifierHash instances with the identifier table, so that
we can properly mark those identifiers.
Change-Id: Icadbaf5712ab9d252d4e71aa4a520e86b14cd2a0
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
| |
Change-Id: Ib25c08027013217657beb2675dafa9a8c85cbaf9
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
|
|
| |
Add a reverse mapping table to the IdentifierHash to
avoid having to store a hash value inside the identifier.
This makes it possible to then use the identifiers value
based and not new them on the heap anymore.
Change-Id: If1f177588ea104565c6e3add49c70534a6c7dcb8
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
| |
First step to turning identifier into a simple int.
Change-Id: I4988587aa61f1f02ed80426ccbf00b685f38c829
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 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 <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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]>
|
|
|
|
|
|
|
| |
Reduces the number of instructions of IdentifierTable::identifier by ~15%.
Change-Id: I5a234fa96a6ee3e7202150ded512d1be0b36560d
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
| |
From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see
http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/
Updated license headers to use new LGPL header instead of LGPL21 one
(in those files which will be under LGPL v3)
Change-Id: Ic36f1a0a1436fe6ac6eeca8c2375a79857e9cb12
Reviewed-by: Lars Knoll <[email protected]>
|
|
|
|
|
|
|
|
| |
Allocating a new String for the Identifier is wasting both memory
and CPU. Let's rather extract it from the IdentifierTable.
Change-Id: Ibb9b2ac9775fefce74602d6954586195cdd5814e
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
|
| |
Qt copyrights are now in The Qt Company, so we could update the source
code headers accordingly. In the same go we should also fix the links to
point to qt.io.
Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9
Reviewed-by: Iikka Eklund <[email protected]>
|
|
|
|
|
|
|
|
|
|
| |
Avoid the use of Returned<String> for newString and changed the identifier
table to use Heap::String. This required moving some code back into
Heap::String, but that's code that doesn't call back into the GC, so
allocations and therefore future object moves aren't possible.
Change-Id: I1dca3e9c12a9c56f09419af8cc8cba39fe04f720
Reviewed-by: Lars Knoll <[email protected]>
|
|
|
|
|
| |
Change-Id: Iefa231106b77db6d4c9d4ded2b028d21eb94ab03
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
| |
This is a step towards storing direct heap object pointers for the values
on the JS stack, to avoid the costly indirection for data access.
Change-Id: Ibb57ed6cf52a7088bbc95ee04ae3a4cb25b8c045
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
|
| |
- Renamed LICENSE.LGPL to LICENSE.LGPLv21
- Added LICENSE.LGPLv3 & LICENSE.GPLv2
- Removed LICENSE.GPL
Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0
Reviewed-by: Jani Heikkinen <[email protected]>
|
|
|
|
|
| |
Change-Id: Ifa9aac63fdb270fb449f11832a1792caeb6c6724
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
| |
Change-Id: I95dcdda8c68e2a5c36244798c8c10dcfdd69d2c2
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
|
| |
This prepares for moving over to a d pointer scheme,
where Managed subclasses don't hold any data directly. This
is required to be able to move over to a modern GC.
Change-Id: I3f59633ac07a7da461bd2d4f0f9f3a8e3b0baf02
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
| |
Change-Id: Ic0492fbe31a1e134674bc6c20381f735dd6d5b7a
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
| |
Remove Value::fromString(String *), and make
Encode safe against encoding raw Managed * pointers.
Change-Id: Ibca4668e1cbeaf85c78169d14386281659d33ef6
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
| |
Change-Id: I8e2dad0e9e34c5a549952bc0765cd57f6aa8aadf
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
| |
Change-Id: I42ac6f4232fec2ce1535a007007542d8cc116433
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
| |
Change-Id: I8bc393856cad85734160b52dee745509be502247
Reviewed-by: Lars Knoll <[email protected]>
|
|
Move the v4 engine classes from a subdir of qml/qml into
two subdirs (compiler and jsruntime) of the qml module
Remove an unsued qv4syntaxchecker class, and move
the moth code directly into compiler.
Change-Id: I6929bede1f25098e6cb2e68087e779fac16b0c68
Reviewed-by: Simon Hausmann <[email protected]>
|