| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implicitly constructing a value from a ReturnedValue muddies the
responsibility for ensuring that the gc can find the object.
With this change, we disable the implicit conversion. The expectation
for lifetime management is now:
- If a ReturnedValue is stored on the C++ stack, it must be put into a
QV4::Scoped class (or there should be a comment why not doing so is
safe). Passing a ReturnedValue to a function should no longer be
possible, unless the function takes a ReturnedValue, in which case the
expectation is that it stores the value in a place where it can be
seen by the gc, before doing anything that could trigger a gc run.
Using Value::fromReturnedValue can still be used to pass a Value on,
but in that case, the expectation is that there is a comment which
explains why this is safe.
- If a QV4::Value is obtained from a function call, it ought to be
stored in a ScopedValue, too. We currently can't enforce this easily,
so this should be checked during code review. A possible way forward
would be to disallow returning Values, but that would be a larger
change, and is deferred to the future.
- If a functions has a QV4::Value parameter, it's the callers'
responsibilty to ensure that the gc can find it.
Pick-to: 6.9 6.8 6.5
Fixes: QTBUG-131961
Change-Id: Iea055589d35a5f1ac36fe376d4389eb81de87961
Reviewed-by: Ulf Hermann <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
| |
A value storing a primitive like undefined is completely safe. Having a
helper method to create it eases porting (usafe) code which directly
accepted QV4::ReturnedValue as a parameter to a variant taking a
QV4::Value.
Pick-to: 6.9 6.8 6.5
Task-number: QTBUG-131961
Change-Id: Ib1c27d45706faa570edc175245e9f34b4ceabcc8
Reviewed-by: Ulf Hermann <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
| |
In general, methods should not take a ReturnedValue. However, set leads
directly to a write through the WriteBarrier, so it's safe. Adding the
overload now helps to prepare for next commit which removes the implicit
conversion from ReturnedVaule to Value.
Pick-to: 6.9 6.8 6.5
Task-number: QTBUG-131961
Change-Id: I3fe2fbfbc1893190840bc8e48637eec3ae43ce46
Reviewed-by: Ulf Hermann <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These are really rather generic type traits that shouldn't be stored in
individual objects. Moving them away slims down FunctionObject even
more.
FunctionObject doesn't add any extra overhead on top of Object anymore.
You also cannot easily cast an object that doesn't implement any call
methods to FunctionObject anymore. Therefore, we can derive from
FunctionObject even if we only need to implement call methods in a
further derived class.
The fact that ProxyObject is not a FunctionObject but its derivatives
are is already tested as part of the ecmascript test suite.
Task-number: QTBUG-124662
Change-Id: I5632de8c54ac1d6a4b15c4926c655b87b475db49
Reviewed-by: Fabian Kosmale <[email protected]>
|
|
|
|
|
|
| |
Task-number: QTBUG-117983
Change-Id: I5790f01d614cd70c7fcc9bd817ec6ace3f3e3730
Reviewed-by: Ulf Hermann <[email protected]>
|
|
|
|
|
|
| |
Change-Id: I7aac01c2176db377efd7ab0a255b82ea7c36b9b4
Reviewed-by: Fabian Kosmale <[email protected]>
Reviewed-by: Qt CI Bot <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On android and on some other platforms, the upper bits of a pointer are
significant. We need to store them in our JS value encoding. Shift the
bits around to make this happen.
We now can store pointers of up to 57 bits. That's enough for everything
we've seen so far.
Fixes: QTBUG-101686
Fixes: QTBUG-91150
Pick-to: 6.5
Change-Id: I72e0fe63b27fca94840f82963e4d3936b3581b28
Reviewed-by: Qt CI Bot <[email protected]>
Reviewed-by: Fabian Kosmale <[email protected]>
Reviewed-by: Sami Shalayel <[email protected]>
Reviewed-by: Ville Voutilainen <[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]>
|
|
|
|
|
|
|
|
|
| |
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 <[email protected]>
Reviewed-by: Andrei Golubev <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A QJSManagedValue is a view on a QJSValue which always knows the engine
the value belongs to. This allows us to implement the JavaScript
semantics of the various QJSValue methods in a much more rigorous way.
[ChangeLog][QtQml] The new QJSManagedValue should be used instead of
QJSValue for manipulating properties and prototypes of JavaScript
values, as well as for calling JavaScript functions.
Change-Id: I9d445ffcf68dfa72dba9bae0818e83c80665ad66
Reviewed-by: Fabian Kosmale <[email protected]>
|
|
|
|
|
|
|
|
|
|
| |
We don't want to call into the engine just for adding two numbers.
This implements the most common operators on primitive JavaScript
values. More are to follow in the future.
Change-Id: Id51a5af59a3af9fec78a2d8f293e59e6567e9204
Reviewed-by: Fabian Kosmale <[email protected]>
|
|
|
|
|
|
|
| |
Since we depend on C++17 now, all of these can go.
Change-Id: I0484fd4bb99e4367ec211c29146c316453729959
Reviewed-by: Volker Hilsheimer <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of applying a heuristic on when to call drain() in unrelated
code, we check the stack limit on each push(). If the soft limit is
reached we try to drain. As drain() itself can push again, we try to
limit the stack size by allowing at most 65 recursions of drain(). If
none of that helps, we crash with a meaningful error message.
This allows us to remove all the hacky drain() calls in other parts of
the code.
Change-Id: Ib979339470da0e85981de8131e7997755b757c71
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
MemoryManager::collectFromJSStack did push to the mark stack without
checking if there is actually still space available. To fix this, we now
drain the stack once we hit the limit.
The test case is a slightly modified version compared to the reported
one, removing one loop. This was required as our regular expression does
not throw an exception when there are too many capture groups. However,
to trigger the bug, looping was not actually necessary.
Change-Id: I4d00865f25a989c380f4f5b221f4068c80b71d2b
Reviewed-by: Ulf Hermann <[email protected]>
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
src/qml/jsruntime/qv4value_p.h
src/qml/qml/qqmlmetatype.cpp
src/qml/qml/qqmltypewrapper.cpp
src/quick/items/qquicktableview.cpp
Change-Id: I684f8e01a711580512848bf1253f39b39fcbf4c7
|
| |
| |
| |
| |
| |
| | |
Task-number: QTBUG-56264
Change-Id: Ifdede70d95f5846e160772c43d22bc2a4123959b
Reviewed-by: Thiago Macieira <[email protected]>
|
| |
| |
| |
| |
| |
| |
| |
| | |
The static part can be used for compilation and won't resolve managed
objects. This allows us to remove all the remaining V4_BOOTSTRAP.
Change-Id: Id2f6feb64c48beb2a407697881aea8c0d791a532
Reviewed-by: Simon Hausmann <[email protected]>
|
|\|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
src/qml/compiler/qv4compileddata_p.h
src/qml/jit/qv4baselinejit.cpp
src/qml/jit/qv4jithelpers.cpp
src/qml/jsruntime/qv4lookup.cpp
src/qml/jsruntime/qv4runtime.cpp
src/qml/jsruntime/qv4runtimeapi_p.h
src/qml/jsruntime/qv4vme_moth.cpp
src/qml/qml/qqmltypemodule_p.h
Change-Id: If28793e9e08418457a11fc2c5832f03cab2fcc76
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The main feature that needs to be implemented in order to enable lookups
in QML files is to respect that the QObject wrapper has its own storage
layer (meta-object properties). Lookups need to be able to index those
when the base is a QObject. This is done by caching the property data
and guarding the validity by comparing property cache pointers.
The same lookup logic is also implemented for value type wrappers.
OVerall there's more that can be done with lookups in meta-objects, for
constant properties for example.
For "global" lookups we have a safeguard in place that generates a
LoadName instruction for property access that should end up in the qml
context wrapper. So no changes are needed here at first, but the lookup
in the QML context can be optimized in the future.
The way of storing the property cache in the lookup itself trades
ugliness on destruction against the creation of less internal classes.
Another option would be to store the property cache in the internal
class and let QObjectWrapper always transition via the property cache.
Task-number: QTBUG-69898
Change-Id: I9c378c071acc6d7d4a34a2a76616f9594119d515
Reviewed-by: Ulf Hermann <[email protected]>
|
|/
|
|
|
|
|
|
|
| |
On 32 bit systems, the pointers can only be 32 bit. So instead of
shifting bits 32-49 away in the upper part of the 64 bit value,
we can just check if the tag (the upper 32 bits) is 0.
Change-Id: I25e6542676e8aa2c566f10c70c532dd8bf5c7192
Reviewed-by: Ulf Hermann <[email protected]>
|
|
|
|
|
|
|
| |
Task-number: QTBUG-71862
Change-Id: I836756d004753420bfb7a00013ade0229bd5946e
Reviewed-by: Friedemann Kleint <[email protected]>
Reviewed-by: Lars Knoll <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Get rid of Primitive and move the corresponding methods
directly into Value. Mark many methods in Value as
constexpr and turn Value into a POD type again.
Keep Primitive as a pure alias to Value for source
compatibility of other modules that might be using it.
Change-Id: Icb47458947dd3482c8852e95782123ea4346f5ec
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
| |
Change-Id: I07db2df7eec2bdbeb84bd576d9e4f7912f79fc78
Reviewed-by: Erik Verbruggen <[email protected]>
|
|
|
|
|
|
|
|
|
|
| |
Make sure we check for detached buffers after all other calls
that could execute code have happened. To do that convert the
values to numbers before calling the write() methods of the
specific typed array.
Change-Id: I091e41400f740dfc1d0826657e285443c9336c40
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
|
|
| |
So now Math.max(array1.length, array2.length) won't return a double
anymore.
This improves the score in the crypto benchmark by ~10%
Change-Id: I8453a671d28d7f2a39ba74b18b3155f031d9b12f
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
| |
It was only used in a few places now, that can be replaced by
either using a PropertyKey, or by limiting the fast path
optimization in the runtime to array indices smaller than
INT_MAX. Since there are less branches this should even be
faster for pretty much all use cases.
Change-Id: Ib4f2f2f3e27f14ad180b810546e82ac83170b106
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
| |
This will replace Identifier over the next few commits.
The advantage of PropertyKey is that it can be stored on
the JS stack, so that a GC run won't accidentally clean
up the string/symbol referenced by the key.
Change-Id: Ib4daa4616bcfa537e6d371ef7c7740bc7727a50d
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Our method to create object literals wasn't compliant with the
ES7 spec, as we would in some cases re-order the properties.
This violated the spec which required properties to be created
in order, so that for-of would also iterate over them in creation
order.
As a nice side effect, this simplifies the code and gets a couple
of test cases using computed property names to pass.
Task-number: QTBUG-62512
Change-Id: I6dfe004357c5d46a0890027f4fd9e2d1e1a2a17a
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
| |
and use it where required.
Change-Id: I309ca61e0360b26428fc2ea5a2eea47c8e0632a0
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We also add a sameValueZero helper, to make life easier.
Remaining failures:
built-ins/Array/prototype/includes/get-prop.js fails (due to missing Proxy)
built-ins/Array/prototype/includes/length-boundaries.js fails
length-boundaries failure is due to strange treatment of edge number values in
Value, I think, I haven't yet been able to rectify that one.
Change-Id: Idacca528d88fb052d19a5d244662927f502f20d2
Reviewed-by: Lars Knoll <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Simply encode them as integers. That works just as well, and
allows removing the indexed empty values.
This is helpful, to swap the internal representations of undefined
and empty values, which in turn will simplify an implementation of
correct handling of uninitialized variables (through let/const).
Change-Id: I299f975d665309611d1b561f6a0c86b5ca15782a
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
| |
Don't call asReturnedValue() on something that might be null.
Change-Id: I31ab7df7e353dee0718957ec0d5b4edcc72f7a56
Reviewed-by: Erik Verbruggen <[email protected]>
|
|
|
|
|
| |
Change-Id: Ic83314fc2a5bb80f88c1616e7d3179fe6573a0e9
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
| |
Don't try to allocate an array buffer with negative length.
Change-Id: Ie95b9bcf7a3108b47df27ef813b7922e9da42b17
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
| |
Do some more bounds checking to avoid crashes.
Change-Id: I44e838c3577a9176628aa5e382d712eac9800203
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
|
| |
Added basic infrastructure to create symbols and convert them
back to strings. In addition, storing and retrieving of symbol
based properties in Objects works.
Change-Id: I185f7aa46e7afa19db5a801102142892e03b7bf1
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
| |
This is needed for symbol support.
Change-Id: I83db21f232168710d18999fd97d912016e86d630
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
|
| |
Add a Value::getLength(), that converts a Value to a length bound
between 0 and 2^53-1 as per ES7 spec. Use the extended range in
Array.prototype.splice and map to fix hanging test cases.
Change-Id: If9280d501423cfc10a60abd4e8aa30521d2a7bca
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
|
| |
This is required to be able to turn the internal class into
something that lives on the GC heap.
Change-Id: Ie4318588d420743b1e1ab1cd596a1c9d153eb793
Reviewed-by: Simon Hausmann <[email protected]>
|
|
|
|
|
|
|
| |
Because no, that can't be represented as an 32bit integer.
Change-Id: I83e5e74fdfbd9b13ac04a49311619d8939c7b093
Reviewed-by: Lars Knoll <[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]>
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
src/imports/shapes/qquickshape.cpp
src/imports/shapes/qquickshape_p_p.h
src/qml/compiler/qqmlpropertycachecreator_p.h
src/qml/jsruntime/qv4value_p.h
src/quick/items/qquickloader_p.h
tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
tools/qmlprofiler/qmlprofilerapplication.cpp
Change-Id: Iafc66ae84bf78630ed72a986acb678e9d19e3a69
|
| |\
| | |
| | |
| | | |
Change-Id: I3b250545e334f50dcef1a75acdef51820d34079a
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The idea of NaN boxing is to use one single NaN as a "true" NaN, and all
others as a boxed value. So when encoding some NaN, be sure to use that
one "true" NaN. Otherwise, it will be interpreted as an encoded value.
Task-number: QTBUG-65998
Change-Id: Ia6e4641be180f3d626c40a57b473f181358e04db
Reviewed-by: Simon Hausmann <[email protected]>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The write barrier header should have minimal dependencies.
Change-Id: I071718c2fafe5020d1093ca3b363844f7a9b7b35
Reviewed-by: Simon Hausmann <[email protected]>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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 <[email protected]>
|
| | |
| | |
| | |
| | |
| | | |
Change-Id: I0eb3300ac2e3e29b5311f9b7599d85eab7f775c5
Reviewed-by: Lars Knoll <[email protected]>
|
| | |
| | |
| | |
| | |
| | | |
Change-Id: Iccfe50c967560deee9e2903bbe3a293b13fe8b48
Reviewed-by: Erik Verbruggen <[email protected]>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The encoding will end up being the same as undefined.
Change-Id: I2427e96f98d410c291234615969791de6bf4f833
Reviewed-by: Lars Knoll <[email protected]>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Doing the marking of objects in a function instead of
using the table seems to be somewhat faster.
Change-Id: I9ec00cc0264f9a15c69b285db493bee31d99bf96
Reviewed-by: Erik Verbruggen <[email protected]>
|