Commit Graph

13564 Commits

Author SHA1 Message Date
Lars Knoll a410cb6901 Remove assertObjectBelongsToEngine method
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>
2017-04-07 06:06:10 +00:00
Lars Knoll 8aa36b6cff Avoid stack overflows during GC runs
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>
2017-04-07 06:06:08 +00:00
Lars Knoll fd0ee94d96 Correctly compute the amount of variables we need to mark
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>
2017-04-06 12:14:37 +00:00
Albert Astals Cid b78508f55f Add a TODO to make functions const
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>
2017-04-05 12:13:15 +00:00
Mitch Curtis 315f368986 Revert "Positioners: allow distinguishing between implicit/explicit child size"
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>
2017-04-05 09:25:22 +00:00
Mitch Curtis fa01610d6b Revert "Privately export QQuickPositionerAttached"
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>
2017-04-05 09:25:18 +00:00
Albert Astals Cid af72231fe4 Error out if TestCase.verify receives more than 2 parameters
Change-Id: I3299f602970067aaef290d4f1c7449d3ab03fb3c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2017-04-05 07:07:19 +00:00
Robin Burchell fdb8226139 TestCase: Use the new instanceof support for QML types to ensure we have an Item
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>
2017-04-04 20:47:54 +00:00
Gunnar Sletta 09aa8ba83f Document that wrap modes do not work with atlas textures
Change-Id: Ifa417644e10b947c4ca0b9c518cfd800b63142b5
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-04-04 08:20:39 +00:00
Mitch Curtis 4ba040b2e7 QQuickImage: only call updatePaintedGeometry() when necessary
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>
2017-04-03 15:48:48 +00:00
Lars Knoll e4894fe13d Don't use incremental GC for now
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>
2017-03-30 17:29:56 +00:00
Liang Qi 22cc4d6707 Merge remote-tracking branch 'origin/5.9' into dev
Conflicts:
	src/qml/jit/qv4assembler.cpp
	src/qml/jit/qv4assembler_p.h

Change-Id: Ibfe69610ccd1f275f181b2bd87feece4ba221e50
2017-03-30 11:26:26 +02:00
Simon Hausmann 4490096226 Restrict automated tests on Boot2Qt to non-graphical tests
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>
2017-03-30 06:18:34 +00:00
Simon Hausmann 4a6e072d6c Fix stack pointer arithmetic when cross-compiling
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>
2017-03-29 15:32:02 +00:00
Simon Hausmann ea99d62455 Minor cleanup: Don't require QtGui for ES6 tests
We don't need a QGuiApplication to launch test262.py

Change-Id: I3f8e200245a30d88f3c6ff578be414ec76bcfb9c
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
2017-03-29 15:31:33 +00:00
Laszlo Agocs 0dbc575c1a Make keyboard events work in QQuickWidget
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>
2017-03-29 15:31:21 +00:00
Friedemann Kleint b82d5bb418 tst_qquickimage::mirror(): Ensure screenshots are in the correct format
Task-number: QTBUG-59787
Change-Id: I9ef1e6e5284cadc37bdac342b02cf93655346d57
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-03-29 15:31:04 +00:00
Simon Hausmann 1b8c7e72e4 Fix pop(RegisterID) on ARMv7 when cross-compiling
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>
2017-03-29 07:05:05 +00:00
Simon Hausmann 05090868b8 Simplify function prologue code in the JIT
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>
2017-03-29 07:05:00 +00:00
Simon Hausmann 03006adeec Minor cleanup: Remove unused function
Change-Id: Ie8d0c7b360ff120f381e33439037cf7b01257456
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-03-29 07:04:54 +00:00
Simon Hausmann ecda87091f Fix manual register allocation when cross-compiling for ARMv7
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>
2017-03-29 07:04:37 +00:00
Simon Hausmann 3026e2c5b0 Add support for showing disassembly for cache mapped code
Change-Id: I6199d624a23e2e1b67bcbb841f0bc999880a3993
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-03-29 07:04:28 +00:00
Kimmo Ollila 73f365f9f2 Add missing header inclusion
Change-Id: I7c215db87552c63291e6c82d7b962ee17ec2f610
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-03-28 06:18:24 +00:00
Shawn Rutledge 1f9c7b065f Add tst_qquickflickable::nestedSliderUsingTouch
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>
2017-03-27 13:21:33 +00:00
Shawn Rutledge 6d7c3c0743 Flickable: don't steal grab from item with keepTouchGrab set
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>
2017-03-27 13:21:16 +00:00
Simon Hausmann e321dc6bee Merge remote-tracking branch 'origin/5.9' into dev
Conflicts:
	src/qml/jsruntime/qv4functionobject_p.h

Change-Id: I4bbed45f1fe02cf64df3c8a5f92f811e38e772f3
2017-03-27 14:53:52 +02:00
Shawn Rutledge 09a62428cf tst_qquickflickable: clean up touch event handling
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>
2017-03-27 12:21:22 +00:00
Shawn Rutledge 65e005a72d in childMouseEventFilter, touchpoint grabber is also the mouse grabber
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>
2017-03-27 12:07:10 +00:00
Simon Hausmann e2863c80fe Merge "Merge remote-tracking branch 'origin/5.8' into 5.9" into refs/staging/5.9 2017-03-25 10:59:43 +00:00
Simon Hausmann 8bed5de48c Run ES5 tests on Linux/x86-64
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>
2017-03-24 20:21:36 +00:00
Simon Hausmann c324681899 Fix prototype property when set to non-objects
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>
2017-03-24 20:21:31 +00:00
Jesus Fernandez d1c43e4457 Fix possible loss of data warning
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>
2017-03-24 09:10:14 +00:00
Simon Hausmann 24d0266ee4 Merge remote-tracking branch 'origin/5.9' into HEAD
Conflicts:
	src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp
	src/qml/jit/qv4assembler.cpp
	src/qml/jit/qv4assembler_p.h
	src/qml/jit/qv4isel_masm.cpp
	src/qml/jsruntime/qv4context.cpp
	src/qml/jsruntime/qv4context_p.h
	src/qml/jsruntime/qv4engine.cpp
	src/qml/jsruntime/qv4vme_moth.cpp
	src/qml/memory/qv4mmdefs_p.h

Change-Id: I9966750b7cd9106b78e4c4779f12b95a481cca40
2017-03-23 14:43:46 +01:00
Tony Sarajärvi 3cb86b26e5 Blacklist a qmltest::ListView test in macOS 10.12
Precise name of blacklisted test:
qmltest::ListView::test_listInteractiveCurrentIndexEnforce()

Task-number: QTBUG-58971
Change-Id: Iac01f0a5c31c91b08438fd6d7601bdb2ced41ac6
Reviewed-by: Liang Qi <liang.qi@qt.io>
2017-03-23 12:02:09 +00:00
Paul Olav Tvete 8f5366aed6 Build for for -no-feature-quick-sprite
Change-Id: Iaf26d9cec7f9fa7a5d6d24c729b2dc92737cca1f
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2017-03-22 12:41:09 +00:00
Paul Olav Tvete c021e4b412 Build fix for configure -no-opengl
Change-Id: I21f111a04d9e2ce367d7677dbb48abbd591a4e71
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Joni Poikelin <joni.poikelin@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-03-22 12:41:01 +00:00
Marc Mutz 047af77623 Codegen: do not assume QStringRef(const QString *) is implicit
It won't be for very much longer.

Change-Id: I90fae21b621f104053b776296fc9f6525e8baf52
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-03-22 12:33:30 +00:00
Simon Hausmann 110f69ab81 Speed up source code reading
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>
2017-03-22 12:17:49 +00:00
Simon Hausmann 5bd11b5a8c Avoid an extra stat() on the source .qml file when loading cache
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>
2017-03-22 12:17:45 +00:00
Lars Knoll 9b70716374 Fix handling of huge memory segments
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>
2017-03-22 11:30:57 +00:00
Ulf Hermann db51441a95 Allow info messages in debug message service
QtInfoMsg > QtFatalMsg, and it was added later.

Change-Id: If565ebd491aba57b162c7f8ddb5534e416f7ab44
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-03-22 09:01:24 +00:00
Robin Burchell 12569460e7 QSGOpenVGLayer: Fix compilation
Amends 48c3173338.

Change-Id: I9b30af689eaa9ca686b8ec2d034866eb4671ec95
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2017-03-22 08:57:05 +00:00
Simon Hausmann 5ce2235f42 Avoid reading (not parsing) .qml files when using the cache
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>
2017-03-21 21:54:06 +00:00
Simon Hausmann fc0254a48c Simplify internal source access API
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>
2017-03-21 20:10:23 +00:00
Robin Burchell 59d8fa914d Remove QSGDistanceFieldGlyphCacheManager
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>
2017-03-21 15:22:56 +00:00
Robin Burchell b5903ba46e QSGDistanceFieldUtil: Remove a layer of indirection
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>
2017-03-21 15:22:50 +00:00
Ulf Hermann 1bc9e17636 V4 Debugger: Encode NaN and +/-Infinity as strings
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>
2017-03-21 13:10:50 +00:00
Simon Hausmann 4db21fe60e Complete transition to standard layout classes for JIT access
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>
2017-03-21 10:38:02 +00:00
Robin Burchell ddb1b8f226 QQuickEvents: Fix documentation of types for MouseEvent and WheelEvent x/y
These types are qreal, not int.

Change-Id: I26569c40825ce098ea095b3d9dc9b84eb3870c02
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-03-20 16:47:54 +00:00
Gunnar Sletta 6825b37a48 Expose QQuickItem::size() and document QQuickItem::setSize()
[ChangeLog][QtQuick][QQuickItem] Add QQuickItem::size() and document QQuickItem::setSize().

Change-Id: I6f4d531e046758eb062111d656cc2e0be1624da3
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-03-20 13:05:39 +00:00