It's only used during mark() calls, where we can be reasonably
safe that the assertion holds. But mark() needs to change and
become independent of the execution engine for concurrent collection,
so remove the assert as a preparation.
Change-Id: I52266af719afd76048d73efdcfcf96c0abc8843f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
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>
CallContext.locals.alloc was computed incorrectly. This
number is being used to determine which memory could
contain valid pointers during marking.
The old code was off by 2, leading to the last two arguments
not getting marked properly during GC.
Fixes a regression introduced in 3a0bb11d.
Task-number: QTBUG-59928
Task-number: QTBUG-59600
Change-Id: I88f58a237c9a5f02434c0d4081c4e368cd944a5b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
As far as I can see they don't modify the QJSValue or its private at all
Change-Id: I555e9dc2fa28aa90929e6f864158bbbc98dd669c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This reverts commit 2556bfdab4.
This is no longer necessary, as there are now no users of this
functionality in other modules.
Change-Id: If92bbdb3e5e95b4103610d68d22e929cf30c4e5e
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
This reverts commit 015dff255f.
This is no longer necessary, as there are now no users of this type
in other modules.
Change-Id: I453fb7c36a9b3dc90ecb2e412164a8176f0c332b
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
Using !item is not enough in a loosely-typed language like QML.
Previously, passing numbers to these methods (for example) would have
worked in misleading ways, or not at all.
We allow Window here too as for the most part it is useful, and some
tests actually use it.
Change-Id: I99de081798d1c503d0b01dc99ca095654cf58aa4
Reported-by: Albert Astals Cid <albert.astals@canonical.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Changes in position don't affect the size of an image, so
it isn't necessary to updated the paintedWidth/Height, or
set implicitSize.
Change-Id: Ib10476e970a016b65c250ce735d50d68acace34b
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Reviewed-by: Gunnar Sletta <gunnar@crimson.no>
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>
This allows us to enable running of some of the tests in the CI and
gives us test coverage for some important architecture specific aspects
of the engine. Graphical tests are omitted at the moment as well as a
few other tests (such as ES6 suite), that will be added incrementally.
This change is just an enabler. Once in place tests can be enabled in
qt5.git's platform_configs.
Change-Id: I9179aaf1fe12f4423833379b97d16b711c57f39b
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Replace the use of size(void*) with target assembler specific values for
the pointer size, when calculating offsets into the stack for
poke/peek/push/pop and placing arguments onto the stack before calling
functions.
Change-Id: I3aff540f0083967e75b61e0c29dbeb4d9ecfa433
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
We don't need a QGuiApplication to launch test262.py
Change-Id: I3f8e200245a30d88f3c6ff578be414ec76bcfb9c
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
Right now many cases outside of text input fields are simply broken,
e.g. one cannot use a TableView or other controls with the keyboard.
Removing the seemingly unnecessary focusObject() solves all problems
since this way key events get delivered to the QQuickWidget which in
turn forwards to the QQuickWindow.
Directly routing into the QQuickWindow's focusObject(), which can be
any item in the scene is wrong since it skips a big part of
QQuickWindow's event handling logic.
Task-number: QTBUG-45757
Change-Id: Ie53b9003d156ab019fa4b9cf461e209990e738f7
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
This is implemented as ldr instruction that automatically adjusts the
indexing register, which for ARMv7 needs to be always 4-bytes, not
sizeof(void*) which can be 8 on 64-bit hosts.
Change-Id: I66cce2a7388ef12b321db643e8efb002158519aa
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
We don't have to do a engine->current->engine dance to get hold of the
engine pointer, in order to update jsStackTop. We have a dedicated
engine register :)
Change-Id: I187ea67bf9f3e43b0048dca3cd6ee35f70d8737c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Let's assume that we always generate thumb2 code. I'm not even sure
that we still support plain ARM anyway.
Change-Id: Ie7ec4d1de8f9f6cb86d80193990e492782ff2cf2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
to verify that when a touch-handling component is inside the Flickable,
it can control whether the flickable can steal the grab by means of
setKeepTouchGrab.
Task-number: QTBUG-59416
Task-number: QTBUG-59707
Change-Id: I93cf3abb07a96a69290c3b5b055b688a62fe8fff
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Sometimes filterMouseEvent can be given a mouse event which was
synthesized from a touch point which was already grabbed. In such
cases, if the grabber has keepTouchGrab set, respect it.
This makes it possible again for a QQControls 2 slider to be draggable
inside a Flickable which is also draggable in the same direction.
Task-number: QTBUG-59416
Change-Id: I93b7fd9cb846b1e574615154f9a54316b60c0477
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Use QTest::createTouchDevice now that it exists. No need for each test
to create a device and pass it in to flickWithTouch
Change-Id: I81131a13aaba01cfa0f04b25f334c80263625d12
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
When an item (such as Flickable) filters its children's mouse events,
sometimes the mouse event may be one that is synthesized from a touch
point. If that touch point is already grabbed, then in the context
of childMouseEventFilter QQuickWindow::mouseGrabberItem() should return
the item which has grabbed the touchpoint from which the mouse event
was synthesized. Otherwise, there was a regression in which an item
which can be dragged via touch (such as Slider in QQ Controls 2)
could have its grab stolen by a filtering parent, such as Flickable,
or the gesture recognizer in QtLocation. mouseGrabberItem() was
returning null because touchMouseId and touchMouseDevice were not
set, and the actual mouse was not grabbed.
If a touch event is used to synthesize a mouse event, and during
delivery an Item steals the grab of the synthetic mouse event, the
original grabber needs to be notified that it has lost the grab.
Task-number: QTBUG-59416
Change-Id: Ib121b06121df7593c0d549a6df42397b8ead1c45
Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
This requires including the test suite as a submodule by default and
bumping the module to a new sha1 that removes some particularly long
paths.
Also force the test suite to run under a US locale, as tests like
ch15/15.5/15.5.4/15.5.4.7/S15.5.4.7_A1_T11 cannot deal with locale
dependent output for date formatting.
The test harness now returns a non-zero exit code when a test fails.
This is used by the QTestLib wrapper to determine success or failure.
The tests with JIT are run, but the tests with the interpreter are
omitted at the moment until the last failure is fixed.
The tests add about 10-15 minutes extra time to the total time it takes
to run tests on Linux in the CI.
Change-Id: Id01fd3b41350f9c9a6ce9e43236f51f7f0fb71c8
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
Commit 180decaf11 regressed
ch15/15.3/15.3.5/S15.3.5.3_A2_T6 in the sense that when a non-object was
set for the prototype property, the protoProperty() helper function
would perform an unsafe cast to Object * and return a non-null pointer,
which however instanceof() does not expect.
Change-Id: I134fd41f6b2d3349ebe7d9e91c6b6e5788f599b6
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data
Amends merge resolution of 24d0266ee4.
Change-Id: I55eca8d853bb957e5b4ea792036aaa0b2f122b38
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Since we always convert the source code of .qml/.js/qmldir files from
utf-8 to utf-16, we always end up copying bytes around. That means
instead of allocating memory on the C++ heap and copying bytes from
kernel space to user space and then a few times through QIODevice
buffers until we reach QString::fromUtf8, we might as well mmap() the
file directly - if possible.
Change-Id: I54c88d4d9f03f9967130d65a7b53cfec93734018
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
For timestamp comparison it is not necessary to create another
QFileInfo() object and call exists() and lastModified(), when we can
pass that information through from the type loader.
Change-Id: I225cd36e672f1f390bddb4e6ebfafa3fc1269795
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>
QtInfoMsg > QtFatalMsg, and it was added later.
Change-Id: If565ebd491aba57b162c7f8ddb5534e416f7ab44
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
By making SourceCodeData copyable we can delay the reading of the source
file until we really need to. This also allows persisting the QFileInfo
object and therefore having only one stat() call to check if the file
exists, what its size is and what the last modification time is.
Change-Id: Ic7e4d5f566d870f3b1fa8302227417fa813cb139
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
All call sites of QQmlDataBlob::Data immediately convert the data to
UTf-8 - for .qml, .js and qmldir files. We can simplify the code by
reflecting that in the API and that also opens up the possibility for
future optimizations.
This means that the bi-pointer has to go, but at the moment the Data
object is stack-allocated anyway.
Since the "Data" class always represents source code, it is now called
SourceCodeData.
Change-Id: Icd262ed1e35f9edd64945ba6c16d80f9917eae72
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
After the previous cleanups, it became clear that this didn't serve much
of a purpose, so let's remove it and simplify the implementation as a
result.
Change-Id: Iae2ff9c46762f0c7bdf4225a2c4df93bc8253902
Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
These mysterious setters appear to be unused (and always were, as far
as I can see). How useful they are is not entirely clear (as opposed to
a patch to the source for instance, and as it's private API anyway, you'd be
touching internals to use this. Additionally, removing the indirection makes
the code a bit cleaner and more self-contained in my opinion.
This removal leaves the value of QSGDistanceFieldGlyphCacheManager in
some question to me, given that it's basically a glorified wrapper
around QHash.
Change-Id: I6d18eb40d8cd00ebe389b4ed53448f3401962ae6
Reviewed-by: Gunnar Sletta <gunnar@crimson.no>
Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
JSON doesn't have numerical values for those. However, as we give the
type of each item in a separate field, we can just use strings here and
the result will still not clash with actual strings.
Task-number: QTBUG-47880
Change-Id: I85ffa008890a8a9e6894dd3151f7dc6b527ed5e1
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>