aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2017-06-08 11:00:41 +0200
committerLiang Qi <liang.qi@qt.io>2017-06-08 11:48:54 +0200
commit8a5837467d153c50c869625390a584b0335b77b7 (patch)
treed8aca950cb88dfdc3a001a5cdedf02d7a8894d36
parent5af4c9b237a23ce12ca7c56eb6c9ecda17743228 (diff)
parent55490690f81eba168b06a90e4a66cefc20b38252 (diff)
Merge remote-tracking branch 'origin/dev' into wip/scenegraphng
Conflicts: src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenode.cpp Change-Id: Id8107cb0de0fbfe7120a90a137b49c2b915ff2d3
-rw-r--r--LGPL_EXCEPTION.txt22
-rw-r--r--LICENSE.GPLv3686
-rw-r--r--LICENSE.LGPLv21514
-rw-r--r--LICENSE.LGPLv3175
-rw-r--r--dist/changes-5.9.0123
-rw-r--r--examples/qml/xmlhttprequest/Get.qml54
-rw-r--r--examples/qml/xmlhttprequest/GetForm.ui.qml (renamed from examples/qml/xmlhttprequest/get.qml)54
-rw-r--r--examples/qml/xmlhttprequest/methods.js71
-rw-r--r--examples/qml/xmlhttprequest/xmlhttprequest.pro5
-rw-r--r--examples/qml/xmlhttprequest/xmlhttprequest.qml2
-rw-r--r--examples/qml/xmlhttprequest/xmlhttprequest.qrc4
-rw-r--r--examples/quick/demos/samegame/samegame.pro2
-rw-r--r--examples/quick/shared/LauncherList.qml160
-rw-r--r--examples/quick/shared/SimpleLauncherDelegate.qml4
-rw-r--r--src/3rdparty/masm/assembler/ARMv7Assembler.h22
-rw-r--r--src/3rdparty/masm/assembler/MacroAssembler.h8
-rw-r--r--src/3rdparty/masm/assembler/MacroAssemblerARM64.h10
-rw-r--r--src/imports/builtins/builtins.qmltypes3
-rw-r--r--src/imports/localstorage/plugin.cpp97
-rw-r--r--src/imports/qtquick2/plugins.qmltypes2
-rw-r--r--src/imports/settings/qqmlsettings.cpp18
-rw-r--r--src/particles/qquickv4particledata.cpp107
-rw-r--r--src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp2
-rw-r--r--src/plugins/qmltooling/qmldbg_debugger/qv4debugger.cpp2
-rw-r--r--src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp6
-rw-r--r--src/plugins/qmltooling/qmldbg_profiler/qqmlprofileradapter.cpp2
-rw-r--r--src/plugins/qmltooling/qmldbg_quickprofiler/qquickprofileradapter.cpp2
-rw-r--r--src/qml/compiler/compiler.pri2
-rw-r--r--src/qml/compiler/qqmlirbuilder.cpp5
-rw-r--r--src/qml/compiler/qqmlpropertyvalidator_p.h4
-rw-r--r--src/qml/compiler/qv4compileddata.cpp4
-rw-r--r--src/qml/compiler/qv4instr_moth_p.h10
-rw-r--r--src/qml/compiler/qv4isel_moth.cpp59
-rw-r--r--src/qml/compiler/qv4ssa.cpp6
-rw-r--r--src/qml/configure.json9
-rw-r--r--src/qml/jit/qv4isel_masm.cpp12
-rw-r--r--src/qml/jsapi/qjsvalue.cpp4
-rw-r--r--src/qml/jsruntime/jsruntime.pri2
-rw-r--r--src/qml/jsruntime/qv4alloca_p.h53
-rw-r--r--src/qml/jsruntime/qv4argumentsobject.cpp21
-rw-r--r--src/qml/jsruntime/qv4arraydata.cpp2
-rw-r--r--src/qml/jsruntime/qv4arraydata_p.h2
-rw-r--r--src/qml/jsruntime/qv4booleanobject.cpp2
-rw-r--r--src/qml/jsruntime/qv4booleanobject_p.h1
-rw-r--r--src/qml/jsruntime/qv4context.cpp65
-rw-r--r--src/qml/jsruntime/qv4context_p.h15
-rw-r--r--src/qml/jsruntime/qv4dateobject_p.h2
-rw-r--r--src/qml/jsruntime/qv4engine.cpp136
-rw-r--r--src/qml/jsruntime/qv4engine_p.h33
-rw-r--r--src/qml/jsruntime/qv4enginebase_p.h128
-rw-r--r--src/qml/jsruntime/qv4errorobject.cpp7
-rw-r--r--src/qml/jsruntime/qv4errorobject_p.h18
-rw-r--r--src/qml/jsruntime/qv4executableallocator_p.h2
-rw-r--r--src/qml/jsruntime/qv4function.cpp8
-rw-r--r--src/qml/jsruntime/qv4functionobject.cpp66
-rw-r--r--src/qml/jsruntime/qv4functionobject_p.h20
-rw-r--r--src/qml/jsruntime/qv4globalobject.cpp2
-rw-r--r--src/qml/jsruntime/qv4internalclass.cpp132
-rw-r--r--src/qml/jsruntime/qv4internalclass_p.h65
-rw-r--r--src/qml/jsruntime/qv4lookup.cpp272
-rw-r--r--src/qml/jsruntime/qv4lookup_p.h22
-rw-r--r--src/qml/jsruntime/qv4managed.cpp2
-rw-r--r--src/qml/jsruntime/qv4managed_p.h11
-rw-r--r--src/qml/jsruntime/qv4memberdata_p.h15
-rw-r--r--src/qml/jsruntime/qv4numberobject_p.h1
-rw-r--r--src/qml/jsruntime/qv4object.cpp133
-rw-r--r--src/qml/jsruntime/qv4object_p.h74
-rw-r--r--src/qml/jsruntime/qv4qmlcontext.cpp12
-rw-r--r--src/qml/jsruntime/qv4qobjectwrapper.cpp5
-rw-r--r--src/qml/jsruntime/qv4regexp_p.h1
-rw-r--r--src/qml/jsruntime/qv4regexpobject.cpp2
-rw-r--r--src/qml/jsruntime/qv4regexpobject_p.h2
-rw-r--r--src/qml/jsruntime/qv4runtime.cpp110
-rw-r--r--src/qml/jsruntime/qv4scopedvalue_p.h2
-rw-r--r--src/qml/jsruntime/qv4sequenceobject_p.h1
-rw-r--r--src/qml/jsruntime/qv4string.cpp14
-rw-r--r--src/qml/jsruntime/qv4string_p.h13
-rw-r--r--src/qml/jsruntime/qv4stringobject_p.h3
-rw-r--r--src/qml/jsruntime/qv4typedarray.cpp4
-rw-r--r--src/qml/jsruntime/qv4typedarray_p.h1
-rw-r--r--src/qml/jsruntime/qv4variantobject_p.h1
-rw-r--r--src/qml/jsruntime/qv4vme_moth.cpp74
-rw-r--r--src/qml/jsruntime/qv4vme_moth_p.h10
-rw-r--r--src/qml/memory/qv4heap_p.h12
-rw-r--r--src/qml/memory/qv4mm.cpp45
-rw-r--r--src/qml/memory/qv4mm_p.h48
-rw-r--r--src/qml/memory/qv4mmdefs_p.h33
-rw-r--r--src/qml/memory/qv4writebarrier_p.h3
-rw-r--r--src/qml/parser/qqmljslexer.cpp5
-rw-r--r--src/qml/qml/qqmlengine.cpp6
-rw-r--r--src/qml/qml/qqmlglobal.cpp2
-rw-r--r--src/qml/qml/qqmlglobal_p.h1
-rw-r--r--src/qml/qml/qqmlplatform.cpp6
-rw-r--r--src/qml/qml/qqmlplatform_p.h2
-rw-r--r--src/qml/qml/qqmlpropertycache.cpp5
-rw-r--r--src/qml/qml/qqmltypeloader.cpp41
-rw-r--r--src/qml/qml/qqmltypeloader_p.h12
-rw-r--r--src/qml/qml/qqmlvmemetaobject.cpp2
-rw-r--r--src/qml/qml/qqmlxmlhttprequest.cpp4
-rw-r--r--src/qml/qtqmlglobal.h16
-rw-r--r--src/qml/qtqmlglobal_p.h46
-rw-r--r--src/qml/types/qqmlconnections.cpp1
-rw-r--r--src/qml/types/qqmllistmodel.cpp1
-rw-r--r--src/qml/util/qqmladaptormodel.cpp44
-rw-r--r--src/quick/configure.json41
-rw-r--r--src/quick/designer/qquickdesignersupportitems.cpp8
-rw-r--r--src/quick/doc/src/concepts/visualcanvas/adaptations.qdoc2
-rw-r--r--src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc2
-rw-r--r--src/quick/doc/src/concepts/visualcanvas/topic.qdoc2
-rw-r--r--src/quick/items/qquickanimatedimage_p.h1
-rw-r--r--src/quick/items/qquickevents.cpp3
-rw-r--r--src/quick/items/qquickevents_p_p.h25
-rw-r--r--src/quick/items/qquickitem.cpp91
-rw-r--r--src/quick/items/qquickrectangle.cpp19
-rw-r--r--src/quick/items/qquickrectangle_p.h6
-rw-r--r--src/quick/items/qquickrectangle_p_p.h1
-rw-r--r--src/quick/items/qquickview.cpp1
-rw-r--r--src/quick/items/qquickwindow.cpp71
-rw-r--r--src/quick/items/qquickwindow_p.h4
-rw-r--r--src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp8
-rw-r--r--src/quick/scenegraph/adaptations/software/qsgsoftwarepublicnodes.cpp3
-rw-r--r--src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenode.cpp77
-rw-r--r--src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenode_p.h6
-rw-r--r--src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp4
-rw-r--r--src/quick/scenegraph/coreapi/qsgnode.cpp12
-rw-r--r--src/quick/scenegraph/coreapi/qsgrenderer.cpp4
-rw-r--r--src/quick/util/qquickglobal.cpp5
-rw-r--r--src/quick/util/qquickpixmapcache.cpp2
-rw-r--r--src/quickwidgets/qquickwidget.cpp5
-rw-r--r--tests/auto/particles/qquickparticlesystem/data/crashaffectors.qml27
-rw-r--r--tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp8
-rwxr-xr-xtests/auto/qml/ecmascripttests/test262.py1
-rw-r--r--tests/auto/qml/qqmlconnections/data/disabled-at-start.qml14
-rw-r--r--tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp18
-rw-r--r--tests/auto/qml/qqmlecmascript/data/qtbug60547/TestObject.qml11
-rw-r--r--tests/auto/qml/qqmlecmascript/data/qtbug60547/components/Counter.qml4
-rw-r--r--tests/auto/qml/qqmlecmascript/data/qtbug60547/main.qml8
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp11
-rw-r--r--tests/auto/qml/qqmlengine/tst_qqmlengine.cpp1
-rw-r--r--tests/auto/qml/qqmlextensionplugin/tst_qqmlextensionplugin.cpp27
-rw-r--r--tests/auto/qml/qqmllanguage/data/ConcurrentLoadA.qml7
-rw-r--r--tests/auto/qml/qqmllanguage/data/ConcurrentLoadB.qml7
-rw-r--r--tests/auto/qml/qqmllanguage/data/concurrentLoad_main.qml5
-rw-r--r--tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp16
-rw-r--r--tests/auto/qml/qqmlparser/tst_qqmlparser.cpp12
-rw-r--r--tests/auto/qml/qqmlsettings/data/aliases.qml4
-rw-r--r--tests/auto/qml/qqmlsettings/data/cpp-aliases.qml2
-rw-r--r--tests/auto/qml/qqmlsettings/data/types.qml6
-rw-r--r--tests/auto/qml/qqmlsettings/tst_qqmlsettings.cpp206
-rw-r--r--tests/auto/qml/qqmlxmlhttprequest/data/send_patch.qml29
-rw-r--r--tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp2
-rw-r--r--tests/auto/qmltest/statemachine/tst_signaltransition.qml29
-rw-r--r--tests/auto/qmltest/statemachine/tst_triggeredArguments1.qml29
-rw-r--r--tests/auto/qmltest/statemachine/tst_triggeredArguments2.qml29
-rw-r--r--tests/auto/quick/qquickanimatedsprite/data/sourceSwitch.qml29
-rw-r--r--tests/auto/quick/qquickanimators/data/positionerWithAnimator.qml29
-rw-r--r--tests/auto/quick/qquickapplication/BLACKLIST2
-rw-r--r--tests/auto/quick/qquickapplication/data/tst_platformname.qml6
-rw-r--r--tests/auto/quick/qquickapplication/qquickapplication.pro3
-rw-r--r--tests/auto/quick/qquickapplication/tst_qquickapplication.cpp19
-rw-r--r--tests/auto/quick/qquickfocusscope/BLACKLIST2
-rw-r--r--tests/auto/quick/qquickitem/data/childAtRectangle.qml29
-rw-r--r--tests/auto/quick/qquickitem/data/shortcutOverride.qml29
-rw-r--r--tests/auto/quick/qquickitem2/data/nonexistentPropertyConnection.qml11
-rw-r--r--tests/auto/quick/qquickitem2/tst_qquickitem.cpp10
-rw-r--r--tests/auto/quick/qquickrectangle/data/gradient-multiple.qml30
-rw-r--r--tests/auto/quick/qquickrectangle/data/gradient-separate.qml20
-rw-r--r--tests/auto/quick/qquickrectangle/tst_qquickrectangle.cpp59
-rw-r--r--tests/auto/quick/qquickview/data/findChild.qml9
-rw-r--r--tests/auto/quick/qquickview/tst_qquickview.cpp40
-rw-r--r--tests/auto/quick/qquickwindow/BLACKLIST4
-rw-r--r--tests/auto/quick/qquickwindow/tst_qquickwindow.cpp24
-rw-r--r--tests/auto/quick/touchmouse/tst_touchmouse.cpp10
-rw-r--r--tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp33
-rw-r--r--tests/benchmarks/benchmarks.pro2
-rw-r--r--tests/benchmarks/particles/affectors/affectors.pro8
-rw-r--r--tests/benchmarks/particles/affectors/tst_affectors.cpp9
-rw-r--r--tests/benchmarks/particles/emission/emission.pro3
-rw-r--r--tests/benchmarks/qml/animation/tst_animation.cpp5
-rw-r--r--tests/benchmarks/qml/js/js.pro2
-rw-r--r--tests/benchmarks/qml/js/qjsengine/qjsengine.pro2
-rw-r--r--tests/benchmarks/qml/js/qjsengine/tst_qjsengine.cpp2
-rw-r--r--tests/benchmarks/qml/js/qjsvalue/qjsvalue.pro1
-rw-r--r--tests/benchmarks/qml/js/qjsvalue/tst_qjsvalue.cpp2
-rw-r--r--tests/benchmarks/qml/qml.pro2
-rw-r--r--tests/benchmarks/qml/qqmlchangeset/tst_qqmlchangeset.cpp29
-rw-r--r--tests/benchmarks/qml/qqmldebugtrace/qqmldebugtrace.pro8
-rw-r--r--tests/benchmarks/qml/qqmldebugtrace/tst_qqmldebugtrace.cpp87
-rw-r--r--tests/benchmarks/qml/script/tst_script.cpp89
-rw-r--r--tests/benchmarks/script/qjsvalue/qjsvalue.pro10
-rw-r--r--tests/benchmarks/script/qjsvalue/tst_qjsvalue.cpp99
-rw-r--r--tests/benchmarks/script/script.pro4
-rw-r--r--tests/manual/v4/v8-bench.js3
-rw-r--r--tools/qmlcachegen/qmlcache.prf5
-rw-r--r--tools/qmleasing/mainwindow.cpp1
-rw-r--r--tools/qmlplugindump/qmltypereader.cpp29
-rw-r--r--tools/qmlplugindump/qmltypereader.h29
197 files changed, 2679 insertions, 3240 deletions
diff --git a/LGPL_EXCEPTION.txt b/LGPL_EXCEPTION.txt
deleted file mode 100644
index 5cdacb9a4e..0000000000
--- a/LGPL_EXCEPTION.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-The Qt Company Qt LGPL Exception version 1.1
-
-As an additional permission to the GNU Lesser General Public License version
-2.1, the object code form of a "work that uses the Library" may incorporate
-material from a header file that is part of the Library. You may distribute
-such object code under terms of your choice, provided that:
- (i) the header files of the Library have not been modified; and
- (ii) the incorporated material is limited to numerical parameters, data
- structure layouts, accessors, macros, inline functions and
- templates; and
- (iii) you comply with the terms of Section 6 of the GNU Lesser General
- Public License version 2.1.
-
-Moreover, you may apply this exception to a modified version of the Library,
-provided that such modification does not involve copying material from the
-Library into the modified Library's header files unless such material is
-limited to (i) numerical parameters; (ii) data structure layouts;
-(iii) accessors; and (iv) small macros, templates and inline functions of
-five lines or less in length.
-
-Furthermore, you are not required to apply this additional permission to a
-modified version of the Library.
diff --git a/LICENSE.GPLv3 b/LICENSE.GPLv3
deleted file mode 100644
index 71c4ad49c3..0000000000
--- a/LICENSE.GPLv3
+++ /dev/null
@@ -1,686 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
-
- The Qt Toolkit is Copyright (C) 2015 The Qt Company Ltd.
- Contact: http://www.qt.io/licensing/
-
- You may use, distribute and copy the Qt Toolkit under the terms of
- GNU Lesser General Public License version 3. That license references
- the General Public License version 3, that is displayed below. Other
- portions of the Qt Toolkit may be licensed directly under this license.
-
--------------------------------------------------------------------------
-
- GNU GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
- The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works. By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users. We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors. You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
- To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights. Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received. You must make sure that they, too, receive
-or can get the source code. And you must show them these terms so they
-know their rights.
-
- Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
- For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software. For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
- Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so. This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software. The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable. Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products. If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
- Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary. To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- TERMS AND CONDITIONS
-
- 0. Definitions.
-
- "This License" refers to version 3 of the GNU General Public License.
-
- "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
- "The Program" refers to any copyrightable work licensed under this
-License. Each licensee is addressed as "you". "Licensees" and
-"recipients" may be individuals or organizations.
-
- To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy. The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
- A "covered work" means either the unmodified Program or a work based
-on the Program.
-
- To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy. Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
- To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies. Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
- An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License. If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
- 1. Source Code.
-
- The "source code" for a work means the preferred form of the work
-for making modifications to it. "Object code" means any non-source
-form of a work.
-
- A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
- The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form. A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
- The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities. However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work. For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
- The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
- The Corresponding Source for a work in source code form is that
-same work.
-
- 2. Basic Permissions.
-
- All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met. This License explicitly affirms your unlimited
-permission to run the unmodified Program. The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work. This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
- You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force. You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright. Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
- Conveying under any other circumstances is permitted solely under
-the conditions stated below. Sublicensing is not allowed; section 10
-makes it unnecessary.
-
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
- No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
- When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
- 4. Conveying Verbatim Copies.
-
- You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
- You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
- 5. Conveying Modified Source Versions.
-
- You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
- a) The work must carry prominent notices stating that you modified
- it, and giving a relevant date.
-
- b) The work must carry prominent notices stating that it is
- released under this License and any conditions added under section
- 7. This requirement modifies the requirement in section 4 to
- "keep intact all notices".
-
- c) You must license the entire work, as a whole, under this
- License to anyone who comes into possession of a copy. This
- License will therefore apply, along with any applicable section 7
- additional terms, to the whole of the work, and all its parts,
- regardless of how they are packaged. This License gives no
- permission to license the work in any other way, but it does not
- invalidate such permission if you have separately received it.
-
- d) If the work has interactive user interfaces, each must display
- Appropriate Legal Notices; however, if the Program has interactive
- interfaces that do not display Appropriate Legal Notices, your
- work need not make them do so.
-
- A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit. Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
- 6. Conveying Non-Source Forms.
-
- You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
- a) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by the
- Corresponding Source fixed on a durable physical medium
- customarily used for software interchange.
-
- b) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by a
- written offer, valid for at least three years and valid for as
- long as you offer spare parts or customer support for that product
- model, to give anyone who possesses the object code either (1) a
- copy of the Corresponding Source for all the software in the
- product that is covered by this License, on a durable physical
- medium customarily used for software interchange, for a price no
- more than your reasonable cost of physically performing this
- conveying of source, or (2) access to copy the
- Corresponding Source from a network server at no charge.
-
- c) Convey individual copies of the object code with a copy of the
- written offer to provide the Corresponding Source. This
- alternative is allowed only occasionally and noncommercially, and
- only if you received the object code with such an offer, in accord
- with subsection 6b.
-
- d) Convey the object code by offering access from a designated
- place (gratis or for a charge), and offer equivalent access to the
- Corresponding Source in the same way through the same place at no
- further charge. You need not require recipients to copy the
- Corresponding Source along with the object code. If the place to
- copy the object code is a network server, the Corresponding Source
- may be on a different server (operated by you or a third party)
- that supports equivalent copying facilities, provided you maintain
- clear directions next to the object code saying where to find the
- Corresponding Source. Regardless of what server hosts the
- Corresponding Source, you remain obligated to ensure that it is
- available for as long as needed to satisfy these requirements.
-
- e) Convey the object code using peer-to-peer transmission, provided
- you inform other peers where the object code and Corresponding
- Source of the work are being offered to the general public at no
- charge under subsection 6d.
-
- A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
- A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling. In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage. For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product. A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
- "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source. The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
- If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information. But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
- The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed. Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
- Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
- 7. Additional Terms.
-
- "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law. If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
- When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it. (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.) You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
- Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
- a) Disclaiming warranty or limiting liability differently from the
- terms of sections 15 and 16 of this License; or
-
- b) Requiring preservation of specified reasonable legal notices or
- author attributions in that material or in the Appropriate Legal
- Notices displayed by works containing it; or
-
- c) Prohibiting misrepresentation of the origin of that material, or
- requiring that modified versions of such material be marked in
- reasonable ways as different from the original version; or
-
- d) Limiting the use for publicity purposes of names of licensors or
- authors of the material; or
-
- e) Declining to grant rights under trademark law for use of some
- trade names, trademarks, or service marks; or
-
- f) Requiring indemnification of licensors and authors of that
- material by anyone who conveys the material (or modified versions of
- it) with contractual assumptions of liability to the recipient, for
- any liability that these contractual assumptions directly impose on
- those licensors and authors.
-
- All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10. If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term. If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
- If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
- Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
- 8. Termination.
-
- You may not propagate or modify a covered work except as expressly
-provided under this License. Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
- However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
- Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
- Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License. If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
- 9. Acceptance Not Required for Having Copies.
-
- You are not required to accept this License in order to receive or
-run a copy of the Program. Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance. However,
-nothing other than this License grants you permission to propagate or
-modify any covered work. These actions infringe copyright if you do
-not accept this License. Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
- 10. Automatic Licensing of Downstream Recipients.
-
- Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License. You are not responsible
-for enforcing compliance by third parties with this License.
-
- An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations. If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
- You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License. For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
- 11. Patents.
-
- A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based. The
-work thus licensed is called the contributor's "contributor version".
-
- A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version. For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
- Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
- In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement). To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
- If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients. "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
- If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
- A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License. You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
- Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
- 12. No Surrender of Others' Freedom.
-
- If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all. For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
- 13. Use with the GNU Affero General Public License.
-
- Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work. The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
- 14. Revised Versions of this License.
-
- The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation. If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
- If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
- Later license versions may give you additional or different
-permissions. However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
- 15. Disclaimer of Warranty.
-
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. Limitation of Liability.
-
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
- 17. Interpretation of Sections 15 and 16.
-
- If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
- If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
- <program> Copyright (C) <year> <name of author>
- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
- You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-<http://www.gnu.org/licenses/>.
-
- The GNU General Public License does not permit incorporating your program
-into proprietary programs. If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License. But first, please read
-<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/LICENSE.LGPLv21 b/LICENSE.LGPLv21
deleted file mode 100644
index dfcab5e29b..0000000000
--- a/LICENSE.LGPLv21
+++ /dev/null
@@ -1,514 +0,0 @@
- GNU LESSER GENERAL PUBLIC LICENSE
-
- The Qt Toolkit is Copyright (C) 2015 The Qt Company Ltd.
- Contact: http://www.qt.io/licensing/
-
- You may use, distribute and copy the Qt Toolkit under the terms of
- GNU Lesser General Public License version 2.1, which is displayed below.
-
--------------------------------------------------------------------------
-
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL. It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
- This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it. You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
- When we speak of free software, we are referring to freedom of use,
-not price. Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
- To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights. These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
- For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you. You must make sure that they, too, receive or can get the source
-code. If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it. And you must show them these terms so they know their rights.
-
- We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
- To protect each distributor, we want to make it very clear that
-there is no warranty for the free library. Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
- Finally, software patents pose a constant threat to the existence of
-any free program. We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder. Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
- Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License. This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License. We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
- When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library. The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom. The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
- We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License. It also provides other free software developers Less
-of an advantage over competing non-free programs. These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries. However, the Lesser license provides advantages in certain
-special circumstances.
-
- For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard. To achieve this, non-free programs must be
-allowed to use the library. A more frequent case is that a free
-library does the same job as widely used non-free libraries. In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
- In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software. For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
- Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
- The precise terms and conditions for copying, distribution and
-modification follow. Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library". The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
- GNU LESSER GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
- A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
- The "Library", below, refers to any such software library or work
-which has been distributed under these terms. A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language. (Hereinafter, translation is
-included without limitation in the term "modification".)
-
- "Source code" for a work means the preferred form of the work for
-making modifications to it. For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
- Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it). Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
- 1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
- You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
- 2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) The modified work must itself be a software library.
-
- b) You must cause the files modified to carry prominent notices
- stating that you changed the files and the date of any change.
-
- c) You must cause the whole of the work to be licensed at no
- charge to all third parties under the terms of this License.
-
- d) If a facility in the modified Library refers to a function or a
- table of data to be supplied by an application program that uses
- the facility, other than as an argument passed when the facility
- is invoked, then you must make a good faith effort to ensure that,
- in the event an application does not supply such function or
- table, the facility still operates, and performs whatever part of
- its purpose remains meaningful.
-
- (For example, a function in a library to compute square roots has
- a purpose that is entirely well-defined independent of the
- application. Therefore, Subsection 2d requires that any
- application-supplied function or table used by this function must
- be optional: if the application does not supply it, the square
- root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library. To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License. (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.) Do not make any other change in
-these notices.
-
- Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
- This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
- 4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
- If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library". Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
- However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library". The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
- When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library. The
-threshold for this to be true is not precisely defined by law.
-
- If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work. (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
- Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
- 6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
- You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License. You must supply a copy of this License. If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License. Also, you must do one
-of these things:
-
- a) Accompany the work with the complete corresponding
- machine-readable source code for the Library including whatever
- changes were used in the work (which must be distributed under
- Sections 1 and 2 above); and, if the work is an executable linked
- with the Library, with the complete machine-readable "work that
- uses the Library", as object code and/or source code, so that the
- user can modify the Library and then relink to produce a modified
- executable containing the modified Library. (It is understood
- that the user who changes the contents of definitions files in the
- Library will not necessarily be able to recompile the application
- to use the modified definitions.)
-
- b) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (1) uses at run time a
- copy of the library already present on the user's computer system,
- rather than copying library functions into the executable, and (2)
- will operate properly with a modified version of the library, if
- the user installs one, as long as the modified version is
- interface-compatible with the version that the work was made with.
-
- c) Accompany the work with a written offer, valid for at
- least three years, to give the same user the materials
- specified in Subsection 6a, above, for a charge no more
- than the cost of performing this distribution.
-
- d) If distribution of the work is made by offering access to copy
- from a designated place, offer equivalent access to copy the above
- specified materials from the same place.
-
- e) Verify that the user has already received a copy of these
- materials or that you have already sent this user a copy.
-
- For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it. However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
- It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system. Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
- 7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities. This must be distributed under the terms of the
- Sections above.
-
- b) Give prominent notice with the combined library of the fact
- that part of it is a work based on the Library, and explaining
- where to find the accompanying uncombined form of the same work.
-
- 8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License. Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License. However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
- 9. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Library or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
- 10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
- 11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all. For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded. In such case, this License incorporates the limitation as if
-written in the body of this License.
-
- 13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation. If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
- 14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission. For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this. Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
- NO WARRANTY
-
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Libraries
-
- If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change. You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
- To apply these terms, attach the following notices to the library. It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
- <one line to give the library's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the
- library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
- <signature of Ty Coon>, 1 April 1990
- Ty Coon, President of Vice
-
-That's all there is to it!
-
-
diff --git a/LICENSE.LGPLv3 b/LICENSE.LGPLv3
deleted file mode 100644
index 6bf924cd15..0000000000
--- a/LICENSE.LGPLv3
+++ /dev/null
@@ -1,175 +0,0 @@
- GNU LESSER GENERAL PUBLIC LICENSE
-
- The Qt Toolkit is Copyright (C) 2015 The Qt Company Ltd.
- Contact: http://www.qt.io/licensing/
-
- You may use, distribute and copy the Qt Toolkit under the terms of
- GNU Lesser General Public License version 3, which is displayed below.
- This license makes reference to the version 3 of the GNU General
- Public License, which you can find in the LICENSE.GPLv3 file.
-
--------------------------------------------------------------------------
-
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>
-Everyone is permitted to copy and distribute verbatim copies of this
-licensedocument, but changing it is not allowed.
-
-This version of the GNU Lesser General Public License incorporates
-the terms and conditions of version 3 of the GNU General Public
-License, supplemented by the additional permissions listed below.
-
-0. Additional Definitions.
-
- As used herein, “this License” refers to version 3 of the GNU Lesser
-General Public License, and the “GNU GPL” refers to version 3 of the
-GNU General Public License.
-
- “The Library” refers to a covered work governed by this License,
-other than an Application or a Combined Work as defined below.
-
- An “Application” is any work that makes use of an interface provided
-by the Library, but which is not otherwise based on the Library.
-Defining a subclass of a class defined by the Library is deemed a mode
-of using an interface provided by the Library.
-
- A “Combined Work” is a work produced by combining or linking an
-Application with the Library. The particular version of the Library
-with which the Combined Work was made is also called the “Linked
-Version”.
-
- The “Minimal Corresponding Source” for a Combined Work means the
-Corresponding Source for the Combined Work, excluding any source code
-for portions of the Combined Work that, considered in isolation, are
-based on the Application, and not on the Linked Version.
-
- The “Corresponding Application Code” for a Combined Work means the
-object code and/or source code for the Application, including any data
-and utility programs needed for reproducing the Combined Work from the
-Application, but excluding the System Libraries of the Combined Work.
-
-1. Exception to Section 3 of the GNU GPL.
-
- You may convey a covered work under sections 3 and 4 of this License
-without being bound by section 3 of the GNU GPL.
-
-2. Conveying Modified Versions.
-
- If you modify a copy of the Library, and, in your modifications, a
-facility refers to a function or data to be supplied by an Application
-that uses the facility (other than as an argument passed when the
-facility is invoked), then you may convey a copy of the modified
-version:
-
- a) under this License, provided that you make a good faith effort
- to ensure that, in the event an Application does not supply the
- function or data, the facility still operates, and performs
- whatever part of its purpose remains meaningful, or
-
- b) under the GNU GPL, with none of the additional permissions of
- this License applicable to that copy.
-
-3. Object Code Incorporating Material from Library Header Files.
-
- The object code form of an Application may incorporate material from
-a header file that is part of the Library. You may convey such object
-code under terms of your choice, provided that, if the incorporated
-material is not limited to numerical parameters, data structure
-layouts and accessors, or small macros, inline functions and templates
-(ten or fewer lines in length), you do both of the following:
-
- a) Give prominent notice with each copy of the object code that
- the Library is used in it and that the Library and its use are
- covered by this License.
-
- b) Accompany the object code with a copy of the GNU GPL and this
- license document.
-
-4. Combined Works.
-
- You may convey a Combined Work under terms of your choice that, taken
-together, effectively do not restrict modification of the portions of
-the Library contained in the Combined Work and reverse engineering for
-debugging such modifications, if you also do each of the following:
-
- a) Give prominent notice with each copy of the Combined Work that
- the Library is used in it and that the Library and its use are
- covered by this License.
-
- b) Accompany the Combined Work with a copy of the GNU GPL and this
- license document.
-
- c) For a Combined Work that displays copyright notices during
- execution, include the copyright notice for the Library among
- these notices, as well as a reference directing the user to the
- copies of the GNU GPL and this license document.
-
- d) Do one of the following:
-
- 0) Convey the Minimal Corresponding Source under the terms of
- this License, and the Corresponding Application Code in a form
- suitable for, and under terms that permit, the user to
- recombine or relink the Application with a modified version of
- the Linked Version to produce a modified Combined Work, in the
- manner specified by section 6 of the GNU GPL for conveying
- Corresponding Source.
-
- 1) Use a suitable shared library mechanism for linking with
- the Library. A suitable mechanism is one that (a) uses at run
- time a copy of the Library already present on the user's
- computer system, and (b) will operate properly with a modified
- version of the Library that is interface-compatible with the
- Linked Version.
-
- e) Provide Installation Information, but only if you would
- otherwise be required to provide such information under section 6
- of the GNU GPL, and only to the extent that such information is
- necessary to install and execute a modified version of the
- Combined Work produced by recombining or relinking the Application
- with a modified version of the Linked Version. (If you use option
- 4d0, the Installation Information must accompany the Minimal
- Corresponding Source and Corresponding Application Code. If you
- use option 4d1, you must provide the Installation Information in
- the manner specified by section 6 of the GNU GPL for conveying
- Corresponding Source.)
-
-5. Combined Libraries.
-
- You may place library facilities that are a work based on the Library
-side by side in a single library together with other library
-facilities that are not Applications and are not covered by this
-License, and convey such a combined library under terms of your
-choice, if you do both of the following:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities, conveyed under the terms of this License.
-
- b) Give prominent notice with the combined library that part of
- it is a work based on the Library, and explaining where to find
- the accompanying uncombined form of the same work.
-
-6. Revised Versions of the GNU Lesser General Public License.
-
- The Free Software Foundation may publish revised and/or new versions
-of the GNU Lesser General Public License from time to time. Such new
-versions will be similar in spirit to the present version, but may
-differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-as you received it specifies that a certain numbered version of the
-GNU Lesser General Public License “or any later version” applies to
-it, you have the option of following the terms and conditions either
-of that published version or of any later version published by the
-Free Software Foundation. If the Library as you received it does not
-specify a version number of the GNU Lesser General Public License,
-you may choose any version of the GNU Lesser General Public License
-ever published by the Free Software Foundation.
-
-If the Library as you received it specifies that a proxy can decide
-whether future versions of the GNU Lesser General Public License shall
-apply, that proxy's public statement of acceptance of any version is
-permanent authorization for you to choose that version for the Library.
-
diff --git a/dist/changes-5.9.0 b/dist/changes-5.9.0
new file mode 100644
index 0000000000..7cd655e384
--- /dev/null
+++ b/dist/changes-5.9.0
@@ -0,0 +1,123 @@
+Qt 5.9 introduces many new features and improvements as well as bugfixes
+over the 5.8.x series. For more details, refer to the online documentation
+included in this distribution. The documentation is also available online:
+
+ http://doc.qt.io/qt-5/index.html
+
+The Qt version 5.9 series is binary compatible with the 5.8.x series.
+Applications compiled for 5.8 will continue to run with 5.9.
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Qt Bug Tracker:
+
+ https://bugreports.qt.io/
+
+Each of these identifiers can be entered in the bug tracker to obtain more
+information about a particular change.
+
+****************************************************************************
+* Important Behavior Changes *
+****************************************************************************
+
+* qmlInfo now reports messages with a QtMsgType of QtInfoMsg instead of
+ QtWarningMsg. To continue to send warnings, callers should migrate to
+ the newly-introduced qmlWarning function.
+
+****************************************************************************
+* Library *
+****************************************************************************
+
+QtQml
+-----
+
+ - The garbage collector has been rewritten to provide better memory
+ consumption, and improved, more predictable performance for JavaScript code.
+ - Array.prototype.find and Array.prototype.findIndex from ES6 are now implemented.
+ - Introduced qmlRegisterModule() that can be used to make a certain module
+ version available, even if no types or revisions are registered for that
+ version.
+ - Introduced qmlDebug & qmlWarning functions to qqmlinfo.h, in addition to
+ the pre-existing qmlInfo function. As a side effect, QQmlError has also
+ gained messageType() and setMessageType().
+ - [QTBUG-52013] Added QQmlEngine::offlineStorageDatabaseFilePath(dbName)
+ to allow getting the actual storage path for a particular database.
+ - [QTBUG-53091] Introduced Qt.application.displayName, to map the
+ QGuiApplication::applicationDisplayName property to QML.
+ - [QTBUG-45316] QML Settings has been fixed to handle JavaScript arrays.
+
+QtQuick
+-------
+
+ - Global:
+ * Improved stability of Animator's internals.
+ * [QTBUG-55496] Added a disk cache for OpenGL shaders to QtQuick.
+ * [QTBUG-58845] QWheelEvent delivered to all QQuickItems will now have a
+ correct global position.
+ * [QTBUG-57910] Touch events are now correctly ungrabbed if the touch event
+ was stolen by a parent item, such as a Flickable.
+ * [QTBUG-57098] Added Keys::shortcutOverride signal to allow prevention of
+ e.g. Shortcut from stealing key events.
+ * [QTBUG-56279] Added a shared memory image provider to conserve memory
+ when several processes use the same local image files.
+
+ - Window:
+ * [QTBUG-60232] Added QQuickWindow::sceneGraphBackend() to allow querying
+ which scene graph rendering backend is in use.
+ * [QTBUG-56115] Added a screen property to Window, which can be used to
+ declaratively associate a window with a specific screen. This is useful on
+ multi-screen embedded systems. Added Qt.application.screens as an array of
+ screens from which one can be chosen to assign to a Window. Added virtualX
+ and virtualY properties to Screen to enable querying the screen's position
+ within the virtual desktop.
+
+ - Items:
+ * [QTBUG-38515] Added horizontalOvershoot and verticalOvershoot
+ properties to Flickable, for use in implementing custom boundary actions and effects.
+ * [QTBUG-44762] Added a forceLayout method to Positioner types (Column, Row,
+ Flow, Grid) to force positioning of children to happen earlier. Additionally,
+ a positioningComplete signal has been added.
+ * [QTBUG-57203] Added TextInput::textEdited signal to distinguish user edits from
+ programmatical text changes.
+ * [QTBUG-42074][QTBUG-57003] Added support for characters in Private Use Area,
+ as well as zero-width joiners and zero-width non-joiners for TextInput and
+ TextEdit.
+ * [QTBUG-47662] Added MouseArea::pressAndHoldInterval to allow control over the
+ elapsed time before the pressAndHold signal is emitted.
+ * Item::grabToImage on an Image element will now work regardless of the
+ Image's sourceSize or cache properties.
+ * [QTBUG-52553][QTBUG-56501] Made it possible to enable horizontal
+ flicking in a vertical ListView, and vice versa. The only thing apps
+ must do is to specify the desired flick direction and the content
+ width (vertical ListView) or content height (horizontal ListView),
+ which is not calculated by ListView.
+ * Added Shortcut::sequences, to provide support for multiple different shortcut
+ sequences in a single Shortcut.
+ * Added rotation, ellipseDiameters and uniqueId properties to
+ MultiPointTouchArea.TouchPoint, and deprecated the area property.
+ A TouchPoint is now modeled as an ellipse centered on a point,
+ possibly rotated, depending on what the hardware and drivers support.
+ Android and the TUIO plugin support rotation and ellipseDiameters, for example.
+ The uniqueId is so far applicable only to the use of fiducials (tokens,
+ knobs or game pieces with hardware-based identification) on a TUIO touch surface.
+
+ - Accessibility:
+ * [QTBUG-58340] Fixed focus handling so that keyboard and VoiceOver's
+ virtual focus are in sync (QTBUG-58340).
+
+ - Text:
+ * Deprecated doLayout() in favor of forceLayout(), to improve consistency now
+ that more types (Positioners, Layouts, etc) have a forceLayout() method.
+ * [QTBUG-51133] Added fontInfo property to Text type, providing a way to
+ query properties of the actual font used for presenting the text.
+ * [QTBUG-58852] Text items with a renderType of Text.NativeRendering will no
+ longer stop rendering with a large number of characters.
+
+
+QtTest
+------
+
+ - [QTBUG-23083] Added TestCase::touchEvent to support simulating touch events
+ in tests.
+ - [QTBUG-56361] Added createTemporaryObject() and createTemporaryQmlObject()
+ functions to ensure that dynamically created objects can be destroyed at the
+ end of each test function.
diff --git a/examples/qml/xmlhttprequest/Get.qml b/examples/qml/xmlhttprequest/Get.qml
new file mode 100644
index 0000000000..eb95b3dc93
--- /dev/null
+++ b/examples/qml/xmlhttprequest/Get.qml
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+import "methods.js" as Utils
+
+GetForm
+{
+ anchors.fill: parent
+
+ mouseArea.onClicked: Utils.makeRequest()
+
+ button.border.width: button.pressed ? 2 : 1
+ text.text: "Request data.xml"
+
+}
diff --git a/examples/qml/xmlhttprequest/get.qml b/examples/qml/xmlhttprequest/GetForm.ui.qml
index d8cde5aa15..4578601fab 100644
--- a/examples/qml/xmlhttprequest/get.qml
+++ b/examples/qml/xmlhttprequest/GetForm.ui.qml
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2017 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the examples of the Qt Toolkit.
@@ -40,55 +40,33 @@
import QtQuick 2.0
+
Rectangle {
- width: 350; height: 400
+ id:rect
+ width: 350
+ height: 400
- function showRequestInfo(text) {
- log.text = log.text + "\n" + text
- console.log(text)
- }
+ property alias button: button
+ property alias text: buttonText
+ property alias mouseArea: mouseArea
+ property alias msg: ttext
- Text { id: log; anchors.fill: parent; anchors.margins: 10 }
+ Text { id: ttext; anchors.fill: parent; anchors.margins: 10 }
Rectangle {
id: button
- anchors.horizontalCenter: parent.horizontalCenter; anchors.bottom: parent.bottom; anchors.margins: 10
- width: buttonText.width + 10; height: buttonText.height + 10
- border.width: mouseArea.pressed ? 2 : 1
+ anchors.horizontalCenter: parent.horizontalCenter;
+ anchors.bottom: parent.bottom
+ anchors.margins: 10
+ width: buttonText.width + 10
+ height: buttonText.height + 10
radius : 5; antialiasing: true
- Text { id: buttonText; anchors.centerIn: parent; text: "Request data.xml" }
+ Text { id: buttonText; anchors.centerIn: parent }
MouseArea {
id: mouseArea
anchors.fill: parent
- onClicked: {
- log.text = ""
- console.log("\n")
-
- var doc = new XMLHttpRequest();
- doc.onreadystatechange = function() {
- if (doc.readyState == XMLHttpRequest.HEADERS_RECEIVED) {
- showRequestInfo("Headers -->");
- showRequestInfo(doc.getAllResponseHeaders ());
- showRequestInfo("Last modified -->");
- showRequestInfo(doc.getResponseHeader ("Last-Modified"));
-
- } else if (doc.readyState == XMLHttpRequest.DONE) {
- var a = doc.responseXML.documentElement;
- for (var ii = 0; ii < a.childNodes.length; ++ii) {
- showRequestInfo(a.childNodes[ii].nodeName);
- }
- showRequestInfo("Headers -->");
- showRequestInfo(doc.getAllResponseHeaders ());
- showRequestInfo("Last modified -->");
- showRequestInfo(doc.getResponseHeader ("Last-Modified"));
- }
- }
-
- doc.open("GET", "data.xml");
- doc.send();
- }
}
}
}
diff --git a/examples/qml/xmlhttprequest/methods.js b/examples/qml/xmlhttprequest/methods.js
new file mode 100644
index 0000000000..a286846f50
--- /dev/null
+++ b/examples/qml/xmlhttprequest/methods.js
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+function showRequestInfo(text) {
+ msg.text = msg.text + "\n" + text
+}
+
+function makeRequest()
+{
+
+ var doc = new XMLHttpRequest();
+ msg.text = "";
+ doc.onreadystatechange = function() {
+ if (doc.readyState == XMLHttpRequest.HEADERS_RECEIVED) {
+ showRequestInfo("Headers -->");
+ showRequestInfo(doc.getAllResponseHeaders ());
+ showRequestInfo("Last modified -->");
+ showRequestInfo(doc.getResponseHeader ("Last-Modified"));
+
+ } else if (doc.readyState == XMLHttpRequest.DONE) {
+ var a = doc.responseXML.documentElement;
+ for (var ii = 0; ii < a.childNodes.length; ++ii) {
+ showRequestInfo(a.childNodes[ii].nodeName);
+ }
+ showRequestInfo("Headers -->");
+ showRequestInfo(doc.getAllResponseHeaders ());
+ showRequestInfo("Last modified -->");
+ showRequestInfo(doc.getResponseHeader ("Last-Modified"));
+ }
+ }
+
+ doc.open("GET", "data.xml");
+ doc.send();
+}
diff --git a/examples/qml/xmlhttprequest/xmlhttprequest.pro b/examples/qml/xmlhttprequest/xmlhttprequest.pro
index 3e20d3781c..3b78db0252 100644
--- a/examples/qml/xmlhttprequest/xmlhttprequest.pro
+++ b/examples/qml/xmlhttprequest/xmlhttprequest.pro
@@ -11,3 +11,8 @@ EXAMPLE_FILES = \
target.path = $$[QT_INSTALL_EXAMPLES]/qml/xmlhttprequest
INSTALLS += target
+
+DISTFILES += \
+ Get.qml \
+ GetForm.ui.qml \
+ methods.js
diff --git a/examples/qml/xmlhttprequest/xmlhttprequest.qml b/examples/qml/xmlhttprequest/xmlhttprequest.qml
index f38316d054..a071efd729 100644
--- a/examples/qml/xmlhttprequest/xmlhttprequest.qml
+++ b/examples/qml/xmlhttprequest/xmlhttprequest.qml
@@ -48,7 +48,7 @@ Item {
id: ll
anchors.fill: parent
Component.onCompleted: {
- addExample("Get data", "Send get request and show received header and body", Qt.resolvedUrl("get.qml"));
+ addExample("Get data", "Send get request and show received header and body", Qt.resolvedUrl("Get.qml"));
}
}
}
diff --git a/examples/qml/xmlhttprequest/xmlhttprequest.qrc b/examples/qml/xmlhttprequest/xmlhttprequest.qrc
index 532e508a90..2e5dae4bb8 100644
--- a/examples/qml/xmlhttprequest/xmlhttprequest.qrc
+++ b/examples/qml/xmlhttprequest/xmlhttprequest.qrc
@@ -1,7 +1,9 @@
<RCC>
<qresource prefix="/qml/xmlhttprequest">
<file>xmlhttprequest.qml</file>
- <file>get.qml</file>
<file>data.xml</file>
+ <file>methods.js</file>
+ <file>Get.qml</file>
+ <file>GetForm.ui.qml</file>
</qresource>
</RCC>
diff --git a/examples/quick/demos/samegame/samegame.pro b/examples/quick/demos/samegame/samegame.pro
index 0f01654d46..7b680490ad 100644
--- a/examples/quick/demos/samegame/samegame.pro
+++ b/examples/quick/demos/samegame/samegame.pro
@@ -6,5 +6,3 @@ RESOURCES += samegame.qrc
target.path = $$[QT_INSTALL_EXAMPLES]/quick/demos/samegame
INSTALLS += target
-
-!qtConfig(sql-sqlite): QTPLUGIN += qsqlite
diff --git a/examples/quick/shared/LauncherList.qml b/examples/quick/shared/LauncherList.qml
index 6878cf01f2..ba9ee6c5d2 100644
--- a/examples/quick/shared/LauncherList.qml
+++ b/examples/quick/shared/LauncherList.qml
@@ -1,5 +1,6 @@
/****************************************************************************
**
+** Copyright (C) 2017 Crimson AS <info@crimson.no>
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
@@ -40,6 +41,8 @@
import QtQuick 2.0
Rectangle {
+ property int activePageCount: 0
+
//model is a list of {"name":"somename", "url":"file:///some/url/mainfile.qml"}
//function used to add to model A) to enforce scheme B) to allow Qt.resolveUrl in url assignments
@@ -48,48 +51,138 @@ Rectangle {
{
myModel.append({"name":name, "description":desc, "url":url})
}
- function hideExample()
- {
- ei.visible = false;
- }
- ListView {
- clip: true
- delegate: SimpleLauncherDelegate{exampleItem: ei}
- model: ListModel {id:myModel}
+ // The container rectangle here is used to give a nice "feel" when
+ // transitioning into an example.
+ Rectangle {
anchors.fill: parent
+ color: "black"
+
+ ListView {
+ id: launcherList
+ clip: true
+ delegate: SimpleLauncherDelegate{
+ onClicked: {
+ var page = pageComponent.createObject(pageContainer, { exampleUrl: url })
+ page.show()
+ }
+ }
+ model: ListModel {id:myModel}
+ anchors.fill: parent
+ enabled: opacity == 1.0
+ }
}
Item {
- id: ei
- visible: false
- clip: true
- property url exampleUrl
- onExampleUrlChanged: visible = (exampleUrl == '' ? false : true); //Setting exampleUrl automatically shows example
+ id: pageContainer
anchors.fill: parent
- anchors.bottomMargin: 40
+ }
+
+ Component {
+ id: pageComponent
Rectangle {
- id: bg
- anchors.fill: parent
+ id: page
+ clip: true
+ property url exampleUrl
+ width: parent.width
+ height: parent.height - bar.height
color: "white"
- }
- MouseArea{
- anchors.fill: parent
- enabled: ei.visible
- //Eats mouse events
- }
- Loader{
- focus: true
- source: ei.exampleUrl
- anchors.fill: parent
+ MouseArea{
+ //Eats mouse events
+ anchors.fill: parent
+ }
+ Loader{
+ focus: true
+ source: parent.exampleUrl
+ anchors.fill: parent
+ }
+
+ x: -width
+
+ function show() {
+ showAnim.start()
+ }
+
+ function exit() {
+ exitAnim.start()
+ }
+
+ ParallelAnimation {
+ id: showAnim
+ ScriptAction {
+ script: activePageCount++
+ }
+ NumberAnimation {
+ target: launcherList
+ property: "opacity"
+ from: 1.0
+ to: 0.0
+ duration: 500
+ }
+ NumberAnimation {
+ target: launcherList
+ property: "scale"
+ from: 1.0
+ to: 0.0
+ duration: 500
+ }
+ NumberAnimation {
+ target: page
+ property: "x"
+ from: -page.width
+ to: 0
+ duration: 300
+ }
+ }
+ SequentialAnimation {
+ id: exitAnim
+
+ ScriptAction {
+ script: activePageCount--
+ }
+
+ ParallelAnimation {
+ NumberAnimation {
+ target: launcherList
+ property: "opacity"
+ from: 0.0
+ to: 1.0
+ duration: 300
+ }
+ NumberAnimation {
+ target: launcherList
+ property: "scale"
+ from: 0.0
+ to: 1.0
+ duration: 300
+ }
+ NumberAnimation {
+ target: page
+ property: "x"
+ from: 0
+ to: -page.width
+ duration: 300
+ }
+ }
+
+ ScriptAction {
+ script: page.destroy()
+ }
+ }
}
}
Rectangle {
id: bar
- visible: ei.visible
+ visible: height > 0
anchors.bottom: parent.bottom
width: parent.width
- height: 40
+ height: activePageCount > 0 ? 40 : 0
+
+ Behavior on height {
+ NumberAnimation {
+ duration: 300
+ }
+ }
Rectangle {
height: 1
@@ -113,12 +206,6 @@ Rectangle {
GradientStop { position: 1 ; color: "#ccc" }
}
- MouseArea{
- anchors.fill: parent
- enabled: ei.visible
- //Eats mouse events
- }
-
Image {
id: back
source: "images/back.png"
@@ -134,7 +221,10 @@ Rectangle {
width: 38
height: 31
anchors.verticalCenterOffset: -1
- onClicked: ei.exampleUrl = ""
+ enabled: activePageCount > 0
+ onClicked: {
+ pageContainer.children[pageContainer.children.length - 1].exit()
+ }
Rectangle {
anchors.fill: parent
opacity: mouse.pressed ? 1 : 0
diff --git a/examples/quick/shared/SimpleLauncherDelegate.qml b/examples/quick/shared/SimpleLauncherDelegate.qml
index 885afdb502..a9f7cb9f83 100644
--- a/examples/quick/shared/SimpleLauncherDelegate.qml
+++ b/examples/quick/shared/SimpleLauncherDelegate.qml
@@ -45,6 +45,8 @@ Rectangle {
width: ListView.view.width
height: button.implicitHeight + 22
+ signal clicked()
+
gradient: Gradient {
GradientStop {
position: 0
@@ -81,7 +83,7 @@ Rectangle {
MouseArea {
id: mouseArea
anchors.fill: parent
- onClicked: exampleItem.exampleUrl = url
+ onClicked: container.clicked()
hoverEnabled: true
}
diff --git a/src/3rdparty/masm/assembler/ARMv7Assembler.h b/src/3rdparty/masm/assembler/ARMv7Assembler.h
index 615c72fc15..d57e5a7c78 100644
--- a/src/3rdparty/masm/assembler/ARMv7Assembler.h
+++ b/src/3rdparty/masm/assembler/ARMv7Assembler.h
@@ -2531,12 +2531,18 @@ private:
return (instruction[0] == OP_NOP_T2a) && (instruction[1] == OP_NOP_T2b);
}
+ static int32_t makeRelative(const void *target, const void *source)
+ {
+ intptr_t difference = reinterpret_cast<intptr_t>(target) - reinterpret_cast<intptr_t>(source);
+ return static_cast<int32_t>(difference);
+ }
+
static bool canBeJumpT1(const uint16_t* instruction, const void* target)
{
ASSERT(!(reinterpret_cast<intptr_t>(instruction) & 1));
ASSERT(!(reinterpret_cast<intptr_t>(target) & 1));
- intptr_t relative = reinterpret_cast<intptr_t>(target) - (reinterpret_cast<intptr_t>(instruction));
+ auto relative = makeRelative(target, instruction);
// It does not appear to be documented in the ARM ARM (big surprise), but
// for OP_B_T1 the branch displacement encoded in the instruction is 2
// less than the actual displacement.
@@ -2549,7 +2555,7 @@ private:
ASSERT(!(reinterpret_cast<intptr_t>(instruction) & 1));
ASSERT(!(reinterpret_cast<intptr_t>(target) & 1));
- intptr_t relative = reinterpret_cast<intptr_t>(target) - (reinterpret_cast<intptr_t>(instruction));
+ auto relative = makeRelative(target, instruction);
// It does not appear to be documented in the ARM ARM (big surprise), but
// for OP_B_T2 the branch displacement encoded in the instruction is 2
// less than the actual displacement.
@@ -2562,7 +2568,7 @@ private:
ASSERT(!(reinterpret_cast<intptr_t>(instruction) & 1));
ASSERT(!(reinterpret_cast<intptr_t>(target) & 1));
- intptr_t relative = reinterpret_cast<intptr_t>(target) - (reinterpret_cast<intptr_t>(instruction));
+ auto relative = makeRelative(target, instruction);
return ((relative << 11) >> 11) == relative;
}
@@ -2571,7 +2577,7 @@ private:
ASSERT(!(reinterpret_cast<intptr_t>(instruction) & 1));
ASSERT(!(reinterpret_cast<intptr_t>(target) & 1));
- intptr_t relative = reinterpret_cast<intptr_t>(target) - (reinterpret_cast<intptr_t>(instruction));
+ auto relative = makeRelative(target, instruction);
return ((relative << 7) >> 7) == relative;
}
@@ -2582,7 +2588,7 @@ private:
ASSERT(!(reinterpret_cast<intptr_t>(target) & 1));
ASSERT(canBeJumpT1(instruction, target));
- intptr_t relative = reinterpret_cast<intptr_t>(target) - (reinterpret_cast<intptr_t>(instruction));
+ auto relative = makeRelative(target, instruction);
// It does not appear to be documented in the ARM ARM (big surprise), but
// for OP_B_T1 the branch displacement encoded in the instruction is 2
// less than the actual displacement.
@@ -2600,7 +2606,7 @@ private:
ASSERT(!(reinterpret_cast<intptr_t>(target) & 1));
ASSERT(canBeJumpT2(instruction, target));
- intptr_t relative = reinterpret_cast<intptr_t>(target) - (reinterpret_cast<intptr_t>(instruction));
+ auto relative = makeRelative(target, instruction);
// It does not appear to be documented in the ARM ARM (big surprise), but
// for OP_B_T2 the branch displacement encoded in the instruction is 2
// less than the actual displacement.
@@ -2618,7 +2624,7 @@ private:
ASSERT(!(reinterpret_cast<intptr_t>(target) & 1));
ASSERT(canBeJumpT3(instruction, target));
- intptr_t relative = reinterpret_cast<intptr_t>(target) - (reinterpret_cast<intptr_t>(instruction));
+ auto relative = makeRelative(target, instruction);
// All branch offsets should be an even distance.
ASSERT(!(relative & 1));
@@ -2633,7 +2639,7 @@ private:
ASSERT(!(reinterpret_cast<intptr_t>(target) & 1));
ASSERT(canBeJumpT4(instruction, target));
- intptr_t relative = reinterpret_cast<intptr_t>(target) - (reinterpret_cast<intptr_t>(instruction));
+ auto relative = makeRelative(target, instruction);
// ARM encoding for the top two bits below the sign bit is 'peculiar'.
if (relative >= 0)
relative ^= 0xC00000;
diff --git a/src/3rdparty/masm/assembler/MacroAssembler.h b/src/3rdparty/masm/assembler/MacroAssembler.h
index f37861eb66..6e77a9ffb7 100644
--- a/src/3rdparty/masm/assembler/MacroAssembler.h
+++ b/src/3rdparty/masm/assembler/MacroAssembler.h
@@ -248,14 +248,6 @@ public:
}
#endif
-#if CPU(MIPS)
- void poke(FPRegisterID src, int index = 0)
- {
- ASSERT(!(index & 1));
- storeDouble(src, addressForPoke(index));
- }
-#endif
-
// Backwards banches, these are currently all implemented using existing forwards branch mechanisms.
void branchPtr(RelationalCondition cond, RegisterID op1, TrustedImmPtr imm, Label target)
{
diff --git a/src/3rdparty/masm/assembler/MacroAssemblerARM64.h b/src/3rdparty/masm/assembler/MacroAssemblerARM64.h
index 11f1672e15..d5f4acb3ca 100644
--- a/src/3rdparty/masm/assembler/MacroAssemblerARM64.h
+++ b/src/3rdparty/masm/assembler/MacroAssemblerARM64.h
@@ -214,27 +214,27 @@ public:
#if defined(V4_BOOTSTRAP)
void loadPtr(ImplicitAddress address, RegisterID dest)
{
- load32(address, dest);
+ load64(address, dest);
}
void subPtr(TrustedImm32 imm, RegisterID dest)
{
- sub32(imm, dest);
+ sub64(imm, dest);
}
void addPtr(TrustedImm32 imm, RegisterID dest)
{
- add32(imm, dest);
+ add64(imm, dest);
}
void addPtr(TrustedImm32 imm, RegisterID src, RegisterID dest)
{
- add32(imm, src, dest);
+ add64(imm, src, dest);
}
void storePtr(RegisterID src, ImplicitAddress address)
{
- store32(src, address);
+ store64(src, address);
}
#endif
diff --git a/src/imports/builtins/builtins.qmltypes b/src/imports/builtins/builtins.qmltypes
index ac95a8837b..c2f8f5b521 100644
--- a/src/imports/builtins/builtins.qmltypes
+++ b/src/imports/builtins/builtins.qmltypes
@@ -426,7 +426,8 @@ Module {
"WA_X11DoNotAcceptFocus": 126,
"WA_MacNoShadow": 127,
"WA_AlwaysStackOnTop": 128,
- "WA_AttributeCount": 129
+ "WA_TabletTracking": 129,
+ "WA_AttributeCount": 130
}
}
Enum {
diff --git a/src/imports/localstorage/plugin.cpp b/src/imports/localstorage/plugin.cpp
index 40682dd6a8..a7d95cc295 100644
--- a/src/imports/localstorage/plugin.cpp
+++ b/src/imports/localstorage/plugin.cpp
@@ -73,8 +73,8 @@ QT_BEGIN_NAMESPACE
QV4::ScopedString v(scope, scope.engine->newString(desc)); \
QV4::ScopedObject ex(scope, scope.engine->newErrorObject(v)); \
ex->put(QV4::ScopedString(scope, scope.engine->newIdentifier(QStringLiteral("code"))).getPointer(), QV4::ScopedValue(scope, Primitive::fromInt32(error))); \
- ctx->engine()->throwError(ex); \
- return Encode::undefined(); \
+ scope.engine->throwError(ex); \
+ RETURN_UNDEFINED(); \
}
#define V4THROW_SQL2(error, desc) { \
@@ -87,8 +87,8 @@ QT_BEGIN_NAMESPACE
#define V4THROW_REFERENCE(string) { \
QV4::ScopedString v(scope, scope.engine->newString(string)); \
- ctx->engine()->throwReferenceError(v); \
- return Encode::undefined(); \
+ scope.engine->throwReferenceError(v); \
+ RETURN_UNDEFINED(); \
}
@@ -164,20 +164,18 @@ DEFINE_OBJECT_VTABLE(QV4::QQmlSqlDatabaseWrapper);
-static ReturnedValue qmlsqldatabase_version(CallContext *ctx)
+static void qmlsqldatabase_version(const QV4::BuiltinFunction *, QV4::Scope &scope, QV4::CallData *callData)
{
- QV4::Scope scope(ctx);
- QV4::Scoped<QQmlSqlDatabaseWrapper> r(scope, ctx->thisObject().as<QQmlSqlDatabaseWrapper>());
+ QV4::Scoped<QQmlSqlDatabaseWrapper> r(scope, callData->thisObject.as<QQmlSqlDatabaseWrapper>());
if (!r || r->d()->type != Heap::QQmlSqlDatabaseWrapper::Database)
V4THROW_REFERENCE("Not a SQLDatabase object");
- return Encode(scope.engine->newString(*r->d()->version));
+ RETURN_RESULT(Encode(scope.engine->newString(*r->d()->version)));
}
-static ReturnedValue qmlsqldatabase_rows_length(CallContext *ctx)
+static void qmlsqldatabase_rows_length(const QV4::BuiltinFunction *, QV4::Scope &scope, QV4::CallData *callData)
{
- QV4::Scope scope(ctx);
- QV4::Scoped<QQmlSqlDatabaseWrapper> r(scope, ctx->thisObject().as<QQmlSqlDatabaseWrapper>());
+ QV4::Scoped<QQmlSqlDatabaseWrapper> r(scope, callData->thisObject.as<QQmlSqlDatabaseWrapper>());
if (!r || r->d()->type != Heap::QQmlSqlDatabaseWrapper::Rows)
V4THROW_REFERENCE("Not a SQLDatabase::Rows object");
@@ -190,29 +188,27 @@ static ReturnedValue qmlsqldatabase_rows_length(CallContext *ctx)
s = 0;
}
}
- return Encode(s);
+ RETURN_RESULT(Encode(s));
}
-static ReturnedValue qmlsqldatabase_rows_forwardOnly(CallContext *ctx)
+static void qmlsqldatabase_rows_forwardOnly(const QV4::BuiltinFunction *, QV4::Scope &scope, QV4::CallData *callData)
{
- QV4::Scope scope(ctx);
- QV4::Scoped<QQmlSqlDatabaseWrapper> r(scope, ctx->thisObject().as<QQmlSqlDatabaseWrapper>());
+ QV4::Scoped<QQmlSqlDatabaseWrapper> r(scope, callData->thisObject.as<QQmlSqlDatabaseWrapper>());
if (!r || r->d()->type != Heap::QQmlSqlDatabaseWrapper::Rows)
V4THROW_REFERENCE("Not a SQLDatabase::Rows object");
- return Encode(r->d()->sqlQuery->isForwardOnly());
+ RETURN_RESULT(Encode(r->d()->sqlQuery->isForwardOnly()));
}
-static ReturnedValue qmlsqldatabase_rows_setForwardOnly(CallContext *ctx)
+static void qmlsqldatabase_rows_setForwardOnly(const QV4::BuiltinFunction *, QV4::Scope &scope, QV4::CallData *callData)
{
- QV4::Scope scope(ctx);
- QV4::Scoped<QQmlSqlDatabaseWrapper> r(scope, ctx->thisObject().as<QQmlSqlDatabaseWrapper>());
+ QV4::Scoped<QQmlSqlDatabaseWrapper> r(scope, callData->thisObject.as<QQmlSqlDatabaseWrapper>());
if (!r || r->d()->type != Heap::QQmlSqlDatabaseWrapper::Rows)
V4THROW_REFERENCE("Not a SQLDatabase::Rows object");
- if (ctx->argc() < 1)
- return ctx->engine()->throwTypeError();
+ if (callData->argc < 1)
+ RETURN_RESULT(scope.engine->throwTypeError());
- r->d()->sqlQuery->setForwardOnly(ctx->args()[0].toBoolean());
- return Encode::undefined();
+ r->d()->sqlQuery->setForwardOnly(callData->args[0].toBoolean());
+ RETURN_UNDEFINED();
}
QQmlSqlDatabaseData::~QQmlSqlDatabaseData()
@@ -253,14 +249,13 @@ ReturnedValue QQmlSqlDatabaseWrapper::getIndexed(const Managed *m, uint index, b
return qmlsqldatabase_rows_index(r, r->engine(), index, hasProperty);
}
-static ReturnedValue qmlsqldatabase_rows_item(CallContext *ctx)
+static void qmlsqldatabase_rows_item(const QV4::BuiltinFunction *, QV4::Scope &scope, QV4::CallData *callData)
{
- QV4::Scope scope(ctx);
- QV4::Scoped<QQmlSqlDatabaseWrapper> r(scope, ctx->thisObject().as<QQmlSqlDatabaseWrapper>());
+ QV4::Scoped<QQmlSqlDatabaseWrapper> r(scope, callData->thisObject.as<QQmlSqlDatabaseWrapper>());
if (!r || r->d()->type != Heap::QQmlSqlDatabaseWrapper::Rows)
V4THROW_REFERENCE("Not a SQLDatabase::Rows object");
- return qmlsqldatabase_rows_index(r, scope.engine, ctx->argc() ? ctx->args()[0].toUInt32() : 0);
+ RETURN_RESULT(qmlsqldatabase_rows_index(r, scope.engine, callData->argc ? callData->args[0].toUInt32() : 0));
}
static QVariant toSqlVariant(QV4::ExecutionEngine *engine, const QV4::ScopedValue &value)
@@ -272,10 +267,9 @@ static QVariant toSqlVariant(QV4::ExecutionEngine *engine, const QV4::ScopedValu
return engine->toVariant(value, /*typehint*/-1);
}
-static ReturnedValue qmlsqldatabase_executeSql(CallContext *ctx)
+static void qmlsqldatabase_executeSql(const QV4::BuiltinFunction *, QV4::Scope &scope, QV4::CallData *callData)
{
- QV4::Scope scope(ctx);
- QV4::Scoped<QQmlSqlDatabaseWrapper> r(scope, ctx->thisObject().as<QQmlSqlDatabaseWrapper>());
+ QV4::Scoped<QQmlSqlDatabaseWrapper> r(scope, callData->thisObject.as<QQmlSqlDatabaseWrapper>());
if (!r || r->d()->type != Heap::QQmlSqlDatabaseWrapper::Query)
V4THROW_REFERENCE("Not a SQLDatabase::Query object");
@@ -284,7 +278,7 @@ static ReturnedValue qmlsqldatabase_executeSql(CallContext *ctx)
QSqlDatabase db = *r->d()->database;
- QString sql = ctx->argc() ? ctx->args()[0].toQString() : QString();
+ QString sql = callData->argc ? callData->args[0].toQString() : QString();
if (r->d()->readonly && !sql.startsWith(QLatin1String("SELECT"),Qt::CaseInsensitive)) {
V4THROW_SQL(SQLEXCEPTION_SYNTAX_ERR, QQmlEngine::tr("Read-only Transaction"));
@@ -296,8 +290,8 @@ static ReturnedValue qmlsqldatabase_executeSql(CallContext *ctx)
ScopedValue result(scope, Primitive::undefinedValue());
if (query.prepare(sql)) {
- if (ctx->argc() > 1) {
- ScopedValue values(scope, ctx->args()[1]);
+ if (callData->argc > 1) {
+ ScopedValue values(scope, callData->args[1]);
if (values->as<ArrayObject>()) {
ScopedArrayObject array(scope, values);
quint32 size = array->getLength();
@@ -351,7 +345,7 @@ static ReturnedValue qmlsqldatabase_executeSql(CallContext *ctx)
if (err)
V4THROW_SQL(SQLEXCEPTION_DATABASE_ERR,query.lastError().text());
- return result->asReturnedValue();
+ RETURN_RESULT(result->asReturnedValue());
}
struct TransactionRollback {
@@ -383,21 +377,19 @@ struct TransactionRollback {
};
-static ReturnedValue qmlsqldatabase_changeVersion(CallContext *ctx)
+static void qmlsqldatabase_changeVersion(const QV4::BuiltinFunction *, QV4::Scope &scope, QV4::CallData *callData)
{
- if (ctx->argc() < 2)
- return Encode::undefined();
-
- Scope scope(ctx);
+ if (callData->argc < 2)
+ RETURN_UNDEFINED();
- Scoped<QQmlSqlDatabaseWrapper> r(scope, ctx->thisObject());
+ Scoped<QQmlSqlDatabaseWrapper> r(scope, callData->thisObject);
if (!r || r->d()->type != Heap::QQmlSqlDatabaseWrapper::Database)
V4THROW_REFERENCE("Not a SQLDatabase object");
QSqlDatabase db = *r->d()->database;
- QString from_version = ctx->args()[0].toQString();
- QString to_version = ctx->args()[1].toQString();
- ScopedFunctionObject callback(scope, ctx->argument(2));
+ QString from_version = callData->args[0].toQString();
+ QString to_version = callData->args[1].toQString();
+ ScopedFunctionObject callback(scope, callData->argc > 2 ? callData->args[2] : Primitive::undefinedValue());
if (from_version != *r->d()->version)
V4THROW_SQL(SQLEXCEPTION_VERSION_ERR, QQmlEngine::tr("Version mismatch: expected %1, found %2").arg(from_version).arg(*r->d()->version));
@@ -438,17 +430,16 @@ static ReturnedValue qmlsqldatabase_changeVersion(CallContext *ctx)
#endif
}
- return Encode::undefined();
+ RETURN_UNDEFINED();
}
-static ReturnedValue qmlsqldatabase_transaction_shared(CallContext *ctx, bool readOnly)
+static void qmlsqldatabase_transaction_shared(const QV4::BuiltinFunction *, QV4::Scope &scope, QV4::CallData *callData, bool readOnly)
{
- QV4::Scope scope(ctx);
- QV4::Scoped<QQmlSqlDatabaseWrapper> r(scope, ctx->thisObject().as<QQmlSqlDatabaseWrapper>());
+ QV4::Scoped<QQmlSqlDatabaseWrapper> r(scope, callData->thisObject.as<QQmlSqlDatabaseWrapper>());
if (!r || r->d()->type != Heap::QQmlSqlDatabaseWrapper::Database)
V4THROW_REFERENCE("Not a SQLDatabase object");
- const FunctionObject *callback = ctx->argc() ? ctx->args()[0].as<FunctionObject>() : 0;
+ const FunctionObject *callback = callData->argc ? callData->args[0].as<FunctionObject>() : 0;
if (!callback)
V4THROW_SQL(SQLEXCEPTION_UNKNOWN_ERR, QQmlEngine::tr("transaction: missing callback"));
@@ -475,17 +466,17 @@ static ReturnedValue qmlsqldatabase_transaction_shared(CallContext *ctx, bool re
db.rollback();
}
- return Encode::undefined();
+ RETURN_UNDEFINED();
}
-static ReturnedValue qmlsqldatabase_transaction(CallContext *ctx)
+static void qmlsqldatabase_transaction(const QV4::BuiltinFunction *f, QV4::Scope &scope, QV4::CallData *callData)
{
- return qmlsqldatabase_transaction_shared(ctx, false);
+ qmlsqldatabase_transaction_shared(f, scope, callData, false);
}
-static ReturnedValue qmlsqldatabase_read_transaction(CallContext *ctx)
+static void qmlsqldatabase_read_transaction(const QV4::BuiltinFunction *f, QV4::Scope &scope, QV4::CallData *callData)
{
- return qmlsqldatabase_transaction_shared(ctx, true);
+ qmlsqldatabase_transaction_shared(f, scope, callData, true);
}
QQmlSqlDatabaseData::QQmlSqlDatabaseData(ExecutionEngine *v4)
diff --git a/src/imports/qtquick2/plugins.qmltypes b/src/imports/qtquick2/plugins.qmltypes
index a9534b5ccc..834b4bfac2 100644
--- a/src/imports/qtquick2/plugins.qmltypes
+++ b/src/imports/qtquick2/plugins.qmltypes
@@ -1414,7 +1414,7 @@ Module {
Property { name: "source"; type: "QObject"; isPointer: true }
Property { name: "target"; type: "QObject"; isReadonly: true; isPointer: true }
Property { name: "hotSpot"; type: "QPointF" }
- Property { name: "imageSource"; revision: 8; type: "QUrl" }
+ Property { name: "imageSource"; type: "QUrl" }
Property { name: "keys"; type: "QStringList" }
Property { name: "mimeData"; type: "QVariantMap" }
Property { name: "supportedActions"; type: "Qt::DropActions" }
diff --git a/src/imports/settings/qqmlsettings.cpp b/src/imports/settings/qqmlsettings.cpp
index cd6fcbc718..df67c04654 100644
--- a/src/imports/settings/qqmlsettings.cpp
+++ b/src/imports/settings/qqmlsettings.cpp
@@ -41,6 +41,7 @@
#include <qcoreevent.h>
#include <qsettings.h>
#include <qpointer.h>
+#include <qjsvalue.h>
#include <qdebug.h>
#include <qhash.h>
@@ -241,6 +242,7 @@ public:
void store();
void _q_propertyChanged();
+ QVariant readProperty(const QMetaProperty &property) const;
QQmlSettings *q_ptr;
int timerId;
@@ -295,7 +297,7 @@ void QQmlSettingsPrivate::load()
for (int i = offset; i < count; ++i) {
QMetaProperty property = mo->property(i);
- const QVariant previousValue = property.read(q);
+ const QVariant previousValue = readProperty(property);
const QVariant currentValue = instance()->value(property.name(), previousValue);
if (!currentValue.isNull() && (!previousValue.isValid()
@@ -340,9 +342,10 @@ void QQmlSettingsPrivate::_q_propertyChanged()
const int count = mo->propertyCount();
for (int i = offset; i < count; ++i) {
const QMetaProperty &property = mo->property(i);
- changedProperties.insert(property.name(), property.read(q));
+ const QVariant value = readProperty(property);
+ changedProperties.insert(property.name(), value);
#ifdef SETTINGS_DEBUG
- qDebug() << "QQmlSettings: cache" << property.name() << ":" << property.read(q);
+ qDebug() << "QQmlSettings: cache" << property.name() << ":" << value;
#endif
}
if (timerId != 0)
@@ -350,6 +353,15 @@ void QQmlSettingsPrivate::_q_propertyChanged()
timerId = q->startTimer(settingsWriteDelay);
}
+QVariant QQmlSettingsPrivate::readProperty(const QMetaProperty &property) const
+{
+ Q_Q(const QQmlSettings);
+ QVariant var = property.read(q);
+ if (var.userType() == qMetaTypeId<QJSValue>())
+ var = var.value<QJSValue>().toVariant();
+ return var;
+}
+
QQmlSettings::QQmlSettings(QObject *parent)
: QObject(parent), d_ptr(new QQmlSettingsPrivate)
{
diff --git a/src/particles/qquickv4particledata.cpp b/src/particles/qquickv4particledata.cpp
index 967652f31a..e8376f1c27 100644
--- a/src/particles/qquickv4particledata.cpp
+++ b/src/particles/qquickv4particledata.cpp
@@ -296,123 +296,112 @@ public:
QV4::PersistentValue proto;
};
-static QV4::ReturnedValue particleData_discard(QV4::CallContext *ctx)
+static void particleData_discard(const QV4::BuiltinFunction *, QV4::Scope &scope, QV4::CallData *callData)
{
- QV4::Scope scope(ctx);
- QV4::Scoped<QV4ParticleData> r(scope, ctx->thisObject());
+ QV4::Scoped<QV4ParticleData> r(scope, callData->thisObject);
if (!r || !r->d()->datum)
- return ctx->engine()->throwError(QStringLiteral("Not a valid ParticleData object"));
+ RETURN_RESULT(scope.engine->throwError(QStringLiteral("Not a valid ParticleData object")));
r->d()->datum->lifeSpan = 0; //Don't kill(), because it could still be in the middle of being created
- return QV4::Encode::undefined();
+ RETURN_RESULT(QV4::Encode::undefined());
}
-static QV4::ReturnedValue particleData_lifeLeft(QV4::CallContext *ctx)
+static void particleData_lifeLeft(const QV4::BuiltinFunction *, QV4::Scope &scope, QV4::CallData *callData)
{
- QV4::Scope scope(ctx);
- QV4::Scoped<QV4ParticleData> r(scope, ctx->thisObject());
+ QV4::Scoped<QV4ParticleData> r(scope, callData->thisObject);
if (!r || !r->d()->datum)
- return ctx->engine()->throwError(QStringLiteral("Not a valid ParticleData object"));
+ RETURN_RESULT(scope.engine->throwError(QStringLiteral("Not a valid ParticleData object")));
- return QV4::Encode(r->d()->datum->lifeLeft(r->d()->particleSystem));
+ RETURN_RESULT(QV4::Encode(r->d()->datum->lifeLeft(r->d()->particleSystem)));
}
-static QV4::ReturnedValue particleData_curSize(QV4::CallContext *ctx)
+static void particleData_curSize(const QV4::BuiltinFunction *, QV4::Scope &scope, QV4::CallData *callData)
{
- QV4::Scope scope(ctx);
- QV4::Scoped<QV4ParticleData> r(scope, ctx->thisObject());
+ QV4::Scoped<QV4ParticleData> r(scope, callData->thisObject);
if (!r || !r->d()->datum)
- return ctx->engine()->throwError(QStringLiteral("Not a valid ParticleData object"));
+ RETURN_RESULT(scope.engine->throwError(QStringLiteral("Not a valid ParticleData object")));
- return QV4::Encode(r->d()->datum->curSize(r->d()->particleSystem));
+ RETURN_RESULT(QV4::Encode(r->d()->datum->curSize(r->d()->particleSystem)));
}
-#define COLOR_GETTER_AND_SETTER(VAR, NAME) static QV4::ReturnedValue particleData_get_ ## NAME (QV4::CallContext *ctx) \
+#define COLOR_GETTER_AND_SETTER(VAR, NAME) static void particleData_get_ ## NAME (const QV4::BuiltinFunction *, QV4::Scope &scope, QV4::CallData *callData) \
{ \
- QV4::Scope scope(ctx); \
- QV4::Scoped<QV4ParticleData> r(scope, ctx->thisObject()); \
+ QV4::Scoped<QV4ParticleData> r(scope, callData->thisObject); \
if (!r || !r->d()->datum) \
- ctx->engine()->throwError(QStringLiteral("Not a valid ParticleData object")); \
+ RETURN_RESULT(scope.engine->throwError(QStringLiteral("Not a valid ParticleData object"))); \
\
- return QV4::Encode((r->d()->datum->color. VAR )/255.0);\
+ RETURN_RESULT(QV4::Encode((r->d()->datum->color. VAR )/255.0));\
}\
\
-static QV4::ReturnedValue particleData_set_ ## NAME (QV4::CallContext *ctx)\
+static void particleData_set_ ## NAME (const QV4::BuiltinFunction *, QV4::Scope &scope, QV4::CallData *callData)\
{\
- QV4::Scope scope(ctx); \
- QV4::Scoped<QV4ParticleData> r(scope, ctx->thisObject()); \
+ QV4::Scoped<QV4ParticleData> r(scope, callData->thisObject); \
if (!r || !r->d()->datum)\
- ctx->engine()->throwError(QStringLiteral("Not a valid ParticleData object"));\
+ RETURN_RESULT(scope.engine->throwError(QStringLiteral("Not a valid ParticleData object")));\
\
- double d = ctx->argc() ? ctx->args()[0].toNumber() : 0; \
+ double d = callData->argc ? callData->args[0].toNumber() : 0; \
r->d()->datum->color. VAR = qMin(255, qMax(0, (int)::floor(d * 255.0)));\
- return QV4::Encode::undefined(); \
+ RETURN_UNDEFINED(); \
}
-#define SEMIBOOL_GETTER_AND_SETTER(VARIABLE) static QV4::ReturnedValue particleData_get_ ## VARIABLE (QV4::CallContext *ctx) \
+#define SEMIBOOL_GETTER_AND_SETTER(VARIABLE) static void particleData_get_ ## VARIABLE (const QV4::BuiltinFunction *, QV4::Scope &scope, QV4::CallData *callData) \
{ \
- QV4::Scope scope(ctx); \
- QV4::Scoped<QV4ParticleData> r(scope, ctx->thisObject()); \
+ QV4::Scoped<QV4ParticleData> r(scope, callData->thisObject); \
if (!r || !r->d()->datum) \
- ctx->engine()->throwError(QStringLiteral("Not a valid ParticleData object")); \
+ RETURN_RESULT(scope.engine->throwError(QStringLiteral("Not a valid ParticleData object"))); \
\
- return QV4::Encode(r->d()->datum-> VARIABLE);\
+ RETURN_RESULT(QV4::Encode(r->d()->datum-> VARIABLE));\
}\
\
-static QV4::ReturnedValue particleData_set_ ## VARIABLE (QV4::CallContext *ctx)\
+static void particleData_set_ ## VARIABLE (const QV4::BuiltinFunction *, QV4::Scope &scope, QV4::CallData *callData)\
{\
- QV4::Scope scope(ctx); \
- QV4::Scoped<QV4ParticleData> r(scope, ctx->thisObject()); \
+ QV4::Scoped<QV4ParticleData> r(scope, callData->thisObject); \
if (!r || !r->d()->datum)\
- ctx->engine()->throwError(QStringLiteral("Not a valid ParticleData object"));\
+ RETURN_RESULT(scope.engine->throwError(QStringLiteral("Not a valid ParticleData object")));\
\
- r->d()->datum-> VARIABLE = (ctx->argc() && ctx->args()[0].toBoolean()) ? 1.0 : 0.0;\
- return QV4::Encode::undefined(); \
+ r->d()->datum-> VARIABLE = (callData->argc && callData->args[0].toBoolean()) ? 1.0 : 0.0;\
+ RETURN_UNDEFINED(); \
}
-#define FLOAT_GETTER_AND_SETTER(VARIABLE) static QV4::ReturnedValue particleData_get_ ## VARIABLE (QV4::CallContext *ctx) \
+#define FLOAT_GETTER_AND_SETTER(VARIABLE) static void particleData_get_ ## VARIABLE (const QV4::BuiltinFunction *, QV4::Scope &scope, QV4::CallData *callData) \
{ \
- QV4::Scope scope(ctx); \
- QV4::Scoped<QV4ParticleData> r(scope, ctx->thisObject()); \
+ QV4::Scoped<QV4ParticleData> r(scope, callData->thisObject); \
if (!r || !r->d()->datum) \
- ctx->engine()->throwError(QStringLiteral("Not a valid ParticleData object")); \
+ RETURN_RESULT(scope.engine->throwError(QStringLiteral("Not a valid ParticleData object"))); \
\
- return QV4::Encode(r->d()->datum-> VARIABLE);\
+ RETURN_RESULT(QV4::Encode(r->d()->datum-> VARIABLE));\
}\
\
-static QV4::ReturnedValue particleData_set_ ## VARIABLE (QV4::CallContext *ctx)\
+static void particleData_set_ ## VARIABLE (const QV4::BuiltinFunction *, QV4::Scope &scope, QV4::CallData *callData)\
{\
- QV4::Scope scope(ctx); \
- QV4::Scoped<QV4ParticleData> r(scope, ctx->thisObject()); \
+ QV4::Scoped<QV4ParticleData> r(scope, callData->thisObject); \
if (!r || !r->d()->datum)\
- ctx->engine()->throwError(QStringLiteral("Not a valid ParticleData object"));\
+ RETURN_RESULT(scope.engine->throwError(QStringLiteral("Not a valid ParticleData object")));\
\
- r->d()->datum-> VARIABLE = ctx->argc() ? ctx->args()[0].toNumber() : qt_qnan();\
- return QV4::Encode::undefined(); \
+ r->d()->datum-> VARIABLE = callData->argc ? callData->args[0].toNumber() : qt_qnan();\
+ RETURN_UNDEFINED(); \
}
-#define FAKE_FLOAT_GETTER_AND_SETTER(VARIABLE, GETTER, SETTER) static QV4::ReturnedValue particleData_get_ ## VARIABLE (QV4::CallContext *ctx) \
+#define FAKE_FLOAT_GETTER_AND_SETTER(VARIABLE, GETTER, SETTER) static void particleData_get_ ## VARIABLE (const QV4::BuiltinFunction *, QV4::Scope &scope, QV4::CallData *callData) \
{ \
- QV4::Scope scope(ctx); \
- QV4::Scoped<QV4ParticleData> r(scope, ctx->thisObject()); \
+ QV4::Scoped<QV4ParticleData> r(scope, callData->thisObject); \
if (!r || !r->d()->datum) \
- ctx->engine()->throwError(QStringLiteral("Not a valid ParticleData object")); \
+ RETURN_RESULT(scope.engine->throwError(QStringLiteral("Not a valid ParticleData object"))); \
\
- return QV4::Encode(r->d()->datum-> GETTER (r->d()->particleSystem));\
+ RETURN_RESULT(QV4::Encode(r->d()->datum-> GETTER (r->d()->particleSystem)));\
}\
\
-static QV4::ReturnedValue particleData_set_ ## VARIABLE (QV4::CallContext *ctx)\
+static void particleData_set_ ## VARIABLE (const QV4::BuiltinFunction *, QV4::Scope &scope, QV4::CallData *callData)\
{\
- QV4::Scope scope(ctx); \
- QV4::Scoped<QV4ParticleData> r(scope, ctx->thisObject()); \
+ QV4::Scoped<QV4ParticleData> r(scope, callData->thisObject); \
if (!r || !r->d()->datum)\
- ctx->engine()->throwError(QStringLiteral("Not a valid ParticleData object"));\
+ RETURN_RESULT(scope.engine->throwError(QStringLiteral("Not a valid ParticleData object")));\
\
- r->d()->datum-> SETTER (ctx->argc() ? ctx->args()[0].toNumber() : qt_qnan(), r->d()->particleSystem);\
- return QV4::Encode::undefined(); \
+ r->d()->datum-> SETTER (callData->argc ? callData->args[0].toNumber() : qt_qnan(), r->d()->particleSystem);\
+ RETURN_UNDEFINED(); \
}
#define REGISTER_ACCESSOR(PROTO, ENGINE, VARIABLE, NAME) \
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp b/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp
index 430ba4f255..e89b7a63d4 100644
--- a/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp
+++ b/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp
@@ -76,7 +76,7 @@ QV4::Heap::SimpleCallContext *QV4DataCollector::findScope(QV4::ExecutionContext
if (!ctxt)
return 0;
- QV4::Scope s(ctxt->d()->engine);
+ QV4::Scope s(ctxt);
QV4::ScopedContext ctx(s, ctxt);
for (; scope > 0 && ctx; --scope)
ctx = ctx->d()->outer;
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4debugger.cpp b/src/plugins/qmltooling/qmldbg_debugger/qv4debugger.cpp
index 9e8be84c33..b82df9c6a9 100644
--- a/src/plugins/qmltooling/qmldbg_debugger/qv4debugger.cpp
+++ b/src/plugins/qmltooling/qmldbg_debugger/qv4debugger.cpp
@@ -260,7 +260,7 @@ QV4::Function *QV4Debugger::getFunction() const
if (QV4::Function *function = context->getFunction())
return function;
else
- return context->d()->engine->globalCode;
+ return m_engine->globalCode;
}
void QV4Debugger::runJobUnpaused()
diff --git a/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp b/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp
index 6cb1ab4051..d536fd51ed 100644
--- a/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp
+++ b/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp
@@ -465,7 +465,7 @@ void NativeDebugger::handleVariables(QJsonObject *response, const QJsonObject &a
}
TRACE_PROTOCOL("Context: " << executionContext);
- QV4::ExecutionEngine *engine = executionContext->d()->engine;
+ QV4::ExecutionEngine *engine = executionContext->engine();
if (!engine) {
setError(response, QStringLiteral("No execution engine passed"));
return;
@@ -520,7 +520,7 @@ void NativeDebugger::handleExpressions(QJsonObject *response, const QJsonObject
}
TRACE_PROTOCOL("Context: " << executionContext);
- QV4::ExecutionEngine *engine = executionContext->d()->engine;
+ QV4::ExecutionEngine *engine = executionContext->engine();
if (!engine) {
setError(response, QStringLiteral("No execution engine passed"));
return;
@@ -672,7 +672,7 @@ QV4::Function *NativeDebugger::getFunction() const
if (QV4::Function *function = context->getFunction())
return function;
else
- return context->d()->engine->globalCode;
+ return m_engine->globalCode;
}
void NativeDebugger::pauseAndWait()
diff --git a/src/plugins/qmltooling/qmldbg_profiler/qqmlprofileradapter.cpp b/src/plugins/qmltooling/qmldbg_profiler/qqmlprofileradapter.cpp
index 90e817e2fc..510c745d4e 100644
--- a/src/plugins/qmltooling/qmldbg_profiler/qqmlprofileradapter.cpp
+++ b/src/plugins/qmltooling/qmldbg_profiler/qqmlprofileradapter.cpp
@@ -66,8 +66,6 @@ QQmlProfilerAdapter::QQmlProfilerAdapter(QQmlProfilerService *service, QQmlEngin
}
// convert to QByteArrays that can be sent to the debug client
-// use of QDataStream can skew results
-// (see tst_qqmldebugtrace::trace() benchmark)
static void qQmlProfilerDataToByteArrays(const QQmlProfilerData &d,
QQmlProfiler::LocationHash &locations,
QList<QByteArray> &messages,
diff --git a/src/plugins/qmltooling/qmldbg_quickprofiler/qquickprofileradapter.cpp b/src/plugins/qmltooling/qmldbg_quickprofiler/qquickprofileradapter.cpp
index 0c9fc36463..35beb0ee0d 100644
--- a/src/plugins/qmltooling/qmldbg_quickprofiler/qquickprofileradapter.cpp
+++ b/src/plugins/qmltooling/qmldbg_quickprofiler/qquickprofileradapter.cpp
@@ -74,8 +74,6 @@ QQuickProfilerAdapter::~QQuickProfilerAdapter()
}
// convert to QByteArrays that can be sent to the debug client
-// use of QDataStream can skew results
-// (see tst_qqmldebugtrace::trace() benchmark)
static void qQuickProfilerDataToByteArrays(const QQuickProfilerData &data,
QList<QByteArray> &messages)
{
diff --git a/src/qml/compiler/compiler.pri b/src/qml/compiler/compiler.pri
index 31ee917b39..60f548a2b0 100644
--- a/src/qml/compiler/compiler.pri
+++ b/src/qml/compiler/compiler.pri
@@ -41,7 +41,7 @@ SOURCES += \
unix: SOURCES += $$PWD/qv4compilationunitmapper_unix.cpp
else: SOURCES += $$PWD/qv4compilationunitmapper_win.cpp
-qtConfig(private_tests):unix: QMAKE_USE_PRIVATE += libdl
+qtConfig(private_tests):qtConfig(dlopen): QMAKE_USE_PRIVATE += libdl
}
qmldevtools_build|qtConfig(qml-interpreter) {
diff --git a/src/qml/compiler/qqmlirbuilder.cpp b/src/qml/compiler/qqmlirbuilder.cpp
index de04116a6b..f766f0e4c8 100644
--- a/src/qml/compiler/qqmlirbuilder.cpp
+++ b/src/qml/compiler/qqmlirbuilder.cpp
@@ -1961,7 +1961,7 @@ QV4::IR::Expr *JSCodeGen::fallbackNameLookup(const QString &name, int line, int
// with the correct QML context.
// Look for IDs first.
- for (const IdMapping &mapping : qAsConst(_idObjects))
+ for (const IdMapping &mapping : qAsConst(_idObjects)) {
if (name == mapping.name) {
if (_function->isQmlBinding)
_function->idObjectDependencies.insert(mapping.idIndex);
@@ -1979,8 +1979,9 @@ QV4::IR::Expr *JSCodeGen::fallbackNameLookup(const QString &name, int line, int
result->isReadOnly = true; // don't allow use as lvalue
return result;
}
+ }
- {
+ if (name.at(0).isUpper()) {
QQmlTypeNameCache::Result r = imports->query(name);
if (r.isValid()) {
if (r.scriptIndex != -1) {
diff --git a/src/qml/compiler/qqmlpropertyvalidator_p.h b/src/qml/compiler/qqmlpropertyvalidator_p.h
index d0bd314461..e37b8141f4 100644
--- a/src/qml/compiler/qqmlpropertyvalidator_p.h
+++ b/src/qml/compiler/qqmlpropertyvalidator_p.h
@@ -69,8 +69,8 @@ private:
bool canCoerce(int to, QQmlPropertyCache *fromMo) const;
- QVector<QQmlCompileError> recordError(const QV4::CompiledData::Location &location, const QString &description) const Q_REQUIRED_RESULT;
- QVector<QQmlCompileError> recordError(const QQmlCompileError &error) const Q_REQUIRED_RESULT;
+ Q_REQUIRED_RESULT QVector<QQmlCompileError> recordError(const QV4::CompiledData::Location &location, const QString &description) const;
+ Q_REQUIRED_RESULT QVector<QQmlCompileError> recordError(const QQmlCompileError &error) const;
QString stringAt(int index) const { return qmlUnit->stringAt(index); }
QQmlEnginePrivate *enginePrivate;
diff --git a/src/qml/compiler/qv4compileddata.cpp b/src/qml/compiler/qv4compileddata.cpp
index 9832e1c49b..a0dd4c426c 100644
--- a/src/qml/compiler/qv4compileddata.cpp
+++ b/src/qml/compiler/qv4compileddata.cpp
@@ -176,7 +176,7 @@ QV4::Function *CompilationUnit::linkToEngine(ExecutionEngine *engine)
for (uint i = 0; i < data->jsClassTableSize; ++i) {
int memberCount = 0;
const CompiledData::JSClassMember *member = data->jsClassAt(i, &memberCount);
- QV4::InternalClass *klass = engine->emptyClass;
+ QV4::InternalClass *klass = engine->internalClasses[QV4::ExecutionEngine::Class_Object];
for (int j = 0; j < memberCount; ++j, ++member)
klass = klass->addMember(runtimeStrings[member->nameOffset]->identifier, member->isAccessor ? QV4::Attr_Accessor : QV4::Attr_Data);
@@ -733,7 +733,7 @@ static QByteArray ownLibraryChecksum()
if (checksumInitialized)
return libraryChecksum;
checksumInitialized = true;
-#if defined(Q_OS_UNIX) && !defined(QT_NO_DYNAMIC_CAST) && !defined(Q_OS_INTEGRITY)
+#if !defined(QT_NO_DYNAMIC_CAST) && QT_CONFIG(dlopen)
Dl_info libInfo;
if (dladdr(reinterpret_cast<const void *>(&ownLibraryChecksum), &libInfo) != 0) {
QFile library(QFile::decodeName(libInfo.dli_fname));
diff --git a/src/qml/compiler/qv4instr_moth_p.h b/src/qml/compiler/qv4instr_moth_p.h
index fbd6ac8f99..dabda7bae8 100644
--- a/src/qml/compiler/qv4instr_moth_p.h
+++ b/src/qml/compiler/qv4instr_moth_p.h
@@ -170,11 +170,7 @@ QT_BEGIN_NAMESPACE
#define MOTH_INSTR_ALIGN_MASK (Q_ALIGNOF(QV4::Moth::Instr) - 1)
-#ifdef MOTH_THREADED_INTERPRETER
-# define MOTH_INSTR_HEADER union { quint32 instructionType; void *code; };
-#else
-# define MOTH_INSTR_HEADER quint32 instructionType;
-#endif
+#define MOTH_INSTR_HEADER quint32 instructionType;
#define MOTH_INSTR_ENUM(I, FMT) I,
#define MOTH_INSTR_SIZE(I, FMT) ((sizeof(QV4::Moth::Instr::instr_##FMT) + MOTH_INSTR_ALIGN_MASK) & ~MOTH_INSTR_ALIGN_MASK)
@@ -194,8 +190,8 @@ struct Param {
// Arg(outer): 4
// Local(outer): 5
// ...
- unsigned scope;
- unsigned index;
+ unsigned scope : 12;
+ unsigned index : 20;
bool isConstant() const { return !scope; }
bool isArgument() const { return scope >= 2 && !(scope &1); }
diff --git a/src/qml/compiler/qv4isel_moth.cpp b/src/qml/compiler/qv4isel_moth.cpp
index aefb084971..fb805dce02 100644
--- a/src/qml/compiler/qv4isel_moth.cpp
+++ b/src/qml/compiler/qv4isel_moth.cpp
@@ -638,7 +638,7 @@ void InstructionSelection::getQObjectProperty(IR::Expr *base, int propertyIndex,
void InstructionSelection::getElement(IR::Expr *base, IR::Expr *index, IR::Expr *target)
{
- if (useFastLookups) {
+ if (0 && useFastLookups) {
Instruction::LoadElementLookup load;
load.lookup = registerIndexedGetterLookup();
load.base = getParam(base);
@@ -657,7 +657,7 @@ void InstructionSelection::getElement(IR::Expr *base, IR::Expr *index, IR::Expr
void InstructionSelection::setElement(IR::Expr *source, IR::Expr *targetBase,
IR::Expr *targetIndex)
{
- if (useFastLookups) {
+ if (0 && useFastLookups) {
Instruction::StoreElementLookup store;
store.lookup = registerIndexedSetterLookup();
store.base = getParam(targetBase);
@@ -1436,29 +1436,6 @@ CompilationUnit::~CompilationUnit()
void CompilationUnit::linkBackendToEngine(QV4::ExecutionEngine *engine)
{
-#ifdef MOTH_THREADED_INTERPRETER
- // link byte code against addresses of instructions
- for (int i = 0; i < codeRefs.count(); ++i) {
- QByteArray &codeRef = codeRefs[i];
- char *code = codeRef.data();
- int index = 0;
- while (index < codeRef.size()) {
- Instr *genericInstr = reinterpret_cast<Instr *>(code + index);
-
- switch (genericInstr->common.instructionType) {
-#define LINK_INSTRUCTION(InstructionType, Member) \
- case Instr::InstructionType: \
- genericInstr->common.code = VME::instructionJumpTable()[static_cast<int>(genericInstr->common.instructionType)]; \
- index += InstrMeta<(int)Instr::InstructionType>::Size; \
- break;
-
- FOR_EACH_MOTH_INSTR(LINK_INSTRUCTION)
-
- }
- }
- }
-#endif
-
runtimeFunctions.resize(data->functionTableSize);
runtimeFunctions.fill(0);
for (int i = 0 ;i < runtimeFunctions.size(); ++i) {
@@ -1516,17 +1493,6 @@ bool CompilationUnit::saveCodeToDisk(QIODevice *device, const CompiledData::Unit
QByteArray padding;
-#if defined(MOTH_THREADED_INTERPRETER) && !defined(V4_BOOTSTRAP)
- // Map from instruction label back to instruction type. Only needed when persisting
- // already linked compilation units;
- QHash<void*, int> reverseInstructionMapping;
- if (engine) {
- void **instructions = VME::instructionJumpTable();
- for (int i = 0; i < Instr::LastInstruction; ++i)
- reverseInstructionMapping.insert(instructions[i], i);
- }
-#endif
-
for (int i = 0; i < codeRefs.size(); ++i) {
const CompiledData::Function *compiledFunction = unit->functionAt(i);
@@ -1545,27 +1511,6 @@ bool CompilationUnit::saveCodeToDisk(QIODevice *device, const CompiledData::Unit
QByteArray code = codeRefs.at(i);
-#if defined(MOTH_THREADED_INTERPRETER) && !defined(V4_BOOTSTRAP)
- if (!reverseInstructionMapping.isEmpty()) {
- char *codePtr = code.data(); // detaches
- int index = 0;
- while (index < code.size()) {
- Instr *genericInstr = reinterpret_cast<Instr *>(codePtr + index);
-
- genericInstr->common.instructionType = reverseInstructionMapping.value(genericInstr->common.code);
-
- switch (genericInstr->common.instructionType) {
- #define REVERSE_INSTRUCTION(InstructionType, Member) \
- case Instr::InstructionType: \
- index += InstrMeta<(int)Instr::InstructionType>::Size; \
- break;
-
- FOR_EACH_MOTH_INSTR(REVERSE_INSTRUCTION)
- }
- }
- }
-#endif
-
written = device->write(code.constData(), compiledFunction->codeSize);
if (written != qint64(compiledFunction->codeSize)) {
*errorString = device->errorString();
diff --git a/src/qml/compiler/qv4ssa.cpp b/src/qml/compiler/qv4ssa.cpp
index 731c6ad38f..fc136b09ff 100644
--- a/src/qml/compiler/qv4ssa.cpp
+++ b/src/qml/compiler/qv4ssa.cpp
@@ -5417,7 +5417,11 @@ void Optimizer::run(QQmlEnginePrivate *qmlEngine, bool doTypeInference, bool pee
showMeTheCode(function, "After loop detection");
// cfg2dot(function, loopDetection.allLoops());
- if (peelLoops) {
+ // ### disable loop peeling for now. It doesn't give any measurable performance
+ // improvements at this time, but significantly increases the size of the
+ // JIT generated code
+ Q_UNUSED(peelLoops);
+ if (0 && peelLoops) {
QVector<LoopDetection::LoopInfo *> innerLoops = loopDetection.innermostLoops();
LoopPeeling(df).run(innerLoops);
diff --git a/src/qml/configure.json b/src/qml/configure.json
index 2c4887365f..257bedecbc 100644
--- a/src/qml/configure.json
+++ b/src/qml/configure.json
@@ -15,17 +15,20 @@
"features": {
"qml-interpreter": {
"label": "QML interpreter",
- "purpose": "Support for the QML interpreter",
+ "purpose": "Provides the QML interpreter.",
+ "section": "QML",
"output": [ "privateFeature" ]
},
"qml-network": {
"label": "QML network support",
- "purpose": "Provides network transparency for QML",
+ "purpose": "Provides network transparency.",
+ "section": "QML",
"output": [ "publicFeature" ]
},
"qml-profiler": {
"label": "Command line QML Profiler",
- "purpose": "The QML Profiler retrieves QML tracing data from an application.",
+ "purpose": "Supports retrieving QML tracing data from an application.",
+ "section": "QML",
"condition": [
"features.commandlineparser",
"features.localserver",
diff --git a/src/qml/jit/qv4isel_masm.cpp b/src/qml/jit/qv4isel_masm.cpp
index c2853a39d2..7784eb364e 100644
--- a/src/qml/jit/qv4isel_masm.cpp
+++ b/src/qml/jit/qv4isel_masm.cpp
@@ -621,7 +621,7 @@ void InstructionSelection<JITAssembler>::setQObjectProperty(IR::Expr *source, IR
template <typename JITAssembler>
void InstructionSelection<JITAssembler>::getElement(IR::Expr *base, IR::Expr *index, IR::Expr *target)
{
- if (useFastLookups) {
+ if (0 && useFastLookups) {
uint lookup = registerIndexedGetterLookup();
generateLookupCall(target, lookup, offsetof(QV4::Lookup, indexedGetter),
JITTargetPlatform::EngineRegister,
@@ -637,7 +637,7 @@ void InstructionSelection<JITAssembler>::getElement(IR::Expr *base, IR::Expr *in
template <typename JITAssembler>
void InstructionSelection<JITAssembler>::setElement(IR::Expr *source, IR::Expr *targetBase, IR::Expr *targetIndex)
{
- if (useFastLookups) {
+ if (0 && useFastLookups) {
uint lookup = registerIndexedSetterLookup();
generateLookupCall(JITAssembler::Void, lookup, offsetof(QV4::Lookup, indexedSetter),
JITTargetPlatform::EngineRegister,
@@ -1639,14 +1639,20 @@ QQmlRefPointer<CompiledData::CompilationUnit> ISelFactory<JITAssembler>::createU
return result;
}
+#endif // ENABLE(ASSEMBLER)
+
QT_BEGIN_NAMESPACE
namespace QV4 { namespace JIT {
+#if ENABLE(ASSEMBLER)
template class Q_QML_EXPORT InstructionSelection<>;
template class Q_QML_EXPORT ISelFactory<>;
+#endif
+
#if defined(V4_BOOTSTRAP)
Q_QML_EXPORT QV4::EvalISelFactory *createISelForArchitecture(const QString &architecture)
{
+#if ENABLE(ASSEMBLER)
using ARMv7CrossAssembler = QV4::JIT::Assembler<AssemblerTargetConfiguration<JSC::MacroAssemblerARMv7, NoOperatingSystemSpecialization>>;
using ARM64CrossAssembler = QV4::JIT::Assembler<AssemblerTargetConfiguration<JSC::MacroAssemblerARM64, NoOperatingSystemSpecialization>>;
@@ -1667,6 +1673,7 @@ Q_QML_EXPORT QV4::EvalISelFactory *createISelForArchitecture(const QString &arch
#endif
if (!hostArch.isEmpty() && architecture == hostArch)
return new ISelFactory<>;
+#endif // ENABLE(ASSEMBLER)
return nullptr;
}
@@ -1675,4 +1682,3 @@ Q_QML_EXPORT QV4::EvalISelFactory *createISelForArchitecture(const QString &arch
} }
QT_END_NAMESPACE
-#endif // ENABLE(ASSEMBLER)
diff --git a/src/qml/jsapi/qjsvalue.cpp b/src/qml/jsapi/qjsvalue.cpp
index bab2e633a7..3a3cf46ddb 100644
--- a/src/qml/jsapi/qjsvalue.cpp
+++ b/src/qml/jsapi/qjsvalue.cpp
@@ -1019,7 +1019,7 @@ QJSValue QJSValue::property(const QString& name) const
if (idx < UINT_MAX)
return property(idx);
- s->makeIdentifier(engine);
+ s->makeIdentifier();
QV4::ScopedValue result(scope, o->get(s));
if (engine->hasException)
result = engine->catchException();
@@ -1090,7 +1090,7 @@ void QJSValue::setProperty(const QString& name, const QJSValue& value)
return;
}
- s->makeIdentifier(scope.engine);
+ s->makeIdentifier();
QV4::ScopedValue v(scope, QJSValuePrivate::convertedToValue(engine, value));
o->put(s, v);
if (engine->hasException)
diff --git a/src/qml/jsruntime/jsruntime.pri b/src/qml/jsruntime/jsruntime.pri
index 955cf585e4..9938f60aea 100644
--- a/src/qml/jsruntime/jsruntime.pri
+++ b/src/qml/jsruntime/jsruntime.pri
@@ -46,7 +46,9 @@ SOURCES += \
HEADERS += \
$$PWD/qv4global_p.h \
+ $$PWD/qv4alloca_p.h \
$$PWD/qv4engine_p.h \
+ $$PWD/qv4enginebase_p.h \
$$PWD/qv4context_p.h \
$$PWD/qv4math_p.h \
$$PWD/qv4persistent_p.h \
diff --git a/src/qml/jsruntime/qv4alloca_p.h b/src/qml/jsruntime/qv4alloca_p.h
index 2f486988c1..1e9f83a90e 100644
--- a/src/qml/jsruntime/qv4alloca_p.h
+++ b/src/qml/jsruntime/qv4alloca_p.h
@@ -51,15 +51,58 @@
// We mean it.
//
-#include <qglobal.h>
+#include <QtCore/private/qglobal_p.h>
-#if defined(Q_OS_WIN)
+#if QT_CONFIG(alloca_h)
+# include <alloca.h>
+#elif QT_CONFIG(alloca_malloc_h)
# include <malloc.h>
-# ifndef __GNUC__
+// This does not matter unless compiling in strict standard mode.
+# ifdef Q_CC_MSVC
# define alloca _alloca
# endif
-#elif !defined(Q_OS_BSD4) || defined(Q_OS_DARWIN)
-# include <alloca.h>
+#else
+# include <stdlib.h>
+#endif
+
+// Define Q_ALLOCA_VAR macro to be used instead of #ifdeffing
+// the occurrences of alloca() in case it's not supported.
+// Q_ALLOCA_DECLARE and Q_ALLOCA_ASSIGN macros separate
+// memory allocation from the declaration and RAII.
+#define Q_ALLOCA_VAR(type, name, size) \
+ Q_ALLOCA_DECLARE(type, name); \
+ Q_ALLOCA_ASSIGN(type, name, size)
+
+#if QT_CONFIG(alloca)
+
+#define Q_ALLOCA_DECLARE(type, name) \
+ type *name = 0
+
+#define Q_ALLOCA_ASSIGN(type, name, size) \
+ name = static_cast<type*>(alloca(size))
+
+#else
+QT_BEGIN_NAMESPACE
+class Qt_AllocaWrapper
+{
+public:
+ Qt_AllocaWrapper() { m_data = 0; }
+ ~Qt_AllocaWrapper() { free(m_data); }
+ void *data() { return m_data; }
+ void allocate(int size) { m_data = malloc(size); }
+private:
+ void *m_data;
+};
+QT_END_NAMESPACE
+
+#define Q_ALLOCA_DECLARE(type, name) \
+ Qt_AllocaWrapper _qt_alloca_##name; \
+ type *name = nullptr
+
+#define Q_ALLOCA_ASSIGN(type, name, size) \
+ _qt_alloca_##name.allocate(size); \
+ name = static_cast<type*>(_qt_alloca_##name.data())
+
#endif
#endif
diff --git a/src/qml/jsruntime/qv4argumentsobject.cpp b/src/qml/jsruntime/qv4argumentsobject.cpp
index 318db4f904..0905c2828a 100644
--- a/src/qml/jsruntime/qv4argumentsobject.cpp
+++ b/src/qml/jsruntime/qv4argumentsobject.cpp
@@ -48,7 +48,7 @@ DEFINE_OBJECT_VTABLE(ArgumentsObject);
void Heap::ArgumentsObject::init(QV4::CallContext *context)
{
- ExecutionEngine *v4 = context->d()->engine;
+ ExecutionEngine *v4 = internalClass->engine;
Object::init();
fullyCreated = false;
@@ -59,8 +59,8 @@ void Heap::ArgumentsObject::init(QV4::CallContext *context)
Scoped<QV4::ArgumentsObject> args(scope, this);
if (context->d()->strictMode) {
- Q_ASSERT(CalleePropertyIndex == args->internalClass()->find(context->d()->engine->id_callee()));
- Q_ASSERT(CallerPropertyIndex == args->internalClass()->find(context->d()->engine->id_caller()));
+ Q_ASSERT(CalleePropertyIndex == args->internalClass()->find(v4->id_callee()));
+ Q_ASSERT(CallerPropertyIndex == args->internalClass()->find(v4->id_caller()));
args->setProperty(CalleePropertyIndex + QV4::Object::GetterOffset, *v4->thrower());
args->setProperty(CalleePropertyIndex + QV4::Object::SetterOffset, *v4->thrower());
args->setProperty(CallerPropertyIndex + QV4::Object::GetterOffset, *v4->thrower());
@@ -70,10 +70,10 @@ void Heap::ArgumentsObject::init(QV4::CallContext *context)
args->arrayPut(0, context->args(), context->argc());
args->d()->fullyCreated = true;
} else {
- Q_ASSERT(CalleePropertyIndex == args->internalClass()->find(context->d()->engine->id_callee()));
+ Q_ASSERT(CalleePropertyIndex == args->internalClass()->find(v4->id_callee()));
args->setProperty(CalleePropertyIndex, context->d()->function);
}
- Q_ASSERT(LengthPropertyIndex == args->internalClass()->find(context->d()->engine->id_length()));
+ Q_ASSERT(LengthPropertyIndex == args->internalClass()->find(v4->id_length()));
args->setProperty(LengthPropertyIndex, Primitive::fromInt32(context->d()->callData->argc));
}
@@ -82,18 +82,19 @@ void ArgumentsObject::fullyCreate()
if (fullyCreated())
return;
+ Scope scope(engine());
+
uint argCount = context()->callData->argc;
uint numAccessors = qMin(context()->formalParameterCount(), argCount);
ArrayData::realloc(this, Heap::ArrayData::Sparse, argCount, true);
- context()->engine->requireArgumentsAccessors(numAccessors);
+ scope.engine->requireArgumentsAccessors(numAccessors);
- Scope scope(engine());
Scoped<MemberData> md(scope, d()->mappedArguments);
if (numAccessors) {
- d()->mappedArguments.set(scope.engine, md->allocate(engine(), numAccessors));
+ d()->mappedArguments.set(scope.engine, md->allocate(scope.engine, numAccessors));
for (uint i = 0; i < numAccessors; ++i) {
d()->mappedArguments->values.set(scope.engine, i, context()->callData->args[i]);
- arraySet(i, context()->engine->argumentsAccessors + i, Attr_Accessor);
+ arraySet(i, scope.engine->argumentsAccessors + i, Attr_Accessor);
}
}
arrayPut(numAccessors, context()->callData->args + numAccessors, argCount - numAccessors);
@@ -114,7 +115,7 @@ bool ArgumentsObject::defineOwnProperty(ExecutionEngine *engine, uint index, con
bool isMapped = false;
if (arrayData() && index < numAccessors &&
arrayData()->attributes(index).isAccessor() &&
- arrayData()->get(index) == context()->engine->argumentsAccessors[index].getter()->asReturnedValue())
+ arrayData()->get(index) == scope.engine->argumentsAccessors[index].getter()->asReturnedValue())
isMapped = true;
if (isMapped) {
diff --git a/src/qml/jsruntime/qv4arraydata.cpp b/src/qml/jsruntime/qv4arraydata.cpp
index 4a619858b4..df9884d84a 100644
--- a/src/qml/jsruntime/qv4arraydata.cpp
+++ b/src/qml/jsruntime/qv4arraydata.cpp
@@ -51,6 +51,8 @@ QT_WARNING_SUPPRESS_GCC_TAUTOLOGICAL_COMPARE_ON
const QV4::VTable QV4::ArrayData::static_vtbl = {
0,
0,
+ 0,
+ 0,
QV4::ArrayData::IsExecutionContext,
QV4::ArrayData::IsString,
QV4::ArrayData::IsObject,
diff --git a/src/qml/jsruntime/qv4arraydata_p.h b/src/qml/jsruntime/qv4arraydata_p.h
index c2c81e886b..1d895c90c5 100644
--- a/src/qml/jsruntime/qv4arraydata_p.h
+++ b/src/qml/jsruntime/qv4arraydata_p.h
@@ -234,6 +234,7 @@ struct Q_QML_EXPORT ArrayData : public Managed
struct Q_QML_EXPORT SimpleArrayData : public ArrayData
{
V4_ARRAYDATA(SimpleArrayData)
+ V4_INTERNALCLASS(SimpleArrayData)
uint mappedIndex(uint index) const { return d()->mappedIndex(index); }
Value data(uint index) const { return d()->data(index); }
@@ -257,6 +258,7 @@ struct Q_QML_EXPORT SimpleArrayData : public ArrayData
struct Q_QML_EXPORT SparseArrayData : public ArrayData
{
V4_ARRAYDATA(SparseArrayData)
+ V4_INTERNALCLASS(SparseArrayData)
V4_NEEDS_DESTROY
ReturnedValue &freeList() { return d()->freeList; }
diff --git a/src/qml/jsruntime/qv4booleanobject.cpp b/src/qml/jsruntime/qv4booleanobject.cpp
index 601066110f..c8e9ebb2dd 100644
--- a/src/qml/jsruntime/qv4booleanobject.cpp
+++ b/src/qml/jsruntime/qv4booleanobject.cpp
@@ -85,7 +85,7 @@ void BooleanPrototype::method_toString(const BuiltinFunction *, Scope &scope, Ca
result = thisObject->value();
}
- scope.result = scope.engine->newString(QLatin1String(result ? "true" : "false"));
+ scope.result = result ? scope.engine->id_true() : scope.engine->id_false();
}
void BooleanPrototype::method_valueOf(const BuiltinFunction *, Scope &scope, CallData *callData)
diff --git a/src/qml/jsruntime/qv4booleanobject_p.h b/src/qml/jsruntime/qv4booleanobject_p.h
index 9c8b1d67f1..ca2cf7d17a 100644
--- a/src/qml/jsruntime/qv4booleanobject_p.h
+++ b/src/qml/jsruntime/qv4booleanobject_p.h
@@ -76,6 +76,7 @@ struct BooleanCtor: FunctionObject
struct BooleanPrototype: BooleanObject
{
+ V4_PROTOTYPE(objectPrototype)
void init(ExecutionEngine *engine, Object *ctor);
static void method_toString(const BuiltinFunction *, Scope &scope, CallData *callData);
diff --git a/src/qml/jsruntime/qv4context.cpp b/src/qml/jsruntime/qv4context.cpp
index 02d3af619e..ba72a9e43b 100644
--- a/src/qml/jsruntime/qv4context.cpp
+++ b/src/qml/jsruntime/qv4context.cpp
@@ -65,13 +65,14 @@ Heap::CallContext *ExecutionContext::newCallContext(Function *function, CallData
uint localsAndFormals = function->compiledFunction->nLocals + sizeof(CallData)/sizeof(Value) - 1 + qMax(static_cast<uint>(callData->argc), function->nFormals);
size_t requiredMemory = sizeof(CallContext::Data) - sizeof(Value) + sizeof(Value) * (localsAndFormals);
- Heap::CallContext *c = d()->engine->memoryManager->allocManaged<CallContext>(requiredMemory);
- c->init(d()->engine, Heap::ExecutionContext::Type_CallContext);
+ ExecutionEngine *v4 = engine();
+ Heap::CallContext *c = v4->memoryManager->allocManaged<CallContext>(requiredMemory);
+ c->init(Heap::ExecutionContext::Type_CallContext);
c->v4Function = function;
c->strictMode = function->isStrict();
- c->outer.set(d()->engine, this->d());
+ c->outer.set(v4, this->d());
c->compilationUnit = function->compilationUnit;
c->lookups = function->compilationUnit->runtimeLookups;
@@ -99,14 +100,14 @@ Heap::CallContext *ExecutionContext::newCallContext(Function *function, CallData
Heap::WithContext *ExecutionContext::newWithContext(Heap::Object *with)
{
- return d()->engine->memoryManager->alloc<WithContext>(d(), with);
+ return engine()->memoryManager->alloc<WithContext>(d(), with);
}
Heap::CatchContext *ExecutionContext::newCatchContext(Heap::String *exceptionVarName, ReturnedValue exceptionValue)
{
Scope scope(this);
ScopedValue e(scope, exceptionValue);
- return d()->engine->memoryManager->alloc<CatchContext>(d(), exceptionVarName, e);
+ return engine()->memoryManager->alloc<CatchContext>(d(), exceptionVarName, e);
}
void ExecutionContext::createMutableBinding(String *name, bool deletable)
@@ -156,35 +157,35 @@ void ExecutionContext::createMutableBinding(String *name, bool deletable)
void Heap::GlobalContext::init(ExecutionEngine *eng)
{
- Heap::ExecutionContext::init(eng, Heap::ExecutionContext::Type_GlobalContext);
+ Heap::ExecutionContext::init(Heap::ExecutionContext::Type_GlobalContext);
global.set(eng, eng->globalObject->d());
}
void Heap::CatchContext::init(ExecutionContext *outerContext, String *exceptionVarName,
const Value &exceptionValue)
{
- Heap::ExecutionContext::init(outerContext->engine, Heap::ExecutionContext::Type_CatchContext);
- outer.set(engine, outerContext);
+ Heap::ExecutionContext::init(Heap::ExecutionContext::Type_CatchContext);
+ outer.set(internalClass->engine, outerContext);
strictMode = outer->strictMode;
callData = outer->callData;
lookups = outer->lookups;
constantTable = outer->constantTable;
compilationUnit = outer->compilationUnit;
- this->exceptionVarName.set(engine, exceptionVarName);
- this->exceptionValue.set(engine, exceptionValue);
+ this->exceptionVarName.set(internalClass->engine, exceptionVarName);
+ this->exceptionValue.set(internalClass->engine, exceptionValue);
}
void Heap::WithContext::init(ExecutionContext *outerContext, Object *with)
{
- Heap::ExecutionContext::init(outerContext->engine, Heap::ExecutionContext::Type_WithContext);
- outer.set(engine, outerContext);
+ Heap::ExecutionContext::init(Heap::ExecutionContext::Type_WithContext);
+ outer.set(internalClass->engine, outerContext);
callData = outer->callData;
lookups = outer->lookups;
constantTable = outer->constantTable;
compilationUnit = outer->compilationUnit;
- withObject.set(engine, with);
+ withObject.set(internalClass->engine, with);
}
Identifier * const *SimpleCallContext::formals() const
@@ -211,6 +212,9 @@ unsigned int SimpleCallContext::variableCount() const
bool ExecutionContext::deleteProperty(String *name)
{
+ name->makeIdentifier();
+ Identifier *id = name->identifier();
+
Scope scope(this);
ScopedContext ctx(scope, this);
for (; ctx; ctx = ctx->d()->outer) {
@@ -235,7 +239,7 @@ bool ExecutionContext::deleteProperty(String *name)
}
case Heap::ExecutionContext::Type_CallContext: {
Heap::CallContext *c = static_cast<Heap::CallContext *>(ctx->d());
- uint index = c->v4Function->internalClass->find(name);
+ uint index = c->v4Function->internalClass->find(id);
if (index < UINT_MAX)
// ### throw in strict mode?
return false;
@@ -282,7 +286,7 @@ void QV4::ExecutionContext::simpleCall(Scope &scope, CallData *callData, Functio
ExecutionContextSaver ctxSaver(scope);
- SimpleCallContext::Data *ctx = scope.engine->memoryManager->allocSimpleCallContext(scope.engine);
+ SimpleCallContext::Data *ctx = scope.engine->memoryManager->allocSimpleCallContext();
ctx->strictMode = function->isStrict();
ctx->callData = callData;
@@ -306,6 +310,9 @@ void QV4::ExecutionContext::simpleCall(Scope &scope, CallData *callData, Functio
void ExecutionContext::setProperty(String *name, const Value &value)
{
+ name->makeIdentifier();
+ Identifier *id = name->identifier();
+
Scope scope(this);
ScopedContext ctx(scope, this);
ScopedObject activation(scope);
@@ -337,7 +344,7 @@ void ExecutionContext::setProperty(String *name, const Value &value)
case Heap::ExecutionContext::Type_SimpleCallContext: {
Heap::SimpleCallContext *c = static_cast<Heap::SimpleCallContext *>(ctx->d());
if (c->v4Function) {
- uint index = c->v4Function->internalClass->find(name);
+ uint index = c->v4Function->internalClass->find(id);
if (index < UINT_MAX) {
if (index < c->v4Function->nFormals) {
c->callData->args[c->v4Function->nFormals - index - 1] = value;
@@ -360,7 +367,7 @@ void ExecutionContext::setProperty(String *name, const Value &value)
}
if (activation) {
- uint member = activation->internalClass()->find(name);
+ uint member = activation->internalClass()->find(id);
if (member < UINT_MAX) {
activation->putValue(member, value);
return;
@@ -368,21 +375,21 @@ void ExecutionContext::setProperty(String *name, const Value &value)
}
}
- if (d()->strictMode || name->equals(d()->engine->id_this())) {
+ if (d()->strictMode || name->equals(engine()->id_this())) {
ScopedValue n(scope, name->asReturnedValue());
engine()->throwReferenceError(n);
return;
}
- d()->engine->globalObject->put(name, value);
+ engine()->globalObject->put(name, value);
}
ReturnedValue ExecutionContext::getProperty(String *name)
{
Scope scope(this);
ScopedValue v(scope);
- name->makeIdentifier(scope.engine);
+ name->makeIdentifier();
- if (name->equals(d()->engine->id_this()))
+ if (name->equals(engine()->id_this()))
return thisObject().asReturnedValue();
ScopedContext ctx(scope, this);
@@ -413,7 +420,10 @@ ReturnedValue ExecutionContext::getProperty(String *name)
}
case Heap::ExecutionContext::Type_CallContext: {
Heap::CallContext *c = static_cast<Heap::CallContext *>(ctx->d());
- uint index = c->v4Function->internalClass->find(name);
+ name->makeIdentifier();
+ Identifier *id = name->identifier();
+
+ uint index = c->v4Function->internalClass->find(id);
if (index < UINT_MAX) {
if (index < c->v4Function->nFormals)
return c->callData->args[c->v4Function->nFormals - index - 1].asReturnedValue();
@@ -456,9 +466,9 @@ ReturnedValue ExecutionContext::getPropertyAndBase(String *name, Value *base)
Scope scope(this);
ScopedValue v(scope);
base->setM(0);
- name->makeIdentifier(scope.engine);
+ name->makeIdentifier();
- if (name->equals(d()->engine->id_this()))
+ if (name->equals(engine()->id_this()))
return thisObject().asReturnedValue();
ScopedContext ctx(scope, this);
@@ -490,7 +500,10 @@ ReturnedValue ExecutionContext::getPropertyAndBase(String *name, Value *base)
}
case Heap::ExecutionContext::Type_CallContext: {
Heap::CallContext *c = static_cast<Heap::CallContext *>(ctx->d());
- uint index = c->v4Function->internalClass->find(name);
+ name->makeIdentifier();
+ Identifier *id = name->identifier();
+
+ uint index = c->v4Function->internalClass->find(id);
if (index < UINT_MAX) {
if (index < c->v4Function->nFormals)
return c->callData->args[c->v4Function->nFormals - index - 1].asReturnedValue();
@@ -531,7 +544,7 @@ ReturnedValue ExecutionContext::getPropertyAndBase(String *name, Value *base)
Function *ExecutionContext::getFunction() const
{
- Scope scope(d()->engine);
+ Scope scope(engine());
ScopedContext it(scope, this->d());
for (; it; it = it->d()->outer) {
if (const SimpleCallContext *callCtx = it->asSimpleCallContext())
diff --git a/src/qml/jsruntime/qv4context_p.h b/src/qml/jsruntime/qv4context_p.h
index 625d9ed424..a854c324d0 100644
--- a/src/qml/jsruntime/qv4context_p.h
+++ b/src/qml/jsruntime/qv4context_p.h
@@ -104,7 +104,6 @@ struct QmlContext;
#define ExecutionContextMembers(class, Member) \
Member(class, NoMark, CallData *, callData) \
- Member(class, NoMark, ExecutionEngine *, engine) \
Member(class, Pointer, ExecutionContext *, outer) \
Member(class, NoMark, Lookup *, lookups) \
Member(class, NoMark, const QV4::Value *, constantTable) \
@@ -124,11 +123,10 @@ DECLARE_HEAP_OBJECT(ExecutionContext, Base) {
Type_CallContext = 0x6
};
- void init(ExecutionEngine *engine, ContextType t)
+ void init(ContextType t)
{
Base::init();
- this->engine = engine;
type = t;
lineNumber = -1;
}
@@ -146,8 +144,7 @@ Q_STATIC_ASSERT(sizeof(ExecutionContext) == sizeof(Base) + sizeof(ExecutionConte
Q_STATIC_ASSERT(std::is_standard_layout<ExecutionContextData>::value);
Q_STATIC_ASSERT(offsetof(ExecutionContextData, callData) == 0);
-Q_STATIC_ASSERT(offsetof(ExecutionContextData, engine) == offsetof(ExecutionContextData, callData) + QT_POINTER_SIZE);
-Q_STATIC_ASSERT(offsetof(ExecutionContextData, outer) == offsetof(ExecutionContextData, engine) + QT_POINTER_SIZE);
+Q_STATIC_ASSERT(offsetof(ExecutionContextData, outer) == offsetof(ExecutionContextData, callData) + QT_POINTER_SIZE);
Q_STATIC_ASSERT(offsetof(ExecutionContextData, lookups) == offsetof(ExecutionContextData, outer) + QT_POINTER_SIZE);
Q_STATIC_ASSERT(offsetof(ExecutionContextData, constantTable) == offsetof(ExecutionContextData, lookups) + QT_POINTER_SIZE);
Q_STATIC_ASSERT(offsetof(ExecutionContextData, compilationUnit) == offsetof(ExecutionContextData, constantTable) + QT_POINTER_SIZE);
@@ -160,9 +157,9 @@ Q_STATIC_ASSERT(offsetof(ExecutionContextData, lineNumber) == offsetof(Execution
DECLARE_HEAP_OBJECT(SimpleCallContext, ExecutionContext) {
DECLARE_MARK_TABLE(SimpleCallContext);
- void init(ExecutionEngine *engine, ContextType t = Type_SimpleCallContext)
+ void init(ContextType t = Type_SimpleCallContext)
{
- ExecutionContext::init(engine, t);
+ ExecutionContext::init(t);
}
inline unsigned int formalParameterCount() const;
@@ -240,8 +237,7 @@ struct Q_QML_EXPORT ExecutionContext : public Managed
V4_MANAGED(ExecutionContext, Managed)
Q_MANAGED_TYPE(ExecutionContext)
-
- ExecutionEngine *engine() const { return d()->engine; }
+ V4_INTERNALCLASS(ExecutionContext)
Heap::CallContext *newCallContext(Function *f, CallData *callData);
Heap::WithContext *newWithContext(Heap::Object *with);
@@ -281,6 +277,7 @@ struct Q_QML_EXPORT ExecutionContext : public Managed
struct Q_QML_EXPORT SimpleCallContext : public ExecutionContext
{
V4_MANAGED(SimpleCallContext, ExecutionContext)
+ V4_INTERNALCLASS(SimpleCallContext)
// formals are in reverse order
Identifier * const *formals() const;
diff --git a/src/qml/jsruntime/qv4dateobject_p.h b/src/qml/jsruntime/qv4dateobject_p.h
index b32b2c3f66..b0373884dd 100644
--- a/src/qml/jsruntime/qv4dateobject_p.h
+++ b/src/qml/jsruntime/qv4dateobject_p.h
@@ -114,6 +114,8 @@ struct DateCtor: FunctionObject
struct DatePrototype: Object
{
+ V4_PROTOTYPE(objectPrototype)
+
void init(ExecutionEngine *engine, Object *ctor);
static double getThisDate(Scope &scope, CallData *callData);
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp
index 6465b15d5a..019936767a 100644
--- a/src/qml/jsruntime/qv4engine.cpp
+++ b/src/qml/jsruntime/qv4engine.cpp
@@ -109,9 +109,9 @@ using namespace QV4;
static QBasicAtomicInt engineSerial = Q_BASIC_ATOMIC_INITIALIZER(1);
-static ReturnedValue throwTypeError(CallContext *ctx)
+void throwTypeError(const BuiltinFunction *, Scope &scope, CallData *)
{
- return ctx->engine()->throwTypeError();
+ scope.result = scope.engine->throwTypeError();
}
@@ -130,10 +130,8 @@ QQmlEngine *ExecutionEngine::qmlEngine() const
qint32 ExecutionEngine::maxCallDepth = -1;
ExecutionEngine::ExecutionEngine(EvalISelFactory *factory)
- : callDepth(0)
- , executableAllocator(new QV4::ExecutableAllocator)
+ : executableAllocator(new QV4::ExecutableAllocator)
, regExpAllocator(new QV4::ExecutableAllocator)
- , currentContext(0)
, bumperPointerAllocator(new WTF::BumpPointerAllocator)
, jsStack(new WTF::PageAllocation)
, gcStack(new WTF::PageAllocation)
@@ -219,7 +217,13 @@ ExecutionEngine::ExecutionEngine(EvalISelFactory *factory)
classPool = new InternalClassPool;
- emptyClass = new (classPool) InternalClass(this);
+ internalClasses[Class_Empty] = new (classPool) InternalClass(this);
+ internalClasses[Class_String] = internalClasses[EngineBase::Class_Empty]->changeVTable(QV4::String::staticVTable());
+ internalClasses[Class_MemberData] = internalClasses[EngineBase::Class_Empty]->changeVTable(QV4::MemberData::staticVTable());
+ internalClasses[Class_SimpleArrayData] = internalClasses[EngineBase::Class_Empty]->changeVTable(QV4::SimpleArrayData::staticVTable());
+ internalClasses[Class_SparseArrayData] = internalClasses[EngineBase::Class_Empty]->changeVTable(QV4::SparseArrayData::staticVTable());
+ internalClasses[Class_ExecutionContext] = internalClasses[EngineBase::Class_Empty]->changeVTable(QV4::ExecutionContext::staticVTable());
+ internalClasses[Class_SimpleCallContext] = internalClasses[EngineBase::Class_Empty]->changeVTable(QV4::CallContext::staticVTable());
jsStrings[String_Empty] = newIdentifier(QString());
jsStrings[String_undefined] = newIdentifier(QStringLiteral("undefined"));
@@ -258,90 +262,113 @@ ExecutionEngine::ExecutionEngine(EvalISelFactory *factory)
jsStrings[String_buffer] = newIdentifier(QStringLiteral("buffer"));
jsStrings[String_lastIndex] = newIdentifier(QStringLiteral("lastIndex"));
- jsObjects[ObjectProto] = memoryManager->allocObject<ObjectPrototype>(emptyClass);
+ InternalClass *ic = internalClasses[Class_Empty]->changeVTable(QV4::Object::staticVTable());
+ jsObjects[ObjectProto] = memoryManager->allocObject<ObjectPrototype>(ic);
+ internalClasses[Class_Object] = ic->changePrototype(objectPrototype()->d());
- arrayClass = emptyClass->addMember(id_length(), Attr_NotConfigurable|Attr_NotEnumerable);
- jsObjects[ArrayProto] = memoryManager->allocObject<ArrayPrototype>(arrayClass, objectPrototype());
+ ic = newInternalClass(ArrayPrototype::staticVTable(), objectPrototype());
+ Q_ASSERT(ic->prototype);
+ ic = ic->addMember(id_length(), Attr_NotConfigurable|Attr_NotEnumerable);
+ Q_ASSERT(ic->prototype);
+ jsObjects[ArrayProto] = memoryManager->allocObject<ArrayPrototype>(ic, objectPrototype());
+ internalClasses[Class_ArrayObject] = ic->changePrototype(arrayPrototype()->d());
jsObjects[PropertyListProto] = memoryManager->allocObject<PropertyListPrototype>();
- InternalClass *argsClass = emptyClass->addMember(id_length(), Attr_NotEnumerable);
- argumentsObjectClass = argsClass->addMember(id_callee(), Attr_Data|Attr_NotEnumerable);
- strictArgumentsObjectClass = argsClass->addMember(id_callee(), Attr_Accessor|Attr_NotConfigurable|Attr_NotEnumerable);
- strictArgumentsObjectClass = strictArgumentsObjectClass->addMember(id_caller(), Attr_Accessor|Attr_NotConfigurable|Attr_NotEnumerable);
+ InternalClass *argsClass = newInternalClass(ArgumentsObject::staticVTable(), objectPrototype());
+ argsClass = argsClass->addMember(id_length(), Attr_NotEnumerable);
+ internalClasses[EngineBase::Class_ArgumentsObject] = argsClass->addMember(id_callee(), Attr_Data|Attr_NotEnumerable);
+ argsClass = argsClass->addMember(id_callee(), Attr_Accessor|Attr_NotConfigurable|Attr_NotEnumerable);
+ internalClasses[EngineBase::Class_StrictArgumentsObject] = argsClass->addMember(id_caller(), Attr_Accessor|Attr_NotConfigurable|Attr_NotEnumerable);
*static_cast<Value *>(globalObject) = newObject();
Q_ASSERT(globalObject->d()->vtable());
initRootContext();
- stringClass = emptyClass->addMember(id_length(), Attr_ReadOnly);
- Q_ASSERT(stringClass->find(id_length()) == Heap::StringObject::LengthPropertyIndex);
- jsObjects[StringProto] = memoryManager->allocObject<StringPrototype>(stringClass, objectPrototype());
- jsObjects[NumberProto] = memoryManager->allocObject<NumberPrototype>(emptyClass, objectPrototype());
- jsObjects[BooleanProto] = memoryManager->allocObject<BooleanPrototype>(emptyClass, objectPrototype());
- jsObjects[DateProto] = memoryManager->allocObject<DatePrototype>(emptyClass, objectPrototype());
+ ic = newInternalClass(QV4::StringObject::staticVTable(), objectPrototype());
+ ic = ic->addMember(id_length(), Attr_ReadOnly);
+ jsObjects[StringProto] = memoryManager->allocObject<StringPrototype>(ic);
+ internalClasses[Class_StringObject] = ic->changePrototype(stringPrototype()->d());
+ Q_ASSERT(internalClasses[EngineBase::Class_StringObject]->find(id_length()) == Heap::StringObject::LengthPropertyIndex);
+
+ jsObjects[NumberProto] = memoryManager->allocObject<NumberPrototype>();
+ jsObjects[BooleanProto] = memoryManager->allocObject<BooleanPrototype>();
+ jsObjects[DateProto] = memoryManager->allocObject<DatePrototype>();
uint index;
- InternalClass *functionProtoClass = emptyClass->addMember(id_prototype(), Attr_NotEnumerable, &index);
+ ic = newInternalClass(QV4::FunctionPrototype::staticVTable(), objectPrototype());
+ ic = ic->addMember(id_prototype(), Attr_NotEnumerable, &index);
Q_ASSERT(index == Heap::FunctionObject::Index_Prototype);
- jsObjects[FunctionProto] = memoryManager->allocObject<FunctionPrototype>(functionProtoClass, objectPrototype());
- functionClass = emptyClass->addMember(id_prototype(), Attr_NotEnumerable|Attr_NotConfigurable, &index);
+ jsObjects[FunctionProto] = memoryManager->allocObject<FunctionPrototype>(ic, objectPrototype());
+ ic = newInternalClass(FunctionObject::staticVTable(), functionPrototype());
+ ic = ic->addMember(id_prototype(), Attr_NotEnumerable|Attr_NotConfigurable, &index);
Q_ASSERT(index == Heap::FunctionObject::Index_Prototype);
- scriptFunctionClass = functionClass->addMember(id_name(), Attr_ReadOnly, &index);
+ internalClasses[EngineBase::Class_FunctionObject] = ic;
+ ic = ic->addMember(id_name(), Attr_ReadOnly, &index);
Q_ASSERT(index == Heap::ScriptFunction::Index_Name);
- scriptFunctionClass = scriptFunctionClass->addMember(id_length(), Attr_ReadOnly, &index);
+ ic = ic->changeVTable(ScriptFunction::staticVTable());
+ internalClasses[EngineBase::Class_ScriptFunction] = ic->addMember(id_length(), Attr_ReadOnly, &index);
+ Q_ASSERT(index == Heap::ScriptFunction::Index_Length);
+ internalClasses[EngineBase::Class_BuiltinFunction] = ic->changeVTable(BuiltinFunction::staticVTable());
Q_ASSERT(index == Heap::ScriptFunction::Index_Length);
- protoClass = emptyClass->addMember(id_constructor(), Attr_NotEnumerable, &index);
+ internalClasses[EngineBase::Class_ObjectProto] = internalClasses[Class_Object]->addMember(id_constructor(), Attr_NotEnumerable, &index);
Q_ASSERT(index == Heap::FunctionObject::Index_ProtoConstructor);
Scope scope(this);
ScopedString str(scope);
- regExpObjectClass = emptyClass->addMember(id_lastIndex(), Attr_NotEnumerable|Attr_NotConfigurable, &index);
+ internalClasses[Class_RegExp] = internalClasses[EngineBase::Class_Empty]->changeVTable(QV4::RegExp::staticVTable());
+ ic = newInternalClass(QV4::RegExpObject::staticVTable(), objectPrototype());
+ ic = ic->addMember(id_lastIndex(), Attr_NotEnumerable|Attr_NotConfigurable, &index);
Q_ASSERT(index == RegExpObject::Index_LastIndex);
- regExpObjectClass = regExpObjectClass->addMember((str = newIdentifier(QStringLiteral("source"))), Attr_ReadOnly, &index);
+ ic = ic->addMember((str = newIdentifier(QStringLiteral("source"))), Attr_ReadOnly, &index);
Q_ASSERT(index == RegExpObject::Index_Source);
- regExpObjectClass = regExpObjectClass->addMember((str = newIdentifier(QStringLiteral("global"))), Attr_ReadOnly, &index);
+ ic = ic->addMember((str = newIdentifier(QStringLiteral("global"))), Attr_ReadOnly, &index);
Q_ASSERT(index == RegExpObject::Index_Global);
- regExpObjectClass = regExpObjectClass->addMember((str = newIdentifier(QStringLiteral("ignoreCase"))), Attr_ReadOnly, &index);
+ ic = ic->addMember((str = newIdentifier(QStringLiteral("ignoreCase"))), Attr_ReadOnly, &index);
Q_ASSERT(index == RegExpObject::Index_IgnoreCase);
- regExpObjectClass = regExpObjectClass->addMember((str = newIdentifier(QStringLiteral("multiline"))), Attr_ReadOnly, &index);
+ ic = ic->addMember((str = newIdentifier(QStringLiteral("multiline"))), Attr_ReadOnly, &index);
Q_ASSERT(index == RegExpObject::Index_Multiline);
+ jsObjects[RegExpProto] = memoryManager->allocObject<RegExpPrototype>(ic, objectPrototype());
+ internalClasses[Class_RegExpObject] = ic->changePrototype(regExpPrototype()->d());
- jsObjects[RegExpProto] = memoryManager->allocObject<RegExpPrototype>(regExpObjectClass, objectPrototype());
- regExpExecArrayClass = arrayClass->addMember(id_index(), Attr_Data, &index);
+ ic = internalClasses[Class_ArrayObject]->addMember(id_index(), Attr_Data, &index);
Q_ASSERT(index == RegExpObject::Index_ArrayIndex);
- regExpExecArrayClass = regExpExecArrayClass->addMember(id_input(), Attr_Data, &index);
+ internalClasses[EngineBase::Class_RegExpExecArray] = ic->addMember(id_input(), Attr_Data, &index);
Q_ASSERT(index == RegExpObject::Index_ArrayInput);
- errorClass = emptyClass->addMember((str = newIdentifier(QStringLiteral("stack"))), Attr_Accessor|Attr_NotConfigurable|Attr_NotEnumerable, &index);
+ ic = newInternalClass(ErrorObject::staticVTable(), 0);
+ ic = ic->addMember((str = newIdentifier(QStringLiteral("stack"))), Attr_Accessor|Attr_NotConfigurable|Attr_NotEnumerable, &index);
Q_ASSERT(index == ErrorObject::Index_Stack);
- errorClass = errorClass->addMember((str = newIdentifier(QStringLiteral("fileName"))), Attr_Data|Attr_NotEnumerable, &index);
+ ic = ic->addMember((str = newIdentifier(QStringLiteral("fileName"))), Attr_Data|Attr_NotEnumerable, &index);
Q_ASSERT(index == ErrorObject::Index_FileName);
- errorClass = errorClass->addMember((str = newIdentifier(QStringLiteral("lineNumber"))), Attr_Data|Attr_NotEnumerable, &index);
+ ic = ic->addMember((str = newIdentifier(QStringLiteral("lineNumber"))), Attr_Data|Attr_NotEnumerable, &index);
+ internalClasses[EngineBase::Class_ErrorObject] = ic;
Q_ASSERT(index == ErrorObject::Index_LineNumber);
- errorClassWithMessage = errorClass->addMember((str = newIdentifier(QStringLiteral("message"))), Attr_Data|Attr_NotEnumerable, &index);
+ internalClasses[EngineBase::Class_ErrorObjectWithMessage] = ic->addMember((str = newIdentifier(QStringLiteral("message"))), Attr_Data|Attr_NotEnumerable, &index);
Q_ASSERT(index == ErrorObject::Index_Message);
- errorProtoClass = emptyClass->addMember(id_constructor(), Attr_Data|Attr_NotEnumerable, &index);
+ ic = newInternalClass(ErrorObject::staticVTable(), objectPrototype());
+ ic = ic->addMember(id_constructor(), Attr_Data|Attr_NotEnumerable, &index);
Q_ASSERT(index == ErrorPrototype::Index_Constructor);
- errorProtoClass = errorProtoClass->addMember((str = newIdentifier(QStringLiteral("message"))), Attr_Data|Attr_NotEnumerable, &index);
+ ic = ic->addMember((str = newIdentifier(QStringLiteral("message"))), Attr_Data|Attr_NotEnumerable, &index);
Q_ASSERT(index == ErrorPrototype::Index_Message);
- errorProtoClass = errorProtoClass->addMember(id_name(), Attr_Data|Attr_NotEnumerable, &index);
+ internalClasses[EngineBase::Class_ErrorProto] = ic->addMember(id_name(), Attr_Data|Attr_NotEnumerable, &index);
Q_ASSERT(index == ErrorPrototype::Index_Name);
jsObjects[GetStack_Function] = BuiltinFunction::create(rootContext(), str = newIdentifier(QStringLiteral("stack")), ErrorObject::method_get_stack);
getStackFunction()->defineReadonlyProperty(id_length(), Primitive::fromInt32(0));
- jsObjects[ErrorProto] = memoryManager->allocObject<ErrorPrototype>(errorProtoClass, objectPrototype());
- jsObjects[EvalErrorProto] = memoryManager->allocObject<EvalErrorPrototype>(errorProtoClass, errorPrototype());
- jsObjects[RangeErrorProto] = memoryManager->allocObject<RangeErrorPrototype>(errorProtoClass, errorPrototype());
- jsObjects[ReferenceErrorProto] = memoryManager->allocObject<ReferenceErrorPrototype>(errorProtoClass, errorPrototype());
- jsObjects[SyntaxErrorProto] = memoryManager->allocObject<SyntaxErrorPrototype>(errorProtoClass, errorPrototype());
- jsObjects[TypeErrorProto] = memoryManager->allocObject<TypeErrorPrototype>(errorProtoClass, errorPrototype());
- jsObjects[URIErrorProto] = memoryManager->allocObject<URIErrorPrototype>(errorProtoClass, errorPrototype());
+ jsObjects[ErrorProto] = memoryManager->allocObject<ErrorPrototype>(internalClasses[EngineBase::Class_ErrorProto], objectPrototype());
+ jsObjects[EvalErrorProto] = memoryManager->allocObject<EvalErrorPrototype>(internalClasses[EngineBase::Class_ErrorProto]->changePrototype(errorPrototype()->d()), errorPrototype());
+ jsObjects[RangeErrorProto] = memoryManager->allocObject<RangeErrorPrototype>(internalClasses[EngineBase::Class_ErrorProto]->changePrototype(errorPrototype()->d()), errorPrototype());
+ jsObjects[ReferenceErrorProto] = memoryManager->allocObject<ReferenceErrorPrototype>(internalClasses[EngineBase::Class_ErrorProto]->changePrototype(errorPrototype()->d()), errorPrototype());
+ jsObjects[SyntaxErrorProto] = memoryManager->allocObject<SyntaxErrorPrototype>(internalClasses[EngineBase::Class_ErrorProto]->changePrototype(errorPrototype()->d()), errorPrototype());
+ jsObjects[TypeErrorProto] = memoryManager->allocObject<TypeErrorPrototype>(internalClasses[EngineBase::Class_ErrorProto]->changePrototype(errorPrototype()->d()), errorPrototype());
+ jsObjects[URIErrorProto] = memoryManager->allocObject<URIErrorPrototype>(internalClasses[EngineBase::Class_ErrorProto]->changePrototype(errorPrototype()->d()), errorPrototype());
- jsObjects[VariantProto] = memoryManager->allocObject<VariantPrototype>(emptyClass, objectPrototype());
+ jsObjects[VariantProto] = memoryManager->allocObject<VariantPrototype>();
Q_ASSERT(variantPrototype()->prototype() == objectPrototype()->d());
- jsObjects[SequenceProto] = ScopedValue(scope, memoryManager->allocObject<SequencePrototype>(arrayClass, arrayPrototype()));
+ ic = newInternalClass(SequencePrototype::staticVTable(), SequencePrototype::defaultPrototype(this));
+ jsObjects[SequenceProto] = ScopedValue(scope, memoryManager->allocObject<SequencePrototype>(ic, SequencePrototype::defaultPrototype(this)));
ExecutionContext *global = rootContext();
jsObjects[Object_Ctor] = memoryManager->allocObject<ObjectCtor>(global);
@@ -490,7 +517,7 @@ ExecutionEngine::~ExecutionEngine()
for (QV4::CompiledData::CompilationUnit *unit : qAsConst(remainingUnits))
unit->unlink();
- emptyClass->destroy();
+ internalClasses[Class_Empty]->destroy();
delete classPool;
delete bumperPointerAllocator;
delete regExpCache;
@@ -548,6 +575,11 @@ ExecutionContext *ExecutionEngine::pushGlobalContext()
return currentContext;
}
+InternalClass *ExecutionEngine::newInternalClass(const VTable *vtable, Object *prototype)
+{
+ return internalClasses[EngineBase::Class_Empty]->changeVTable(vtable)->changePrototype(prototype ? prototype->d() : 0);
+}
+
Heap::Object *ExecutionEngine::newObject()
{
return memoryManager->allocObject<Object>();
@@ -864,8 +896,8 @@ static inline char *v4StackTrace(const ExecutionContext *context)
QString result;
QTextStream str(&result);
str << "stack=[";
- if (context && context->d()->engine) {
- const QVector<StackFrame> stackTrace = context->d()->engine->stackTrace(20);
+ if (context && context->engine()) {
+ const QVector<StackFrame> stackTrace = context->engine()->stackTrace(20);
for (int i = 0; i < stackTrace.size(); ++i) {
if (i)
str << ',';
diff --git a/src/qml/jsruntime/qv4engine_p.h b/src/qml/jsruntime/qv4engine_p.h
index a2c774c295..16a043dda5 100644
--- a/src/qml/jsruntime/qv4engine_p.h
+++ b/src/qml/jsruntime/qv4engine_p.h
@@ -55,6 +55,7 @@
#include "qv4managed_p.h"
#include "qv4context_p.h"
#include <private/qintrusivelist_p.h>
+#include "qv4enginebase_p.h"
#ifndef V4_BOOTSTRAP
# include <private/qv8engine_p.h>
@@ -96,16 +97,10 @@ private:
friend struct ExecutionContext;
friend struct Heap::ExecutionContext;
public:
- qint32 callDepth;
-
ExecutableAllocator *executableAllocator;
ExecutableAllocator *regExpAllocator;
QScopedPointer<EvalISelFactory> iselFactory;
- ExecutionContext *currentContext;
-
- Value *jsStackLimit;
-
WTF::BumpPointerAllocator *bumperPointerAllocator; // Used by Yarr Regex engine.
enum {
@@ -113,7 +108,6 @@ public:
GCStackLimit = 2*1024*1024
};
WTF::PageAllocation *jsStack;
- Value *jsStackBase;
WTF::PageAllocation *gcStack;
@@ -125,10 +119,6 @@ public:
return ptr;
}
- IdentifierTable *identifierTable;
-
- Object *globalObject;
-
Function *globalCode;
#ifdef V4_BOOTSTRAP
@@ -239,25 +229,6 @@ public:
Object *signalHandlerPrototype() const { return reinterpret_cast<Object *>(jsObjects + SignalHandlerProto); }
InternalClassPool *classPool;
- InternalClass *emptyClass;
-
- InternalClass *arrayClass;
- InternalClass *stringClass;
-
- InternalClass *functionClass;
- InternalClass *scriptFunctionClass;
- InternalClass *protoClass;
-
- InternalClass *regExpExecArrayClass;
- InternalClass *regExpObjectClass;
-
- InternalClass *argumentsObjectClass;
- InternalClass *strictArgumentsObjectClass;
-
- InternalClass *errorClass;
- InternalClass *errorClassWithMessage;
- InternalClass *errorProtoClass;
-
EvalFunction *evalFunction() const { return reinterpret_cast<EvalFunction *>(jsObjects + Eval_Function); }
FunctionObject *getStackFunction() const { return reinterpret_cast<FunctionObject *>(jsObjects + GetStack_Function); }
FunctionObject *thrower() const { return reinterpret_cast<FunctionObject *>(jsObjects + ThrowerObject); }
@@ -391,6 +362,8 @@ public:
void popContext();
ExecutionContext *parentContext(ExecutionContext *context) const;
+ InternalClass *newInternalClass(const VTable *vtable, Object *prototype);
+
Heap::Object *newObject();
Heap::Object *newObject(InternalClass *internalClass, Object *prototype);
diff --git a/src/qml/jsruntime/qv4enginebase_p.h b/src/qml/jsruntime/qv4enginebase_p.h
new file mode 100644
index 0000000000..88f9dfd85c
--- /dev/null
+++ b/src/qml/jsruntime/qv4enginebase_p.h
@@ -0,0 +1,128 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#ifndef QV4ENGINEBASE_P_H
+#define QV4ENGINEBASE_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <private/qv4global_p.h>
+#include <private/qv4runtimeapi_p.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace QV4 {
+
+// Base class for the execution engine
+
+#if defined(Q_CC_MSVC) || defined(Q_CC_GNU)
+#pragma pack(push, 1)
+#endif
+struct EngineBase {
+ Heap::ExecutionContext *current = 0;
+
+ Value *jsStackTop = 0;
+ quint8 hasException = false;
+ quint8 writeBarrierActive = false;
+ quint16 unused = 0;
+#if QT_POINTER_SIZE == 8
+ quint8 padding[4];
+#endif
+ MemoryManager *memoryManager = 0;
+ Runtime runtime;
+
+ qint32 callDepth = 0;
+ Value *jsStackLimit = 0;
+ Value *jsStackBase = 0;
+
+ ExecutionContext *currentContext = 0;
+ IdentifierTable *identifierTable = 0;
+ Object *globalObject = 0;
+
+ enum {
+ Class_Empty,
+ Class_String,
+ Class_MemberData,
+ Class_SimpleArrayData,
+ Class_SparseArrayData,
+ Class_ExecutionContext,
+ Class_SimpleCallContext,
+ Class_Object,
+ Class_ArrayObject,
+ Class_FunctionObject,
+ Class_StringObject,
+ Class_ScriptFunction,
+ Class_BuiltinFunction,
+ Class_ObjectProto,
+ Class_RegExp,
+ Class_RegExpObject,
+ Class_RegExpExecArray,
+ Class_ArgumentsObject,
+ Class_StrictArgumentsObject,
+ Class_ErrorObject,
+ Class_ErrorObjectWithMessage,
+ Class_ErrorProto,
+ NClasses
+ };
+ InternalClass *internalClasses[NClasses];
+};
+#if defined(Q_CC_MSVC) || defined(Q_CC_GNU)
+#pragma pack(pop)
+#endif
+
+Q_STATIC_ASSERT(std::is_standard_layout<EngineBase>::value);
+Q_STATIC_ASSERT(offsetof(EngineBase, current) == 0);
+Q_STATIC_ASSERT(offsetof(EngineBase, jsStackTop) == offsetof(EngineBase, current) + QT_POINTER_SIZE);
+Q_STATIC_ASSERT(offsetof(EngineBase, hasException) == offsetof(EngineBase, jsStackTop) + QT_POINTER_SIZE);
+Q_STATIC_ASSERT(offsetof(EngineBase, memoryManager) == offsetof(EngineBase, hasException) + QT_POINTER_SIZE);
+Q_STATIC_ASSERT(offsetof(EngineBase, runtime) == offsetof(EngineBase, memoryManager) + QT_POINTER_SIZE);
+
+}
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/qml/jsruntime/qv4errorobject.cpp b/src/qml/jsruntime/qv4errorobject.cpp
index 58742a0b84..b3bd28e18b 100644
--- a/src/qml/jsruntime/qv4errorobject.cpp
+++ b/src/qml/jsruntime/qv4errorobject.cpp
@@ -75,7 +75,7 @@ void Heap::ErrorObject::init()
Scope scope(internalClass->engine);
Scoped<QV4::ErrorObject> e(scope, this);
- if (internalClass == scope.engine->errorProtoClass)
+ if (internalClass == scope.engine->internalClasses[EngineBase::Class_ErrorProto])
return;
setProperty(scope.engine, QV4::ErrorObject::Index_Stack, scope.engine->getStackFunction()->d());
@@ -175,8 +175,6 @@ void ErrorObject::method_get_stack(const BuiltinFunction *, Scope &scope, CallDa
DEFINE_OBJECT_VTABLE(ErrorObject);
-DEFINE_OBJECT_VTABLE(SyntaxErrorObject);
-
void Heap::SyntaxErrorObject::init(const Value &msg)
{
Heap::ErrorObject::init(msg, SyntaxError);
@@ -322,8 +320,7 @@ void ErrorPrototype::init(ExecutionEngine *engine, Object *ctor, Object *obj, He
obj->setProperty(Index_Constructor, ctor->d());
obj->setProperty(Index_Message, engine->id_empty()->d());
obj->setProperty(Index_Name, engine->newString(QString::fromLatin1(ErrorObject::className(t))));
- if (t == Heap::ErrorObject::Error)
- obj->defineDefaultProperty(engine->id_toString(), method_toString, 0);
+ obj->defineDefaultProperty(engine->id_toString(), method_toString, 0);
}
void ErrorPrototype::method_toString(const BuiltinFunction *, Scope &scope, CallData *callData)
diff --git a/src/qml/jsruntime/qv4errorobject_p.h b/src/qml/jsruntime/qv4errorobject_p.h
index 5afd9efcba..d556617b48 100644
--- a/src/qml/jsruntime/qv4errorobject_p.h
+++ b/src/qml/jsruntime/qv4errorobject_p.h
@@ -160,7 +160,7 @@ struct ErrorObject: Object {
V4_OBJECT2(ErrorObject, Object)
Q_MANAGED_TYPE(ErrorObject)
- V4_INTERNALCLASS(errorClass)
+ V4_INTERNALCLASS(ErrorObject)
V4_PROTOTYPE(errorPrototype)
V4_NEEDS_DESTROY
@@ -205,8 +205,10 @@ struct ReferenceErrorObject: ErrorObject {
};
struct SyntaxErrorObject: ErrorObject {
- V4_OBJECT2(SyntaxErrorObject, ErrorObject)
+ typedef Heap::SyntaxErrorObject Data;
V4_PROTOTYPE(syntaxErrorPrototype)
+ const Data *d() const { return static_cast<const Data *>(ErrorObject::d()); }
+ Data *d() { return static_cast<Data *>(ErrorObject::d()); }
};
struct TypeErrorObject: ErrorObject {
@@ -326,19 +328,25 @@ inline SyntaxErrorObject *ErrorObject::asSyntaxError()
template <typename T>
Heap::Object *ErrorObject::create(ExecutionEngine *e, const Value &message) {
- return e->memoryManager->allocObject<T>(message.isUndefined() ? e->errorClass : e->errorClassWithMessage, T::defaultPrototype(e), message);
+ InternalClass *ic = e->internalClasses[message.isUndefined() ? EngineBase::Class_ErrorObject : EngineBase::Class_ErrorObjectWithMessage];
+ ic = ic->changePrototype(T::defaultPrototype(e)->d());
+ return e->memoryManager->allocObject<T>(ic, T::defaultPrototype(e), message);
}
template <typename T>
Heap::Object *ErrorObject::create(ExecutionEngine *e, const QString &message) {
Scope scope(e);
ScopedValue v(scope, message.isEmpty() ? Encode::undefined() : e->newString(message)->asReturnedValue());
- return e->memoryManager->allocObject<T>(v->isUndefined() ? e->errorClass : e->errorClassWithMessage, T::defaultPrototype(e), v);
+ InternalClass *ic = e->internalClasses[v->isUndefined() ? EngineBase::Class_ErrorObject : EngineBase::Class_ErrorObjectWithMessage];
+ ic = ic->changePrototype(T::defaultPrototype(e)->d());
+ return e->memoryManager->allocObject<T>(ic, T::defaultPrototype(e), v);
}
template <typename T>
Heap::Object *ErrorObject::create(ExecutionEngine *e, const QString &message, const QString &filename, int line, int column) {
Scope scope(e);
ScopedValue v(scope, message.isEmpty() ? Encode::undefined() : e->newString(message)->asReturnedValue());
- return e->memoryManager->allocObject<T>(v->isUndefined() ? e->errorClass : e->errorClassWithMessage, T::defaultPrototype(e), v, filename, line, column);
+ InternalClass *ic = e->internalClasses[v->isUndefined() ? EngineBase::Class_ErrorObject : EngineBase::Class_ErrorObjectWithMessage];
+ ic = ic->changePrototype(T::defaultPrototype(e)->d());
+ return e->memoryManager->allocObject<T>(ic, T::defaultPrototype(e), v, filename, line, column);
}
diff --git a/src/qml/jsruntime/qv4executableallocator_p.h b/src/qml/jsruntime/qv4executableallocator_p.h
index f13f70e01a..353a6eacff 100644
--- a/src/qml/jsruntime/qv4executableallocator_p.h
+++ b/src/qml/jsruntime/qv4executableallocator_p.h
@@ -67,7 +67,7 @@ QT_BEGIN_NAMESPACE
namespace QV4 {
-class Q_AUTOTEST_EXPORT ExecutableAllocator
+class Q_QML_AUTOTEST_EXPORT ExecutableAllocator
{
public:
struct ChunkOfPages;
diff --git a/src/qml/jsruntime/qv4function.cpp b/src/qml/jsruntime/qv4function.cpp
index ed9e3699f2..4c8117527c 100644
--- a/src/qml/jsruntime/qv4function.cpp
+++ b/src/qml/jsruntime/qv4function.cpp
@@ -59,7 +59,7 @@ Function::Function(ExecutionEngine *engine, CompiledData::CompilationUnit *unit,
{
Q_UNUSED(engine);
- internalClass = engine->emptyClass;
+ internalClass = engine->internalClasses[EngineBase::Class_Empty];
const CompiledData::LEUInt32 *formalsIndices = compiledFunction->formalsTable();
// iterate backwards, so we get the right ordering for duplicate names
Scope scope(engine);
@@ -74,7 +74,7 @@ Function::Function(ExecutionEngine *engine, CompiledData::CompilationUnit *unit,
}
// duplicate arguments, need some trick to store them
MemoryManager *mm = engine->memoryManager;
- arg = mm->alloc<String>(mm, arg->d(), engine->newString(QString(0xfffe)));
+ arg = mm->alloc<String>(arg->d(), engine->newString(QString(0xfffe)));
}
}
nFormals = compiledFunction->nFormals;
@@ -92,7 +92,7 @@ Function::~Function()
void Function::updateInternalClass(ExecutionEngine *engine, const QList<QByteArray> &parameters)
{
- internalClass = engine->emptyClass;
+ internalClass = engine->internalClasses[EngineBase::Class_Empty];
// iterate backwards, so we get the right ordering for duplicate names
Scope scope(engine);
@@ -106,7 +106,7 @@ void Function::updateInternalClass(ExecutionEngine *engine, const QList<QByteArr
break;
}
// duplicate arguments, need some trick to store them
- arg = engine->memoryManager->alloc<String>(engine->memoryManager, arg->d(), engine->newString(QString(0xfffe)));
+ arg = engine->memoryManager->alloc<String>(arg->d(), engine->newString(QString(0xfffe)));
}
}
nFormals = parameters.size();
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp
index 5c8f03dc72..45fdde98f7 100644
--- a/src/qml/jsruntime/qv4functionobject.cpp
+++ b/src/qml/jsruntime/qv4functionobject.cpp
@@ -124,8 +124,8 @@ void FunctionObject::init(String *n, bool createProto)
Q_ASSERT(internalClass() && internalClass()->find(s.engine->id_prototype()) == Heap::FunctionObject::Index_Prototype);
if (createProto) {
- ScopedObject proto(s, scope()->engine->newObject(s.engine->protoClass, s.engine->objectPrototype()));
- Q_ASSERT(s.engine->protoClass->find(s.engine->id_constructor()) == Heap::FunctionObject::Index_ProtoConstructor);
+ ScopedObject proto(s, s.engine->newObject(s.engine->internalClasses[EngineBase::Class_ObjectProto], s.engine->objectPrototype()));
+ Q_ASSERT(s.engine->internalClasses[EngineBase::Class_ObjectProto]->find(s.engine->id_constructor()) == Heap::FunctionObject::Index_ProtoConstructor);
proto->setProperty(Heap::FunctionObject::Index_ProtoConstructor, d());
setProperty(Heap::FunctionObject::Index_Prototype, proto);
} else {
@@ -138,7 +138,7 @@ void FunctionObject::init(String *n, bool createProto)
ReturnedValue FunctionObject::name() const
{
- return get(scope()->engine->id_name());
+ return get(scope()->internalClass->engine->id_name());
}
void FunctionObject::construct(const Managed *that, Scope &scope, CallData *)
@@ -153,7 +153,7 @@ void FunctionObject::call(const Managed *, Scope &scope, CallData *)
Heap::FunctionObject *FunctionObject::createScriptFunction(ExecutionContext *scope, Function *function)
{
- return scope->d()->engine->memoryManager->allocObject<ScriptFunction>(scope, function);
+ return scope->engine()->memoryManager->allocObject<ScriptFunction>(scope, function);
}
bool FunctionObject::isBinding() const
@@ -369,8 +369,8 @@ void ScriptFunction::construct(const Managed *that, Scope &scope, CallData *call
Scoped<ScriptFunction> f(scope, static_cast<const ScriptFunction *>(that));
- InternalClass *ic = v4->emptyClass;
- ScopedObject proto(scope, f->protoForConstructor());
+ InternalClass *ic = f->classForConstructor();
+ ScopedObject proto(scope, ic->prototype);
ScopedObject obj(scope, v4->newObject(ic, proto));
callData->thisObject = obj.asReturnedValue();
@@ -433,54 +433,24 @@ void Heap::ScriptFunction::init(QV4::ExecutionContext *scope, Function *function
ScopedProperty pd(s);
pd->value = s.engine->thrower();
pd->set = s.engine->thrower();
- f->insertMember(scope->d()->engine->id_caller(), pd, Attr_Accessor|Attr_NotConfigurable|Attr_NotEnumerable);
- f->insertMember(scope->d()->engine->id_arguments(), pd, Attr_Accessor|Attr_NotConfigurable|Attr_NotEnumerable);
+ f->insertMember(s.engine->id_caller(), pd, Attr_Accessor|Attr_NotConfigurable|Attr_NotEnumerable);
+ f->insertMember(s.engine->id_arguments(), pd, Attr_Accessor|Attr_NotConfigurable|Attr_NotEnumerable);
}
}
-Heap::Object *ScriptFunction::protoForConstructor() const
+InternalClass *ScriptFunction::classForConstructor() const
{
const Object *o = d()->protoProperty();
- if (o)
- return o->d();
- return engine()->objectPrototype()->d();
-}
-
-
+ InternalClass *ic = d()->cachedClassForConstructor;
+ if (ic && ic->prototype == o->d())
+ return ic;
-DEFINE_OBJECT_VTABLE(OldBuiltinFunction);
-
-void Heap::OldBuiltinFunction::init(QV4::ExecutionContext *scope, QV4::String *name, ReturnedValue (*code)(QV4::CallContext *))
-{
- Heap::FunctionObject::init(scope, name);
- this->code = code;
-}
-
-void OldBuiltinFunction::construct(const Managed *f, Scope &scope, CallData *)
-{
- scope.result = static_cast<const OldBuiltinFunction *>(f)->internalClass()->engine->throwTypeError();
-}
-
-void OldBuiltinFunction::call(const Managed *that, Scope &scope, CallData *callData)
-{
- const OldBuiltinFunction *f = static_cast<const OldBuiltinFunction *>(that);
- ExecutionEngine *v4 = scope.engine;
- if (v4->hasException) {
- scope.result = Encode::undefined();
- return;
- }
- CHECK_STACK_LIMITS(v4, scope);
-
- ExecutionContextSaver ctxSaver(scope);
-
- SimpleCallContext::Data *ctx = v4->memoryManager->allocSimpleCallContext(v4);
- ctx->strictMode = f->scope()->strictMode; // ### needed? scope or parent context?
- ctx->callData = callData;
- v4->pushContext(ctx);
- Q_ASSERT(v4->current == ctx);
+ ic = engine()->internalClasses[EngineBase::Class_Object];
+ if (o)
+ ic = ic->changePrototype(o->d());
+ d()->cachedClassForConstructor = ic;
- scope.result = f->d()->code(static_cast<QV4::CallContext *>(v4->currentContext));
- v4->memoryManager->freeSimpleCallContext();
+ return ic;
}
DEFINE_OBJECT_VTABLE(BuiltinFunction);
@@ -520,7 +490,7 @@ void IndexedBuiltinFunction::call(const Managed *that, Scope &scope, CallData *c
ExecutionContextSaver ctxSaver(scope);
- SimpleCallContext::Data *ctx = v4->memoryManager->allocSimpleCallContext(v4);
+ SimpleCallContext::Data *ctx = v4->memoryManager->allocSimpleCallContext();
ctx->strictMode = f->scope()->strictMode; // ### needed? scope or parent context?
ctx->callData = callData;
v4->pushContext(ctx);
diff --git a/src/qml/jsruntime/qv4functionobject_p.h b/src/qml/jsruntime/qv4functionobject_p.h
index d8929026ca..6ce5734b6d 100644
--- a/src/qml/jsruntime/qv4functionobject_p.h
+++ b/src/qml/jsruntime/qv4functionobject_p.h
@@ -118,6 +118,8 @@ struct ScriptFunction : FunctionObject {
Index_Length
};
void init(QV4::ExecutionContext *scope, Function *function);
+
+ QV4::InternalClass *cachedClassForConstructor;
};
#define BoundFunctionMembers(class, Member) \
@@ -139,7 +141,7 @@ struct Q_QML_EXPORT FunctionObject: Object {
};
V4_OBJECT2(FunctionObject, Object)
Q_MANAGED_TYPE(FunctionObject)
- V4_INTERNALCLASS(functionClass)
+ V4_INTERNALCLASS(FunctionObject)
V4_PROTOTYPE(functionPrototype)
V4_NEEDS_DESTROY
@@ -192,20 +194,10 @@ struct FunctionPrototype: FunctionObject
static void method_bind(const BuiltinFunction *, Scope &scope, CallData *callData);
};
-struct Q_QML_EXPORT OldBuiltinFunction : FunctionObject {
- V4_OBJECT2(OldBuiltinFunction, FunctionObject)
-
- static void construct(const Managed *, Scope &scope, CallData *);
- static void call(const Managed *that, Scope &scope, CallData *callData);
-};
-
struct Q_QML_EXPORT BuiltinFunction : FunctionObject {
V4_OBJECT2(BuiltinFunction, FunctionObject)
+ V4_INTERNALCLASS(BuiltinFunction)
- static Heap::OldBuiltinFunction *create(ExecutionContext *scope, String *name, ReturnedValue (*code)(CallContext *))
- {
- return scope->engine()->memoryManager->allocObject<OldBuiltinFunction>(scope, name, code);
- }
static Heap::BuiltinFunction *create(ExecutionContext *scope, String *name, void (*code)(const BuiltinFunction *, Scope &, CallData *))
{
return scope->engine()->memoryManager->allocObject<BuiltinFunction>(scope, name, code);
@@ -238,12 +230,12 @@ void Heap::IndexedBuiltinFunction::init(QV4::ExecutionContext *scope, uint index
struct ScriptFunction : FunctionObject {
V4_OBJECT2(ScriptFunction, FunctionObject)
- V4_INTERNALCLASS(scriptFunctionClass)
+ V4_INTERNALCLASS(ScriptFunction)
static void construct(const Managed *, Scope &scope, CallData *callData);
static void call(const Managed *that, Scope &scope, CallData *callData);
- Heap::Object *protoForConstructor() const;
+ InternalClass *classForConstructor() const;
};
diff --git a/src/qml/jsruntime/qv4globalobject.cpp b/src/qml/jsruntime/qv4globalobject.cpp
index f0630660d4..0916e8e110 100644
--- a/src/qml/jsruntime/qv4globalobject.cpp
+++ b/src/qml/jsruntime/qv4globalobject.cpp
@@ -332,8 +332,8 @@ DEFINE_OBJECT_VTABLE(EvalFunction);
void Heap::EvalFunction::init(QV4::ExecutionContext *scope)
{
- Heap::FunctionObject::init(scope, scope->d()->engine->id_eval());
Scope s(scope);
+ Heap::FunctionObject::init(scope, s.engine->id_eval());
ScopedFunctionObject f(s, this);
f->defineReadonlyProperty(s.engine->id_length(), Primitive::fromInt32(1));
}
diff --git a/src/qml/jsruntime/qv4internalclass.cpp b/src/qml/jsruntime/qv4internalclass.cpp
index 3d9a672f2f..603da1df7b 100644
--- a/src/qml/jsruntime/qv4internalclass.cpp
+++ b/src/qml/jsruntime/qv4internalclass.cpp
@@ -43,6 +43,7 @@
#include <qv4identifier_p.h>
#include "qv4object_p.h"
#include "qv4identifiertable_p.h"
+#include "qv4value_p.h"
QT_BEGIN_NAMESPACE
@@ -104,6 +105,8 @@ void PropertyHash::addEntry(const PropertyHash::Entry &entry, int classSize)
InternalClass::InternalClass(ExecutionEngine *engine)
: engine(engine)
+ , vtable(0)
+ , prototype(0)
, m_sealed(0)
, m_frozen(0)
, size(0)
@@ -115,6 +118,8 @@ InternalClass::InternalClass(ExecutionEngine *engine)
InternalClass::InternalClass(const QV4::InternalClass &other)
: QQmlJS::Managed()
, engine(other.engine)
+ , vtable(other.vtable)
+ , prototype(other.prototype)
, propertyTable(other.propertyTable)
, nameMap(other.nameMap)
, propertyData(other.propertyData)
@@ -126,6 +131,24 @@ InternalClass::InternalClass(const QV4::InternalClass &other)
Q_ASSERT(extensible);
}
+static void insertHoleIntoPropertyData(Object *object, int idx)
+{
+ Heap::Object *o = object->d();
+ ExecutionEngine *v4 = o->internalClass->engine;
+ int size = o->internalClass->size;
+ for (int i = size - 1; i > idx; --i)
+ o->setProperty(v4, i, *o->propertyData(i - 1));
+}
+
+static void removeFromPropertyData(Object *object, int idx, bool accessor = false)
+{
+ Heap::Object *o = object->d();
+ ExecutionEngine *v4 = o->internalClass->engine;
+ int size = o->internalClass->size;
+ for (int i = idx; i < size; ++i)
+ o->setProperty(v4, i, *o->propertyData(i + (accessor ? 2 : 1)));
+}
+
void InternalClass::changeMember(Object *object, String *string, PropertyAttributes data, uint *index)
{
uint idx;
@@ -137,10 +160,10 @@ void InternalClass::changeMember(Object *object, String *string, PropertyAttribu
object->setInternalClass(newClass);
if (newClass->size > oldClass->size) {
Q_ASSERT(newClass->size == oldClass->size + 1);
- object->d()->memberData->values.insertData(newClass->engine, idx + 1, Primitive::emptyValue());
+ insertHoleIntoPropertyData(object, idx);
} else if (newClass->size < oldClass->size) {
Q_ASSERT(newClass->size == oldClass->size - 1);
- object->d()->memberData->values.removeData(newClass->engine, idx + 1);
+ removeFromPropertyData(object, idx + 1);
}
}
@@ -167,13 +190,14 @@ InternalClass *InternalClass::changeMember(Identifier *identifier, PropertyAttri
if (data == propertyData.at(idx))
return this;
- Transition temp = { identifier, 0, (int)data.flags() };
+ Transition temp = { { identifier }, nullptr, (int)data.flags() };
Transition &t = lookupOrInsertTransition(temp);
if (t.lookup)
return t.lookup;
// create a new class and add it to the tree
- InternalClass *newClass = engine->emptyClass;
+ InternalClass *newClass = engine->internalClasses[EngineBase::Class_Empty]->changeVTable(vtable);
+ newClass = newClass->changePrototype(prototype);
for (uint i = 0; i < size; ++i) {
if (i == idx) {
newClass = newClass->addMember(nameMap.at(i), data);
@@ -187,12 +211,72 @@ InternalClass *InternalClass::changeMember(Identifier *identifier, PropertyAttri
return newClass;
}
+InternalClass *InternalClass::changePrototypeImpl(Heap::Object *proto)
+{
+ Q_ASSERT(prototype != proto);
+
+ Transition temp = { { nullptr }, 0, Transition::PrototypeChange };
+ temp.prototype = proto;
+
+ Transition &t = lookupOrInsertTransition(temp);
+ if (t.lookup)
+ return t.lookup;
+
+ // create a new class and add it to the tree
+ InternalClass *newClass;
+ if (!size && !prototype) {
+ newClass = engine->newClass(*this);
+ newClass->prototype = proto;
+ } else {
+ newClass = engine->internalClasses[EngineBase::Class_Empty]->changeVTable(vtable);
+ newClass = newClass->changePrototype(proto);
+ for (uint i = 0; i < size; ++i) {
+ if (!propertyData.at(i).isEmpty())
+ newClass = newClass->addMember(nameMap.at(i), propertyData.at(i));
+ }
+ }
+
+ t.lookup = newClass;
+ return newClass;
+}
+
+InternalClass *InternalClass::changeVTableImpl(const VTable *vt)
+{
+ Q_ASSERT(vtable != vt);
+
+ Transition temp = { { nullptr }, nullptr, Transition::VTableChange };
+ temp.vtable = vt;
+
+ Transition &t = lookupOrInsertTransition(temp);
+ if (t.lookup)
+ return t.lookup;
+
+ // create a new class and add it to the tree
+ InternalClass *newClass;
+ if (this == engine->internalClasses[EngineBase::Class_Empty]) {
+ newClass = engine->newClass(*this);
+ newClass->vtable = vt;
+ } else {
+ newClass = engine->internalClasses[EngineBase::Class_Empty]->changeVTable(vt);
+ newClass = newClass->changePrototype(prototype);
+ for (uint i = 0; i < size; ++i) {
+ if (!propertyData.at(i).isEmpty())
+ newClass = newClass->addMember(nameMap.at(i), propertyData.at(i));
+ }
+ }
+
+ t.lookup = newClass;
+ Q_ASSERT(t.lookup);
+ Q_ASSERT(newClass->vtable);
+ return newClass;
+}
+
InternalClass *InternalClass::nonExtensible()
{
if (!extensible)
return this;
- Transition temp = { Q_NULLPTR, Q_NULLPTR, Transition::NotExtensible};
+ Transition temp = { { nullptr }, nullptr, Transition::NotExtensible};
Transition &t = lookupOrInsertTransition(temp);
if (t.lookup)
return t.lookup;
@@ -240,7 +324,7 @@ InternalClass *InternalClass::addMember(Identifier *identifier, PropertyAttribut
InternalClass *InternalClass::addMemberImpl(Identifier *identifier, PropertyAttributes data, uint *index)
{
- Transition temp = { identifier, 0, (int)data.flags() };
+ Transition temp = { { identifier }, nullptr, (int)data.flags() };
Transition &t = lookupOrInsertTransition(temp);
if (index)
@@ -276,7 +360,7 @@ void InternalClass::removeMember(Object *object, Identifier *id)
uint propIdx = oldClass->propertyTable.lookup(id);
Q_ASSERT(propIdx < oldClass->size);
- Transition temp = { id, 0, -1 };
+ Transition temp = { { id }, nullptr, -1 };
Transition &t = object->internalClass()->lookupOrInsertTransition(temp);
bool accessor = oldClass->propertyData.at(propIdx).isAccessor();
@@ -285,7 +369,8 @@ void InternalClass::removeMember(Object *object, Identifier *id)
object->setInternalClass(t.lookup);
} else {
// create a new class and add it to the tree
- InternalClass *newClass = oldClass->engine->emptyClass;
+ InternalClass *newClass = oldClass->engine->internalClasses[EngineBase::Class_Empty]->changeVTable(oldClass->vtable);
+ newClass = newClass->changePrototype(oldClass->prototype);
for (uint i = 0; i < oldClass->size; ++i) {
if (i == propIdx)
continue;
@@ -298,14 +383,17 @@ void InternalClass::removeMember(Object *object, Identifier *id)
Q_ASSERT(object->internalClass()->size == oldClass->size - (accessor ? 2 : 1));
// remove the entry in the property data
- object->d()->memberData->values.removeData(oldClass->engine, propIdx, accessor ? 2 : 1);
+ removeFromPropertyData(object, propIdx, accessor);
t.lookup = object->internalClass();
Q_ASSERT(t.lookup);
}
-uint InternalClass::find(const Identifier *id)
+uint QV4::InternalClass::find(const String *string)
{
+ engine->identifierTable->identifier(string);
+ const Identifier *id = string->d()->identifier;
+
uint index = propertyTable.lookup(id);
if (index < size)
return index;
@@ -318,7 +406,8 @@ InternalClass *InternalClass::sealed()
if (m_sealed)
return m_sealed;
- m_sealed = engine->emptyClass;
+ m_sealed = engine->internalClasses[EngineBase::Class_Empty]->changeVTable(vtable);
+ m_sealed = m_sealed->changePrototype(prototype);
for (uint i = 0; i < size; ++i) {
PropertyAttributes attrs = propertyData.at(i);
if (attrs.isEmpty())
@@ -347,7 +436,8 @@ InternalClass *InternalClass::frozen()
InternalClass *InternalClass::propertiesFrozen() const
{
- InternalClass *frozen = engine->emptyClass;
+ InternalClass *frozen = engine->internalClasses[EngineBase::Class_Empty]->changeVTable(vtable);
+ frozen = frozen->changePrototype(prototype);
for (uint i = 0; i < size; ++i) {
PropertyAttributes attrs = propertyData.at(i);
if (attrs.isEmpty())
@@ -390,7 +480,23 @@ void InternalClass::destroy()
void InternalClassPool::markObjects(MarkStack *markStack)
{
- Q_UNUSED(markStack);
+ InternalClass *ic = markStack->engine->internalClasses[EngineBase::Class_Empty];
+ Q_ASSERT(!ic->prototype);
+
+ // only need to go two levels into the IC hierarchy, as prototype changes
+ // can only happen there
+ for (auto &t : ic->transitions) {
+ Q_ASSERT(t.lookup);
+ if (t.flags == InternalClassTransition::VTableChange) {
+ InternalClass *ic2 = t.lookup;
+ for (auto &t2 : ic2->transitions) {
+ if (t2.flags == InternalClassTransition::PrototypeChange)
+ t2.lookup->prototype->mark(markStack);
+ }
+ } else if (t.flags == InternalClassTransition::PrototypeChange) {
+ t.lookup->prototype->mark(markStack);
+ }
+ }
}
QT_END_NAMESPACE
diff --git a/src/qml/jsruntime/qv4internalclass_p.h b/src/qml/jsruntime/qv4internalclass_p.h
index a29ce5b5ff..df17074e72 100644
--- a/src/qml/jsruntime/qv4internalclass_p.h
+++ b/src/qml/jsruntime/qv4internalclass_p.h
@@ -54,18 +54,17 @@
#include <QHash>
#include <private/qqmljsmemorypool_p.h>
-#include <private/qv4engine_p.h>
-#include <private/qv4identifiertable_p.h>
+#include <private/qv4identifier_p.h>
QT_BEGIN_NAMESPACE
namespace QV4 {
struct String;
-struct ExecutionEngine;
struct Object;
struct Identifier;
struct VTable;
+struct MarkStack;
struct PropertyHashData;
struct PropertyHash
@@ -222,12 +221,18 @@ private:
struct InternalClassTransition
{
- Identifier *id;
+ union {
+ Identifier *id;
+ const VTable *vtable;
+ Heap::Object *prototype;
+ };
InternalClass *lookup;
int flags;
enum {
// range 0-0xff is reserved for attribute changes
- NotExtensible = 0x100
+ NotExtensible = 0x100,
+ VTableChange = 0x200,
+ PrototypeChange = 0x201
};
bool operator==(const InternalClassTransition &other) const
@@ -239,6 +244,8 @@ struct InternalClassTransition
struct InternalClass : public QQmlJS::Managed {
ExecutionEngine *engine;
+ const VTable *vtable;
+ Heap::Object *prototype;
PropertyHash propertyTable; // id to valueIndex
SharedInternalClassData<Identifier *> nameMap;
@@ -254,41 +261,49 @@ struct InternalClass : public QQmlJS::Managed {
uint size;
bool extensible;
- InternalClass *nonExtensible();
+ Q_REQUIRED_RESULT InternalClass *nonExtensible();
+ Q_REQUIRED_RESULT InternalClass *changeVTable(const VTable *vt) {
+ if (vtable == vt)
+ return this;
+ return changeVTableImpl(vt);
+ }
+ Q_REQUIRED_RESULT InternalClass *changePrototype(Heap::Object *proto) {
+ if (prototype == proto)
+ return this;
+ return changePrototypeImpl(proto);
+ }
+
static void addMember(Object *object, String *string, PropertyAttributes data, uint *index);
- InternalClass *addMember(String *string, PropertyAttributes data, uint *index = 0);
- InternalClass *addMember(Identifier *identifier, PropertyAttributes data, uint *index = 0);
- InternalClass *changeMember(Identifier *identifier, PropertyAttributes data, uint *index = 0);
+ Q_REQUIRED_RESULT InternalClass *addMember(String *string, PropertyAttributes data, uint *index = 0);
+ Q_REQUIRED_RESULT InternalClass *addMember(Identifier *identifier, PropertyAttributes data, uint *index = 0);
+ Q_REQUIRED_RESULT InternalClass *changeMember(Identifier *identifier, PropertyAttributes data, uint *index = 0);
static void changeMember(Object *object, String *string, PropertyAttributes data, uint *index = 0);
static void removeMember(Object *object, Identifier *id);
uint find(const String *string);
- uint find(const Identifier *id);
+ uint find(const Identifier *id)
+ {
+ uint index = propertyTable.lookup(id);
+ if (index < size)
+ return index;
+
+ return UINT_MAX;
+ }
- InternalClass *sealed();
- InternalClass *frozen();
- InternalClass *propertiesFrozen() const;
+ Q_REQUIRED_RESULT InternalClass *sealed();
+ Q_REQUIRED_RESULT InternalClass *frozen();
+ Q_REQUIRED_RESULT InternalClass *propertiesFrozen() const;
void destroy();
private:
+ Q_QML_EXPORT InternalClass *changeVTableImpl(const VTable *vt);
+ Q_QML_EXPORT InternalClass *changePrototypeImpl(Heap::Object *proto);
InternalClass *addMemberImpl(Identifier *identifier, PropertyAttributes data, uint *index);
friend struct ExecutionEngine;
InternalClass(ExecutionEngine *engine);
InternalClass(const InternalClass &other);
};
-inline uint InternalClass::find(const String *string)
-{
- engine->identifierTable->identifier(string);
- const Identifier *id = string->d()->identifier;
-
- uint index = propertyTable.lookup(id);
- if (index < size)
- return index;
-
- return UINT_MAX;
-}
-
struct InternalClassPool : public QQmlJS::MemoryPool
{
void markObjects(MarkStack *markStack);
diff --git a/src/qml/jsruntime/qv4lookup.cpp b/src/qml/jsruntime/qv4lookup.cpp
index 11d7767e05..d943ae1340 100644
--- a/src/qml/jsruntime/qv4lookup.cpp
+++ b/src/qml/jsruntime/qv4lookup.cpp
@@ -63,7 +63,7 @@ ReturnedValue Lookup::lookup(const Value &thisObject, Object *o, PropertyAttribu
return !attrs->isAccessor() ? v->asReturnedValue() : Object::getValue(thisObject, *v, *attrs);
}
- obj = obj->prototype;
+ obj = obj->prototype();
++i;
}
level = Size;
@@ -76,7 +76,7 @@ ReturnedValue Lookup::lookup(const Value &thisObject, Object *o, PropertyAttribu
return !attrs->isAccessor() ? v->asReturnedValue() : Object::getValue(thisObject, *v, *attrs);
}
- obj = obj->prototype;
+ obj = obj->prototype();
}
return Primitive::emptyValue().asReturnedValue();
}
@@ -98,7 +98,7 @@ ReturnedValue Lookup::lookup(const Object *thisObject, PropertyAttributes *attrs
return !attrs->isAccessor() ? v->asReturnedValue() : thisObject->getValue(*v, *attrs);
}
- obj = obj->prototype;
+ obj = obj->prototype();
++i;
}
level = Size;
@@ -111,7 +111,7 @@ ReturnedValue Lookup::lookup(const Object *thisObject, PropertyAttributes *attrs
return !attrs->isAccessor() ? v->asReturnedValue() : thisObject->getValue(*v, *attrs);
}
- obj = obj->prototype;
+ obj = obj->prototype();
}
return Primitive::emptyValue().asReturnedValue();
}
@@ -284,11 +284,17 @@ ReturnedValue Lookup::getterGeneric(Lookup *l, ExecutionEngine *engine, const Va
ReturnedValue v = l->lookup(object, proto, &attrs);
if (v != Primitive::emptyValue().asReturnedValue()) {
l->type = object.type();
- l->proto = proto;
+ l->proto = proto->d();
if (attrs.isData()) {
- if (l->level == 0)
- l->getter = Lookup::primitiveGetter0;
- else if (l->level == 1)
+ if (l->level == 0) {
+ uint nInline = l->proto->vtable()->nInlineProperties;
+ if (l->index < nInline)
+ l->getter = Lookup::primitiveGetter0Inline;
+ else {
+ l->index -= nInline;
+ l->getter = Lookup::primitiveGetter0MemberData;
+ }
+ } else if (l->level == 1)
l->getter = Lookup::primitiveGetter1;
return v;
} else {
@@ -307,15 +313,18 @@ ReturnedValue Lookup::getterTwoClasses(Lookup *l, ExecutionEngine *engine, const
{
Lookup l1 = *l;
- if (l1.getter == Lookup::getter0 || l1.getter == Lookup::getter1) {
+ if (l1.getter == Lookup::getter0MemberData || l1.getter == Lookup::getter0Inline || l1.getter == Lookup::getter1) {
if (const Object *o = object.as<Object>()) {
ReturnedValue v = o->getLookup(l);
Lookup l2 = *l;
- if (l->index != UINT_MAX && (l2.getter == Lookup::getter0 || l2.getter == Lookup::getter1)) {
- // if we have a getter0, make sure it comes first
- if (l2.getter == Lookup::getter0)
- qSwap(l1, l2);
+ if (l2.index != UINT_MAX) {
+ if (l1.getter != Lookup::getter0Inline) {
+ if (l2.getter == Lookup::getter0Inline ||
+ (l1.getter != Lookup::getter0MemberData && l2.getter == Lookup::getter0MemberData))
+ // sort the better getter first
+ qSwap(l1, l2);
+ }
l->classList[0] = l1.classList[0];
l->classList[1] = l1.classList[1];
@@ -324,8 +333,22 @@ ReturnedValue Lookup::getterTwoClasses(Lookup *l, ExecutionEngine *engine, const
l->index = l1.index;
l->index2 = l2.index;
- if (l1.getter == Lookup::getter0) {
- l->getter = (l2.getter == Lookup::getter0) ? Lookup::getter0getter0 : Lookup::getter0getter1;
+ if (l1.getter == Lookup::getter0Inline) {
+ if (l2.getter == Lookup::getter0Inline)
+ l->getter = Lookup::getter0Inlinegetter0Inline;
+ else if (l2.getter == Lookup::getter0MemberData)
+ l->getter = Lookup::getter0Inlinegetter0MemberData;
+ else if (l2.getter == Lookup::getter1)
+ l->getter = Lookup::getter0Inlinegetter1;
+ else
+ Q_UNREACHABLE();
+ } else if (l1.getter == Lookup::getter0MemberData) {
+ if (l2.getter == Lookup::getter0MemberData)
+ l->getter = Lookup::getter0MemberDatagetter0MemberData;
+ else if (l2.getter == Lookup::getter1)
+ l->getter = Lookup::getter0MemberDatagetter1;
+ else
+ Q_UNREACHABLE();
} else {
Q_ASSERT(l1.getter == Lookup::getter1 && l2.getter == Lookup::getter1);
l->getter = Lookup::getter1getter1;
@@ -349,14 +372,26 @@ ReturnedValue Lookup::getterFallback(Lookup *l, ExecutionEngine *engine, const V
return o->get(name);
}
-ReturnedValue Lookup::getter0(Lookup *l, ExecutionEngine *engine, const Value &object)
+ReturnedValue Lookup::getter0MemberData(Lookup *l, ExecutionEngine *engine, const Value &object)
{
// we can safely cast to a QV4::Object here. If object is actually a string,
// the internal class won't match
Heap::Object *o = static_cast<Heap::Object *>(object.heapObject());
if (o) {
if (l->classList[0] == o->internalClass)
- return o->propertyData(l->index)->asReturnedValue();
+ return o->memberData->values.data()[l->index].asReturnedValue();
+ }
+ return getterTwoClasses(l, engine, object);
+}
+
+ReturnedValue Lookup::getter0Inline(Lookup *l, ExecutionEngine *engine, const Value &object)
+{
+ // we can safely cast to a QV4::Object here. If object is actually a string,
+ // the internal class won't match
+ Heap::Object *o = static_cast<Heap::Object *>(object.heapObject());
+ if (o) {
+ if (l->classList[0] == o->internalClass)
+ return o->inlinePropertyData(l->index)->asReturnedValue();
}
return getterTwoClasses(l, engine, object);
}
@@ -367,8 +402,8 @@ ReturnedValue Lookup::getter1(Lookup *l, ExecutionEngine *engine, const Value &o
// the internal class won't match
Heap::Object *o = static_cast<Heap::Object *>(object.heapObject());
if (o) {
- if (l->classList[0] == o->internalClass && l->classList[1] == o->prototype->internalClass)
- return o->prototype->propertyData(l->index)->asReturnedValue();
+ if (l->classList[0] == o->internalClass && l->classList[1] == l->proto->internalClass)
+ return l->proto->propertyData(l->index)->asReturnedValue();
}
return getterTwoClasses(l, engine, object);
}
@@ -380,9 +415,9 @@ ReturnedValue Lookup::getter2(Lookup *l, ExecutionEngine *engine, const Value &o
Heap::Object *o = static_cast<Heap::Object *>(object.heapObject());
if (o) {
if (l->classList[0] == o->internalClass) {
- Heap::Object *p = o->prototype;
- if (l->classList[1] == p->internalClass) {
- p = p->prototype;
+ Q_ASSERT(l->proto == o->prototype());
+ if (l->classList[1] == l->proto->internalClass) {
+ Heap::Object *p = l->proto->prototype();
if (l->classList[2] == p->internalClass)
return p->propertyData(l->index)->asReturnedValue();
}
@@ -392,31 +427,76 @@ ReturnedValue Lookup::getter2(Lookup *l, ExecutionEngine *engine, const Value &o
return getterFallback(l, engine, object);
}
-ReturnedValue Lookup::getter0getter0(Lookup *l, ExecutionEngine *engine, const Value &object)
+ReturnedValue Lookup::getter0Inlinegetter0Inline(Lookup *l, ExecutionEngine *engine, const Value &object)
{
// we can safely cast to a QV4::Object here. If object is actually a string,
// the internal class won't match
Heap::Object *o = static_cast<Heap::Object *>(object.heapObject());
if (o) {
if (l->classList[0] == o->internalClass)
- return o->propertyData(l->index)->asReturnedValue();
+ return o->inlinePropertyData(l->index)->asReturnedValue();
if (l->classList[2] == o->internalClass)
- return o->propertyData(l->index2)->asReturnedValue();
+ return o->inlinePropertyData(l->index2)->asReturnedValue();
+ }
+ l->getter = getterFallback;
+ return getterFallback(l, engine, object);
+}
+
+ReturnedValue Lookup::getter0Inlinegetter0MemberData(Lookup *l, ExecutionEngine *engine, const Value &object)
+{
+ // we can safely cast to a QV4::Object here. If object is actually a string,
+ // the internal class won't match
+ Heap::Object *o = static_cast<Heap::Object *>(object.heapObject());
+ if (o) {
+ if (l->classList[0] == o->internalClass)
+ return o->inlinePropertyData(l->index)->asReturnedValue();
+ if (l->classList[2] == o->internalClass)
+ return o->memberData->values.data()[l->index2].asReturnedValue();
+ }
+ l->getter = getterFallback;
+ return getterFallback(l, engine, object);
+}
+
+ReturnedValue Lookup::getter0MemberDatagetter0MemberData(Lookup *l, ExecutionEngine *engine, const Value &object)
+{
+ // we can safely cast to a QV4::Object here. If object is actually a string,
+ // the internal class won't match
+ Heap::Object *o = static_cast<Heap::Object *>(object.heapObject());
+ if (o) {
+ if (l->classList[0] == o->internalClass)
+ return o->memberData->values.data()[l->index].asReturnedValue();
+ if (l->classList[2] == o->internalClass)
+ return o->memberData->values.data()[l->index2].asReturnedValue();
+ }
+ l->getter = getterFallback;
+ return getterFallback(l, engine, object);
+}
+
+ReturnedValue Lookup::getter0Inlinegetter1(Lookup *l, ExecutionEngine *engine, const Value &object)
+{
+ // we can safely cast to a QV4::Object here. If object is actually a string,
+ // the internal class won't match
+ Heap::Object *o = static_cast<Heap::Object *>(object.heapObject());
+ if (o) {
+ if (l->classList[0] == o->internalClass)
+ return o->inlinePropertyData(l->index)->asReturnedValue();
+ if (l->classList[2] == o->internalClass && l->classList[3] == o->prototype()->internalClass)
+ return o->prototype()->propertyData(l->index2)->asReturnedValue();
}
l->getter = getterFallback;
return getterFallback(l, engine, object);
}
-ReturnedValue Lookup::getter0getter1(Lookup *l, ExecutionEngine *engine, const Value &object)
+ReturnedValue Lookup::getter0MemberDatagetter1(Lookup *l, ExecutionEngine *engine, const Value &object)
{
// we can safely cast to a QV4::Object here. If object is actually a string,
// the internal class won't match
Heap::Object *o = static_cast<Heap::Object *>(object.heapObject());
if (o) {
if (l->classList[0] == o->internalClass)
- return o->propertyData(l->index)->asReturnedValue();
- if (l->classList[2] == o->internalClass && l->classList[3] == o->prototype->internalClass)
- return o->prototype->propertyData(l->index2)->asReturnedValue();
+ return o->memberData->values.data()[l->index].asReturnedValue();
+ if (l->classList[2] == o->internalClass && l->classList[3] == o->prototype()->internalClass)
+ return o->prototype()->propertyData(l->index2)->asReturnedValue();
}
l->getter = getterFallback;
return getterFallback(l, engine, object);
@@ -429,11 +509,11 @@ ReturnedValue Lookup::getter1getter1(Lookup *l, ExecutionEngine *engine, const V
Heap::Object *o = static_cast<Heap::Object *>(object.heapObject());
if (o) {
if (l->classList[0] == o->internalClass &&
- l->classList[1] == o->prototype->internalClass)
- return o->prototype->propertyData(l->index)->asReturnedValue();
+ l->classList[1] == o->prototype()->internalClass)
+ return o->prototype()->propertyData(l->index)->asReturnedValue();
if (l->classList[2] == o->internalClass &&
- l->classList[3] == o->prototype->internalClass)
- return o->prototype->propertyData(l->index2)->asReturnedValue();
+ l->classList[3] == o->prototype()->internalClass)
+ return o->prototype()->propertyData(l->index2)->asReturnedValue();
return getterFallback(l, engine, object);
}
l->getter = getterFallback;
@@ -470,9 +550,9 @@ ReturnedValue Lookup::getterAccessor1(Lookup *l, ExecutionEngine *engine, const
Heap::Object *o = static_cast<Heap::Object *>(object.heapObject());
if (o) {
if (l->classList[0] == o->internalClass &&
- l->classList[1] == o->prototype->internalClass) {
+ l->classList[1] == l->proto->internalClass) {
Scope scope(o->internalClass->engine);
- ScopedFunctionObject getter(scope, o->prototype->propertyData(l->index + Object::GetterOffset));
+ ScopedFunctionObject getter(scope, o->prototype()->propertyData(l->index + Object::GetterOffset));
if (!getter)
return Encode::undefined();
@@ -493,9 +573,9 @@ ReturnedValue Lookup::getterAccessor2(Lookup *l, ExecutionEngine *engine, const
Heap::Object *o = static_cast<Heap::Object *>(object.heapObject());
if (o) {
if (l->classList[0] == o->internalClass) {
- o = o->prototype;
- if (l->classList[1] == o->internalClass) {
- o = o->prototype;
+ Q_ASSERT(o->prototype() == l->proto);
+ if (l->classList[1] == l->proto->internalClass) {
+ o = l->proto->prototype();
if (l->classList[2] == o->internalClass) {
Scope scope(o->internalClass->engine);
ScopedFunctionObject getter(scope, o->propertyData(l->index + Object::GetterOffset));
@@ -514,12 +594,23 @@ ReturnedValue Lookup::getterAccessor2(Lookup *l, ExecutionEngine *engine, const
return getterFallback(l, engine, object);
}
-ReturnedValue Lookup::primitiveGetter0(Lookup *l, ExecutionEngine *engine, const Value &object)
+ReturnedValue Lookup::primitiveGetter0Inline(Lookup *l, ExecutionEngine *engine, const Value &object)
{
if (object.type() == l->type) {
- Object *o = l->proto;
- if (l->classList[0] == o->internalClass())
- return o->propertyData(l->index)->asReturnedValue();
+ Heap::Object *o = l->proto;
+ if (l->classList[0] == o->internalClass)
+ return o->inlinePropertyData(l->index)->asReturnedValue();
+ }
+ l->getter = getterGeneric;
+ return getterGeneric(l, engine, object);
+}
+
+ReturnedValue Lookup::primitiveGetter0MemberData(Lookup *l, ExecutionEngine *engine, const Value &object)
+{
+ if (object.type() == l->type) {
+ Heap::Object *o = l->proto;
+ if (l->classList[0] == o->internalClass)
+ return o->memberData->values.data()[l->index].asReturnedValue();
}
l->getter = getterGeneric;
return getterGeneric(l, engine, object);
@@ -528,8 +619,8 @@ ReturnedValue Lookup::primitiveGetter0(Lookup *l, ExecutionEngine *engine, const
ReturnedValue Lookup::primitiveGetter1(Lookup *l, ExecutionEngine *engine, const Value &object)
{
if (object.type() == l->type) {
- Object *o = l->proto;
- if (l->classList[0] == o->internalClass() &&
+ Heap::Object *o = l->proto;
+ if (l->classList[0] == o->internalClass &&
l->classList[1] == o->prototype()->internalClass)
return o->prototype()->propertyData(l->index)->asReturnedValue();
}
@@ -540,9 +631,9 @@ ReturnedValue Lookup::primitiveGetter1(Lookup *l, ExecutionEngine *engine, const
ReturnedValue Lookup::primitiveGetterAccessor0(Lookup *l, ExecutionEngine *engine, const Value &object)
{
if (object.type() == l->type) {
- Object *o = l->proto;
- if (l->classList[0] == o->internalClass()) {
- Scope scope(o->engine());
+ Heap::Object *o = l->proto;
+ if (l->classList[0] == o->internalClass) {
+ Scope scope(o->internalClass->engine);
ScopedFunctionObject getter(scope, o->propertyData(l->index + Object::GetterOffset));
if (!getter)
return Encode::undefined();
@@ -560,10 +651,10 @@ ReturnedValue Lookup::primitiveGetterAccessor0(Lookup *l, ExecutionEngine *engin
ReturnedValue Lookup::primitiveGetterAccessor1(Lookup *l, ExecutionEngine *engine, const Value &object)
{
if (object.type() == l->type) {
- Object *o = l->proto;
- if (l->classList[0] == o->internalClass() &&
+ Heap::Object *o = l->proto;
+ if (l->classList[0] == o->internalClass &&
l->classList[1] == o->prototype()->internalClass) {
- Scope scope(o->engine());
+ Scope scope(o->internalClass->engine);
ScopedFunctionObject getter(scope, o->prototype()->propertyData(l->index + Object::GetterOffset));
if (!getter)
return Encode::undefined();
@@ -604,9 +695,15 @@ ReturnedValue Lookup::globalGetterGeneric(Lookup *l, ExecutionEngine *engine)
ReturnedValue v = l->lookup(o, &attrs);
if (v != Primitive::emptyValue().asReturnedValue()) {
if (attrs.isData()) {
- if (l->level == 0)
- l->globalGetter = globalGetter0;
- else if (l->level == 1)
+ if (l->level == 0) {
+ uint nInline = o->d()->vtable()->nInlineProperties;
+ if (l->index < nInline)
+ l->globalGetter = globalGetter0Inline;
+ else {
+ l->index -= nInline;
+ l->globalGetter = globalGetter0MemberData;
+ }
+ } else if (l->level == 1)
l->globalGetter = globalGetter1;
else if (l->level == 2)
l->globalGetter = globalGetter2;
@@ -626,11 +723,21 @@ ReturnedValue Lookup::globalGetterGeneric(Lookup *l, ExecutionEngine *engine)
return engine->throwReferenceError(n);
}
-ReturnedValue Lookup::globalGetter0(Lookup *l, ExecutionEngine *engine)
+ReturnedValue Lookup::globalGetter0Inline(Lookup *l, ExecutionEngine *engine)
{
Object *o = engine->globalObject;
if (l->classList[0] == o->internalClass())
- return o->propertyData(l->index)->asReturnedValue();
+ return o->d()->inlinePropertyData(l->index)->asReturnedValue();
+
+ l->globalGetter = globalGetterGeneric;
+ return globalGetterGeneric(l, engine);
+}
+
+ReturnedValue Lookup::globalGetter0MemberData(Lookup *l, ExecutionEngine *engine)
+{
+ Object *o = engine->globalObject;
+ if (l->classList[0] == o->internalClass())
+ return o->d()->memberData->values.data()[l->index].asReturnedValue();
l->globalGetter = globalGetterGeneric;
return globalGetterGeneric(l, engine);
@@ -651,11 +758,11 @@ ReturnedValue Lookup::globalGetter2(Lookup *l, ExecutionEngine *engine)
{
Heap::Object *o = engine->globalObject->d();
if (l->classList[0] == o->internalClass) {
- o = o->prototype;
+ o = o->prototype();
if (l->classList[1] == o->internalClass) {
- o = o->prototype;
+ o = o->prototype();
if (l->classList[2] == o->internalClass) {
- return o->prototype->propertyData(l->index)->asReturnedValue();
+ return o->prototype()->propertyData(l->index)->asReturnedValue();
}
}
}
@@ -704,9 +811,9 @@ ReturnedValue Lookup::globalGetterAccessor2(Lookup *l, ExecutionEngine *engine)
{
Heap::Object *o = engine->globalObject->d();
if (l->classList[0] == o->internalClass) {
- o = o->prototype;
+ o = o->prototype();
if (l->classList[1] == o->internalClass) {
- o = o->prototype;
+ o = o->prototype();
if (l->classList[2] == o->internalClass) {
Scope scope(o->internalClass->engine);
ScopedFunctionObject getter(scope, o->propertyData(l->index + Object::GetterOffset));
@@ -746,7 +853,7 @@ void Lookup::setterTwoClasses(Lookup *l, ExecutionEngine *engine, Value &object,
if (Object *o = object.as<Object>()) {
o->setLookup(l, value);
- if (l->setter == Lookup::setter0) {
+ if (l->setter == Lookup::setter0 || l->setter == Lookup::setter0Inline) {
l->setter = setter0setter0;
l->classList[1] = l1.classList[0];
l->index2 = l1.index;
@@ -770,7 +877,7 @@ void Lookup::setterFallback(Lookup *l, ExecutionEngine *engine, Value &object, c
void Lookup::setter0(Lookup *l, ExecutionEngine *engine, Value &object, const Value &value)
{
- Object *o = object.as<Object>();
+ Object *o = static_cast<Object *>(object.managed());
if (o && o->internalClass() == l->classList[0]) {
o->setProperty(engine, l->index, value);
return;
@@ -779,15 +886,25 @@ void Lookup::setter0(Lookup *l, ExecutionEngine *engine, Value &object, const Va
setterTwoClasses(l, engine, object, value);
}
+void Lookup::setter0Inline(Lookup *l, ExecutionEngine *engine, Value &object, const Value &value)
+{
+ Object *o = static_cast<Object *>(object.managed());
+ if (o && o->internalClass() == l->classList[0]) {
+ o->d()->setInlineProperty(engine, l->index, value);
+ return;
+ }
+
+ setterTwoClasses(l, engine, object, value);
+}
+
void Lookup::setterInsert0(Lookup *l, ExecutionEngine *engine, Value &object, const Value &value)
{
- Object *o = object.as<Object>();
+ Object *o = static_cast<Object *>(object.managed());
if (o && o->internalClass() == l->classList[0]) {
- if (!o->prototype()) {
- o->setInternalClass(l->classList[3]);
- o->setProperty(l->index, value);
- return;
- }
+ Q_ASSERT(!o->prototype());
+ o->setInternalClass(l->classList[3]);
+ o->setProperty(l->index, value);
+ return;
}
l->setter = setterFallback;
@@ -796,10 +913,12 @@ void Lookup::setterInsert0(Lookup *l, ExecutionEngine *engine, Value &object, co
void Lookup::setterInsert1(Lookup *l, ExecutionEngine *engine, Value &object, const Value &value)
{
- Object *o = object.as<Object>();
+ Object *o = static_cast<Object *>(object.managed());
if (o && o->internalClass() == l->classList[0]) {
Heap::Object *p = o->prototype();
- if (p && p->internalClass == l->classList[1]) {
+ Q_ASSERT(p);
+ if (p->internalClass == l->classList[1]) {
+ Q_ASSERT(!p->prototype());
o->setInternalClass(l->classList[3]);
o->setProperty(l->index, value);
return;
@@ -812,12 +931,15 @@ void Lookup::setterInsert1(Lookup *l, ExecutionEngine *engine, Value &object, co
void Lookup::setterInsert2(Lookup *l, ExecutionEngine *engine, Value &object, const Value &value)
{
- Object *o = object.as<Object>();
+ Object *o = static_cast<Object *>(object.managed());
if (o && o->internalClass() == l->classList[0]) {
Heap::Object *p = o->prototype();
- if (p && p->internalClass == l->classList[1]) {
- p = p->prototype;
- if (p && p->internalClass == l->classList[2]) {
+ Q_ASSERT(p);
+ if (p->internalClass == l->classList[1]) {
+ p = p->prototype();
+ Q_ASSERT(p);
+ if (p->internalClass == l->classList[2]) {
+ Q_ASSERT(!p->prototype());
o->setInternalClass(l->classList[3]);
o->setProperty(l->index, value);
return;
@@ -831,7 +953,7 @@ void Lookup::setterInsert2(Lookup *l, ExecutionEngine *engine, Value &object, co
void Lookup::setter0setter0(Lookup *l, ExecutionEngine *engine, Value &object, const Value &value)
{
- Object *o = object.as<Object>();
+ Object *o = static_cast<Object *>(object.managed());
if (o) {
if (o->internalClass() == l->classList[0]) {
o->setProperty(l->index, value);
diff --git a/src/qml/jsruntime/qv4lookup_p.h b/src/qml/jsruntime/qv4lookup_p.h
index daf3c71e27..ce5189a780 100644
--- a/src/qml/jsruntime/qv4lookup_p.h
+++ b/src/qml/jsruntime/qv4lookup_p.h
@@ -78,13 +78,14 @@ struct Lookup {
struct {
void *dummy0;
void *dummy1;
- Object *proto;
- unsigned type;
+ void *dummy2;
+ Heap::Object *proto;
};
};
union {
int level;
uint index2;
+ unsigned type;
};
uint index;
uint nameIndex;
@@ -101,17 +102,22 @@ struct Lookup {
static ReturnedValue getterTwoClasses(Lookup *l, ExecutionEngine *engine, const Value &object);
static ReturnedValue getterFallback(Lookup *l, ExecutionEngine *engine, const Value &object);
- static ReturnedValue getter0(Lookup *l, ExecutionEngine *engine, const Value &object);
+ static ReturnedValue getter0MemberData(Lookup *l, ExecutionEngine *engine, const Value &object);
+ static ReturnedValue getter0Inline(Lookup *l, ExecutionEngine *engine, const Value &object);
static ReturnedValue getter1(Lookup *l, ExecutionEngine *engine, const Value &object);
static ReturnedValue getter2(Lookup *l, ExecutionEngine *engine, const Value &object);
- static ReturnedValue getter0getter0(Lookup *l, ExecutionEngine *engine, const Value &object);
- static ReturnedValue getter0getter1(Lookup *l, ExecutionEngine *engine, const Value &object);
+ static ReturnedValue getter0Inlinegetter0Inline(Lookup *l, ExecutionEngine *engine, const Value &object);
+ static ReturnedValue getter0Inlinegetter0MemberData(Lookup *l, ExecutionEngine *engine, const Value &object);
+ static ReturnedValue getter0MemberDatagetter0MemberData(Lookup *l, ExecutionEngine *engine, const Value &object);
+ static ReturnedValue getter0Inlinegetter1(Lookup *l, ExecutionEngine *engine, const Value &object);
+ static ReturnedValue getter0MemberDatagetter1(Lookup *l, ExecutionEngine *engine, const Value &object);
static ReturnedValue getter1getter1(Lookup *l, ExecutionEngine *engine, const Value &object);
static ReturnedValue getterAccessor0(Lookup *l, ExecutionEngine *engine, const Value &object);
static ReturnedValue getterAccessor1(Lookup *l, ExecutionEngine *engine, const Value &object);
static ReturnedValue getterAccessor2(Lookup *l, ExecutionEngine *engine, const Value &object);
- static ReturnedValue primitiveGetter0(Lookup *l, ExecutionEngine *engine, const Value &object);
+ static ReturnedValue primitiveGetter0Inline(Lookup *l, ExecutionEngine *engine, const Value &object);
+ static ReturnedValue primitiveGetter0MemberData(Lookup *l, ExecutionEngine *engine, const Value &object);
static ReturnedValue primitiveGetter1(Lookup *l, ExecutionEngine *engine, const Value &object);
static ReturnedValue primitiveGetterAccessor0(Lookup *l, ExecutionEngine *engine, const Value &object);
static ReturnedValue primitiveGetterAccessor1(Lookup *l, ExecutionEngine *engine, const Value &object);
@@ -119,7 +125,8 @@ struct Lookup {
static ReturnedValue arrayLengthGetter(Lookup *l, ExecutionEngine *engine, const Value &object);
static ReturnedValue globalGetterGeneric(Lookup *l, ExecutionEngine *engine);
- static ReturnedValue globalGetter0(Lookup *l, ExecutionEngine *engine);
+ static ReturnedValue globalGetter0Inline(Lookup *l, ExecutionEngine *engine);
+ static ReturnedValue globalGetter0MemberData(Lookup *l, ExecutionEngine *engine);
static ReturnedValue globalGetter1(Lookup *l, ExecutionEngine *engine);
static ReturnedValue globalGetter2(Lookup *l, ExecutionEngine *engine);
static ReturnedValue globalGetterAccessor0(Lookup *l, ExecutionEngine *engine);
@@ -130,6 +137,7 @@ struct Lookup {
static void setterTwoClasses(Lookup *l, ExecutionEngine *engine, Value &object, const Value &value);
static void setterFallback(Lookup *l, ExecutionEngine *engine, Value &object, const Value &value);
static void setter0(Lookup *l, ExecutionEngine *engine, Value &object, const Value &value);
+ static void setter0Inline(Lookup *l, ExecutionEngine *engine, Value &object, const Value &value);
static void setterInsert0(Lookup *l, ExecutionEngine *engine, Value &object, const Value &value);
static void setterInsert1(Lookup *l, ExecutionEngine *engine, Value &object, const Value &value);
static void setterInsert2(Lookup *l, ExecutionEngine *engine, Value &object, const Value &value);
diff --git a/src/qml/jsruntime/qv4managed.cpp b/src/qml/jsruntime/qv4managed.cpp
index 1b43fd86e8..e00eaa0d9b 100644
--- a/src/qml/jsruntime/qv4managed.cpp
+++ b/src/qml/jsruntime/qv4managed.cpp
@@ -48,6 +48,8 @@ const VTable Managed::static_vtbl =
{
0,
0,
+ 0,
+ 0,
Managed::IsExecutionContext,
Managed::IsString,
Managed::IsObject,
diff --git a/src/qml/jsruntime/qv4managed_p.h b/src/qml/jsruntime/qv4managed_p.h
index f97771831c..40dfc244ea 100644
--- a/src/qml/jsruntime/qv4managed_p.h
+++ b/src/qml/jsruntime/qv4managed_p.h
@@ -52,6 +52,7 @@
#include "qv4global_p.h"
#include "qv4value_p.h"
+#include "qv4enginebase_p.h"
#include <private/qv4heap_p.h>
#include <private/qv4writebarrier_p.h>
@@ -132,6 +133,9 @@ inline void qYouForgotTheQ_MANAGED_Macro(T1, T2) {}
{ \
parentVTable, \
markTable, \
+ (sizeof(classname::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), \
+ (sizeof(classname::Data) + (std::is_same<classname, Object>::value ? 2*sizeof(QV4::Value) : 0) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) \
+ - (sizeof(classname::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), \
classname::IsExecutionContext, \
classname::IsString, \
classname::IsObject, \
@@ -151,6 +155,10 @@ QT_WARNING_SUPPRESS_GCC_TAUTOLOGICAL_COMPARE_ON \
const QV4::VTable classname::static_vtbl = DEFINE_MANAGED_VTABLE_INT(classname, 0) \
QT_WARNING_SUPPRESS_GCC_TAUTOLOGICAL_COMPARE_OFF
+#define V4_INTERNALCLASS(c) \
+ static QV4::InternalClass *defaultInternalClass(QV4::EngineBase *e) \
+ { return e->internalClasses[QV4::EngineBase::Class_##c]; }
+
struct Q_QML_PRIVATE_EXPORT Managed : Value
{
V4_MANAGED_ITSELF(Base, Managed)
@@ -193,6 +201,9 @@ public:
};
Q_MANAGED_TYPE(Invalid)
+ InternalClass *internalClass() const { return d()->internalClass; }
+ inline ExecutionEngine *engine() const { return internalClass()->engine; }
+
bool isListType() const { return d()->vtable()->type == Type_QmlSequence; }
bool isArrayObject() const { return d()->vtable()->type == Type_ArrayObject; }
diff --git a/src/qml/jsruntime/qv4memberdata_p.h b/src/qml/jsruntime/qv4memberdata_p.h
index fbe66757e0..9d333011fc 100644
--- a/src/qml/jsruntime/qv4memberdata_p.h
+++ b/src/qml/jsruntime/qv4memberdata_p.h
@@ -72,17 +72,18 @@ V4_ASSERT_IS_TRIVIAL(MemberData)
struct MemberData : Managed
{
V4_MANAGED(MemberData, Managed)
+ V4_INTERNALCLASS(MemberData)
struct Index {
- Heap::MemberData *memberData;
- uint index;
+ Heap::Base *base;
+ Value *slot;
- void set(ExecutionEngine *e, Value newVal) {
- memberData->values.set(e, index, newVal);
+ void set(EngineBase *e, Value newVal) {
+ WriteBarrier::write(e, base, slot, newVal);
}
- const Value *operator->() const { return &memberData->values[index]; }
- const Value &operator*() const { return memberData->values[index]; }
- bool isNull() const { return !memberData; }
+ const Value *operator->() const { return slot; }
+ const Value &operator*() const { return *slot; }
+ bool isNull() const { return !slot; }
};
const Value &operator[] (uint idx) const { return d()->values[idx]; }
diff --git a/src/qml/jsruntime/qv4numberobject_p.h b/src/qml/jsruntime/qv4numberobject_p.h
index e18267c50c..0bc2cd8c65 100644
--- a/src/qml/jsruntime/qv4numberobject_p.h
+++ b/src/qml/jsruntime/qv4numberobject_p.h
@@ -85,6 +85,7 @@ struct NumberCtor: FunctionObject
struct NumberPrototype: NumberObject
{
+ V4_PROTOTYPE(objectPrototype)
void init(ExecutionEngine *engine, Object *ctor);
static void method_isFinite(const BuiltinFunction *, Scope &scope, CallData *callData);
diff --git a/src/qml/jsruntime/qv4object.cpp b/src/qml/jsruntime/qv4object.cpp
index d400c2ae64..94d5a74fe5 100644
--- a/src/qml/jsruntime/qv4object.cpp
+++ b/src/qml/jsruntime/qv4object.cpp
@@ -61,9 +61,14 @@ DEFINE_OBJECT_VTABLE(Object);
void Object::setInternalClass(InternalClass *ic)
{
d()->internalClass = ic;
+ Q_ASSERT(ic && ic->vtable);
+ uint nInline = d()->vtable()->nInlineProperties;
+ if (ic->size <= nInline)
+ return;
bool hasMD = d()->memberData != nullptr;
- if ((!hasMD && ic->size) || (hasMD && d()->memberData->values.size < ic->size))
- d()->memberData.set(engine(), MemberData::allocate(ic->engine, ic->size, d()->memberData));
+ uint requiredSize = ic->size - nInline;
+ if (!(hasMD && requiredSize) || (hasMD && d()->memberData->values.size < requiredSize))
+ d()->memberData.set(ic->engine, MemberData::allocate(ic->engine, requiredSize, d()->memberData));
}
void Object::getProperty(uint index, Property *p, PropertyAttributes *attrs) const
@@ -83,13 +88,14 @@ void Object::setProperty(uint index, const Property *p)
bool Object::setPrototype(Object *proto)
{
- Heap::Object *pp = proto ? proto->d() : 0;
+ Heap::Object *p = proto ? proto->d() : 0;
+ Heap::Object *pp = p;
while (pp) {
if (pp == d())
return false;
- pp = pp->prototype;
+ pp = pp->prototype();
}
- d()->prototype.set(engine(), proto ? proto->d() : 0);
+ setInternalClass(internalClass()->changePrototype(p));
return true;
}
@@ -150,17 +156,6 @@ void Object::defineDefaultProperty(const QString &name, const Value &value)
defineDefaultProperty(s, value);
}
-void Object::defineDefaultProperty(const QString &name, ReturnedValue (*code)(CallContext *), int argumentCount)
-{
- ExecutionEngine *e = engine();
- Scope scope(e);
- ScopedString s(scope, e->newIdentifier(name));
- ExecutionContext *global = e->rootContext();
- ScopedFunctionObject function(scope, BuiltinFunction::create(global, s, code));
- function->defineReadonlyConfigurableProperty(e->id_length(), Primitive::fromInt32(argumentCount));
- defineDefaultProperty(s, function);
-}
-
void Object::defineDefaultProperty(const QString &name, void (*code)(const BuiltinFunction *, Scope &, CallData *), int argumentCount)
{
ExecutionEngine *e = engine();
@@ -172,16 +167,6 @@ void Object::defineDefaultProperty(const QString &name, void (*code)(const Built
defineDefaultProperty(s, function);
}
-void Object::defineDefaultProperty(String *name, ReturnedValue (*code)(CallContext *), int argumentCount)
-{
- ExecutionEngine *e = engine();
- Scope scope(e);
- ExecutionContext *global = e->rootContext();
- ScopedFunctionObject function(scope, BuiltinFunction::create(global, name, code));
- function->defineReadonlyConfigurableProperty(e->id_length(), Primitive::fromInt32(argumentCount));
- defineDefaultProperty(name, function);
-}
-
void Object::defineDefaultProperty(String *name, void (*code)(const BuiltinFunction *, Scope &, CallData *), int argumentCount)
{
ExecutionEngine *e = engine();
@@ -192,25 +177,6 @@ void Object::defineDefaultProperty(String *name, void (*code)(const BuiltinFunct
defineDefaultProperty(name, function);
}
-void Object::defineAccessorProperty(const QString &name, ReturnedValue (*getter)(CallContext *), ReturnedValue (*setter)(CallContext *))
-{
- ExecutionEngine *e = engine();
- Scope scope(e);
- ScopedString s(scope, e->newIdentifier(name));
- defineAccessorProperty(s, getter, setter);
-}
-
-void Object::defineAccessorProperty(String *name, ReturnedValue (*getter)(CallContext *), ReturnedValue (*setter)(CallContext *))
-{
- ExecutionEngine *v4 = engine();
- QV4::Scope scope(v4);
- ScopedProperty p(scope);
- ExecutionContext *global = v4->rootContext();
- p->setGetter(ScopedFunctionObject(scope, (getter ? BuiltinFunction::create(global, name, getter) : 0)));
- p->setSetter(ScopedFunctionObject(scope, (setter ? BuiltinFunction::create(global, name, setter) : 0)));
- insertMember(name, p, QV4::Attr_Accessor|QV4::Attr_NotConfigurable|QV4::Attr_NotEnumerable);
-}
-
void Object::defineAccessorProperty(const QString &name, void (*getter)(const BuiltinFunction *, Scope &, CallData *),
void (*setter)(const BuiltinFunction *, Scope &, CallData *))
{
@@ -258,6 +224,18 @@ void Object::defineReadonlyConfigurableProperty(String *name, const Value &value
insertMember(name, value, Attr_ReadOnly_ButConfigurable);
}
+void Object::markObjects(Heap::Base *b, MarkStack *stack)
+{
+ Heap::Object *o = static_cast<Heap::Object *>(b);
+ uint nInline = o->vtable()->nInlineProperties;
+ Value *v = reinterpret_cast<Value *>(o) + o->vtable()->inlinePropertyOffset;
+ const Value *end = v + nInline;
+ while (v < end) {
+ v->mark(stack);
+ ++v;
+ }
+}
+
void Object::insertMember(String *s, const Property *p, PropertyAttributes attributes)
{
uint idx;
@@ -278,7 +256,10 @@ void Object::getOwnProperty(String *name, PropertyAttributes *attrs, Property *p
if (idx != UINT_MAX)
return getOwnProperty(idx, attrs, p);
- uint member = internalClass()->find(name);
+ name->makeIdentifier();
+ Identifier *id = name->identifier();
+
+ uint member = internalClass()->find(id);
if (member < UINT_MAX) {
*attrs = internalClass()->propertyData[member];
if (p) {
@@ -317,15 +298,18 @@ MemberData::Index Object::getValueOrSetter(String *name, PropertyAttributes *att
{
Q_ASSERT(name->asArrayIndex() == UINT_MAX);
+ name->makeIdentifier();
+ Identifier *id = name->identifier();
+
Heap::Object *o = d();
while (o) {
- uint idx = o->internalClass->find(name);
+ uint idx = o->internalClass->find(id);
if (idx < UINT_MAX) {
*attrs = o->internalClass->propertyData[idx];
- return MemberData::Index{ o->memberData, attrs->isAccessor() ? idx + SetterOffset : idx };
+ return o->writablePropertyData(attrs->isAccessor() ? idx + SetterOffset : idx );
}
- o = o->prototype;
+ o = o->prototype();
}
*attrs = Attr_Invalid;
return { 0, 0 };
@@ -350,7 +334,7 @@ ArrayData::Index Object::getValueOrSetter(uint index, PropertyAttributes *attrs)
return { reinterpret_cast<Heap::ArrayData *>(0x1), 0 };
}
}
- o = o->prototype;
+ o = o->prototype();
}
*attrs = Attr_Invalid;
return { 0, 0 };
@@ -394,7 +378,10 @@ bool Object::hasOwnProperty(String *name) const
if (idx != UINT_MAX)
return hasOwnProperty(idx);
- if (internalClass()->find(name) < UINT_MAX)
+ name->makeIdentifier();
+ Identifier *id = name->identifier();
+
+ if (internalClass()->find(id) < UINT_MAX)
return true;
if (!query(name).isEmpty())
return true;
@@ -451,8 +438,11 @@ PropertyAttributes Object::query(const Managed *m, String *name)
if (idx != UINT_MAX)
return queryIndexed(m, idx);
+ name->makeIdentifier();
+ Identifier *id = name->identifier();
+
const Object *o = static_cast<const Object *>(m);
- idx = o->internalClass()->find(name);
+ idx = o->internalClass()->find(id);
if (idx < UINT_MAX)
return o->internalClass()->propertyData[idx];
@@ -488,9 +478,18 @@ ReturnedValue Object::getLookup(const Managed *m, Lookup *l)
PropertyAttributes attrs;
ReturnedValue v = l->lookup(o, &attrs);
if (v != Primitive::emptyValue().asReturnedValue()) {
+ l->proto = l->classList[0]->prototype;
if (attrs.isData()) {
- if (l->level == 0)
- l->getter = Lookup::getter0;
+ Q_ASSERT(l->classList[0] == o->internalClass());
+ if (l->level == 0) {
+ uint nInline = o->d()->vtable()->nInlineProperties;
+ if (l->index < nInline)
+ l->getter = Lookup::getter0Inline;
+ else {
+ l->index -= nInline;
+ l->getter = Lookup::getter0MemberData;
+ }
+ }
else if (l->level == 1)
l->getter = Lookup::getter1;
else if (l->level == 2)
@@ -525,7 +524,7 @@ void Object::setLookup(Managed *m, Lookup *l, const Value &value)
if (idx != UINT_MAX && o->internalClass()->propertyData[idx].isData() && o->internalClass()->propertyData[idx].isWritable()) {
l->classList[0] = o->internalClass();
l->index = idx;
- l->setter = Lookup::setter0;
+ l->setter = idx < o->d()->vtable()->nInlineProperties ? Lookup::setter0Inline : Lookup::setter0;
o->setProperty(idx, value);
return;
}
@@ -642,12 +641,13 @@ ReturnedValue Object::internalGet(String *name, bool *hasProperty) const
if (idx != UINT_MAX)
return getIndexed(idx, hasProperty);
- Scope scope(engine());
- name->makeIdentifier(scope.engine);
+ name->makeIdentifier();
+ Identifier *id = name->identifier();
+ Scope scope(engine());
ScopedObject o(scope, this);
while (o) {
- uint idx = o->internalClass()->find(name);
+ uint idx = o->internalClass()->find(id);
if (idx < UINT_MAX) {
if (hasProperty)
*hasProperty = true;
@@ -709,14 +709,15 @@ bool Object::internalPut(String *name, const Value &value)
if (idx != UINT_MAX)
return putIndexed(idx, value);
- name->makeIdentifier(engine);
+ name->makeIdentifier();
+ Identifier *id = name->identifier();
MemberData::Index memberIndex{0, 0};
- uint member = internalClass()->find(name);
+ uint member = internalClass()->find(id);
PropertyAttributes attrs;
if (member < UINT_MAX) {
attrs = internalClass()->propertyData[member];
- memberIndex = { d()->memberData, (attrs.isAccessor() ? member + SetterOffset : member) };
+ memberIndex = d()->writablePropertyData(attrs.isAccessor() ? member + SetterOffset : member);
}
// clause 1
@@ -869,9 +870,9 @@ bool Object::internalDeleteProperty(String *name)
if (idx != UINT_MAX)
return deleteIndexedProperty(idx);
- name->makeIdentifier(engine());
+ name->makeIdentifier();
- uint memberIdx = internalClass()->find(name);
+ uint memberIdx = internalClass()->find(name->identifier());
if (memberIdx != UINT_MAX) {
if (internalClass()->propertyData[memberIdx].isConfigurable()) {
InternalClass::removeMember(this, name->identifier());
@@ -908,7 +909,7 @@ bool Object::__defineOwnProperty__(ExecutionEngine *engine, String *name, const
return __defineOwnProperty__(engine, idx, p, attrs);
Scope scope(engine);
- name->makeIdentifier(scope.engine);
+ name->makeIdentifier();
uint memberIndex;
@@ -942,7 +943,7 @@ bool Object::__defineOwnProperty__(ExecutionEngine *engine, String *name, const
}
// Clause 1
- memberIndex = internalClass()->find(name);
+ memberIndex = internalClass()->find(name->identifier());
if (memberIndex == UINT_MAX) {
// clause 3
@@ -1188,7 +1189,7 @@ ReturnedValue Object::instanceOf(const Object *typeObject, const Value &var)
// 15.3.5.3, 4
while (v) {
// 15.3.5.3, 4, a
- v = v->prototype;
+ v = v->prototype();
// 15.3.5.3, 4, b
if (!v)
diff --git a/src/qml/jsruntime/qv4object_p.h b/src/qml/jsruntime/qv4object_p.h
index df9d68525d..066a93cc61 100644
--- a/src/qml/jsruntime/qv4object_p.h
+++ b/src/qml/jsruntime/qv4object_p.h
@@ -68,8 +68,6 @@ struct BuiltinFunction;
namespace Heap {
#define ObjectMembers(class, Member) \
- Member(class, NoMark, InternalClass *, internalClass) \
- Member(class, Pointer, Object *, prototype) \
Member(class, Pointer, MemberData *, memberData) \
Member(class, Pointer, ArrayData *, arrayData)
@@ -78,12 +76,59 @@ DECLARE_HEAP_OBJECT(Object, Base) {
void init() { Base::init(); }
void destroy() { Base::destroy(); }
- const Value *propertyData(uint index) const { return memberData->values.data() + index; }
- void setProperty(ExecutionEngine *e, uint index, Value v) const { memberData->values.set(e, index, v); }
- void setProperty(ExecutionEngine *e, uint index, Heap::Base *b) const { memberData->values.set(e, index, b); }
+ const Value *inlinePropertyData(uint index) const {
+ Q_ASSERT(index < vtable()->nInlineProperties);
+ return reinterpret_cast<const Value *>(this) + vtable()->inlinePropertyOffset + index;
+ }
+ void setInlineProperty(ExecutionEngine *e, uint index, Value v) {
+ Q_ASSERT(index < vtable()->nInlineProperties);
+ Value *prop = reinterpret_cast<Value *>(this) + vtable()->inlinePropertyOffset + index;
+ WriteBarrier::write(e, this, prop, v);
+ }
+ void setInlineProperty(ExecutionEngine *e, uint index, Heap::Base *b) {
+ Q_ASSERT(index < vtable()->nInlineProperties);
+ Value *prop = reinterpret_cast<Value *>(this) + vtable()->inlinePropertyOffset + index;
+ WriteBarrier::write(e, this, prop, b);
+ }
+
+ QV4::MemberData::Index writablePropertyData(uint index) {
+ uint nInline = vtable()->nInlineProperties;
+ if (index < nInline)
+ return { this, reinterpret_cast<Value *>(this) + vtable()->inlinePropertyOffset + index};
+ index -= nInline;
+ return { memberData, memberData->values.values + index };
+ }
+
+ const Value *propertyData(uint index) const {
+ uint nInline = vtable()->nInlineProperties;
+ if (index < nInline)
+ return reinterpret_cast<const Value *>(this) + vtable()->inlinePropertyOffset + index;
+ index -= nInline;
+ return memberData->values.data() + index;
+ }
+ void setProperty(ExecutionEngine *e, uint index, Value v) {
+ uint nInline = vtable()->nInlineProperties;
+ if (index < nInline) {
+ setInlineProperty(e, index, v);
+ return;
+ }
+ index -= nInline;
+ memberData->values.set(e, index, v);
+ }
+ void setProperty(ExecutionEngine *e, uint index, Heap::Base *b) {
+ uint nInline = vtable()->nInlineProperties;
+ if (index < nInline) {
+ setInlineProperty(e, index, b);
+ return;
+ }
+ index -= nInline;
+ memberData->values.set(e, index, b);
+ }
+
+ Heap::Object *prototype() const { return internalClass->prototype; }
};
-Q_STATIC_ASSERT(Object::markTable == ((2 << 4) | (2 << 6) | (2 << 8)));
+Q_STATIC_ASSERT(Object::markTable == ((2 << 2) | (2 << 4)));
}
@@ -122,9 +167,6 @@ Q_STATIC_ASSERT(Object::markTable == ((2 << 4) | (2 << 6) | (2 << 8)));
V4_ASSERT_IS_TRIVIAL(QV4::Heap::DataClass); \
static Q_CONSTEXPR quint64 markTable = QV4::Heap::DataClass::markTable;
-#define V4_INTERNALCLASS(c) \
- static QV4::InternalClass *defaultInternalClass(QV4::ExecutionEngine *e) \
- { return e->c; }
#define V4_PROTOTYPE(p) \
static QV4::Object *defaultPrototype(QV4::ExecutionEngine *e) \
{ return e->p(); }
@@ -183,7 +225,7 @@ QT_WARNING_SUPPRESS_GCC_TAUTOLOGICAL_COMPARE_OFF
struct Q_QML_EXPORT Object: Managed {
V4_OBJECT2(Object, Object)
Q_MANAGED_TYPE(Object)
- V4_INTERNALCLASS(emptyClass)
+ V4_INTERNALCLASS(Object)
V4_PROTOTYPE(objectPrototype)
enum {
@@ -192,7 +234,6 @@ struct Q_QML_EXPORT Object: Managed {
SetterOffset = 1
};
- InternalClass *internalClass() const { return d()->internalClass; }
void setInternalClass(InternalClass *ic);
const Value *propertyData(uint index) const { return d()->propertyData(index); }
@@ -208,7 +249,7 @@ struct Q_QML_EXPORT Object: Managed {
void setProperty(ExecutionEngine *engine, uint index, Heap::Base *b) const { d()->setProperty(engine, index, b); }
const ObjectVTable *vtable() const { return reinterpret_cast<const ObjectVTable *>(d()->vtable()); }
- Heap::Object *prototype() const { return d()->prototype; }
+ Heap::Object *prototype() const { return d()->prototype(); }
bool setPrototype(Object *proto);
void getOwnProperty(String *name, PropertyAttributes *attrs, Property *p = 0);
@@ -246,12 +287,8 @@ struct Q_QML_EXPORT Object: Managed {
insertMember(name, value, Attr_Data|Attr_NotEnumerable);
}
void defineDefaultProperty(const QString &name, const Value &value);
- void defineDefaultProperty(const QString &name, ReturnedValue (*code)(CallContext *), int argumentCount = 0);
void defineDefaultProperty(const QString &name, void (*code)(const BuiltinFunction *, Scope &, CallData *), int argumentCount = 0);
- void defineDefaultProperty(String *name, ReturnedValue (*code)(CallContext *), int argumentCount = 0);
void defineDefaultProperty(String *name, void (*code)(const BuiltinFunction *, Scope &, CallData *), int argumentCount = 0);
- void defineAccessorProperty(const QString &name, ReturnedValue (*getter)(CallContext *), ReturnedValue (*setter)(CallContext *));
- void defineAccessorProperty(String *name, ReturnedValue (*getter)(CallContext *), ReturnedValue (*setter)(CallContext *));
void defineAccessorProperty(const QString &name, void (*getter)(const BuiltinFunction *, Scope &, CallData *),
void (*setter)(const BuiltinFunction *, Scope &, CallData *));
void defineAccessorProperty(String *name, void (*getter)(const BuiltinFunction *, Scope &, CallData *),
@@ -272,8 +309,6 @@ struct Q_QML_EXPORT Object: Managed {
}
void insertMember(String *s, const Property *p, PropertyAttributes attributes);
- inline ExecutionEngine *engine() const { return internalClass()->engine; }
-
bool isExtensible() const { return d()->internalClass->extensible; }
// Array handling
@@ -424,6 +459,7 @@ protected:
static void advanceIterator(Managed *m, ObjectIterator *it, Value *name, uint *index, Property *p, PropertyAttributes *attributes);
static uint getLength(const Managed *m);
static ReturnedValue instanceOf(const Object *typeObject, const Value &var);
+ static void markObjects(Heap::Base *, MarkStack *);
private:
ReturnedValue internalGet(String *name, bool *hasProperty) const;
@@ -498,7 +534,7 @@ struct NumberObject: Object {
struct ArrayObject: Object {
V4_OBJECT2(ArrayObject, Object)
Q_MANAGED_TYPE(ArrayObject)
- V4_INTERNALCLASS(arrayClass)
+ V4_INTERNALCLASS(ArrayObject)
V4_PROTOTYPE(arrayPrototype)
void init(ExecutionEngine *engine);
diff --git a/src/qml/jsruntime/qv4qmlcontext.cpp b/src/qml/jsruntime/qv4qmlcontext.cpp
index c08dd7baa3..61d785066f 100644
--- a/src/qml/jsruntime/qv4qmlcontext.cpp
+++ b/src/qml/jsruntime/qv4qmlcontext.cpp
@@ -297,15 +297,15 @@ bool QQmlContextWrapper::put(Managed *m, String *name, const Value &value)
void Heap::QmlContext::init(QV4::ExecutionContext *outerContext, QV4::QQmlContextWrapper *qml)
{
- Heap::ExecutionContext::init(outerContext->engine(), Heap::ExecutionContext::Type_QmlContext);
- outer.set(engine, outerContext->d());
+ Heap::ExecutionContext::init(Heap::ExecutionContext::Type_QmlContext);
+ outer.set(internalClass->engine, outerContext->d());
strictMode = false;
callData = outer->callData;
lookups = outer->lookups;
constantTable = outer->constantTable;
compilationUnit = outer->compilationUnit;
- this->qml.set(engine, qml->d());
+ this->qml.set(internalClass->engine, qml->d());
}
Heap::QmlContext *QmlContext::createWorkerContext(ExecutionContext *parent, const QUrl &source, Value *sendFunction)
@@ -327,7 +327,8 @@ Heap::QmlContext *QmlContext::createWorkerContext(ExecutionContext *parent, cons
qml->QV4::Object::put(QV4::ScopedString(scope, scope.engine->newString(QStringLiteral("WorkerScript"))), api);
qml->setReadOnly(true);
- Heap::QmlContext *c = parent->d()->engine->memoryManager->alloc<QmlContext>(parent, qml);
+ Heap::QmlContext *c = scope.engine->memoryManager->alloc<QmlContext>(parent, qml);
+ Q_ASSERT(c->vtable() == staticVTable());
return c;
}
@@ -336,7 +337,8 @@ Heap::QmlContext *QmlContext::create(ExecutionContext *parent, QQmlContextData *
Scope scope(parent);
Scoped<QQmlContextWrapper> qml(scope, scope.engine->memoryManager->allocObject<QQmlContextWrapper>(context, scopeObject));
- Heap::QmlContext *c = parent->d()->engine->memoryManager->alloc<QmlContext>(parent, qml);
+ Heap::QmlContext *c = scope.engine->memoryManager->alloc<QmlContext>(parent, qml);
+ Q_ASSERT(c->vtable() == staticVTable());
return c;
}
diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp
index 83730d632a..91650f16e2 100644
--- a/src/qml/jsruntime/qv4qobjectwrapper.cpp
+++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp
@@ -1060,7 +1060,6 @@ void QObjectWrapper::destroyObject(bool lastCall)
}
}
- h->internalClass = 0;
h->~Data();
}
@@ -1813,7 +1812,7 @@ QV4::ReturnedValue CallArgument::toValue(QV4::ExecutionEngine *engine)
ReturnedValue QObjectMethod::create(ExecutionContext *scope, QObject *object, int index)
{
Scope valueScope(scope);
- Scoped<QObjectMethod> method(valueScope, scope->d()->engine->memoryManager->allocObject<QObjectMethod>(scope));
+ Scoped<QObjectMethod> method(valueScope, valueScope.engine->memoryManager->allocObject<QObjectMethod>(scope));
method->d()->setObject(object);
if (QQmlData *ddata = QQmlData::get(object))
@@ -1864,7 +1863,7 @@ QV4::ReturnedValue QObjectMethod::method_toString(QV4::ExecutionContext *ctx) co
result = QLatin1String("null");
}
- return ctx->d()->engine->newString(result)->asReturnedValue();
+ return ctx->engine()->newString(result)->asReturnedValue();
}
QV4::ReturnedValue QObjectMethod::method_destroy(QV4::ExecutionContext *ctx, const Value *args, int argc) const
diff --git a/src/qml/jsruntime/qv4regexp_p.h b/src/qml/jsruntime/qv4regexp_p.h
index 348af0fb14..7ab12fe245 100644
--- a/src/qml/jsruntime/qv4regexp_p.h
+++ b/src/qml/jsruntime/qv4regexp_p.h
@@ -100,6 +100,7 @@ struct RegExp : public Managed
V4_MANAGED(RegExp, Managed)
Q_MANAGED_TYPE(RegExp)
V4_NEEDS_DESTROY
+ V4_INTERNALCLASS(RegExp)
QString pattern() const { return *d()->pattern; }
JSC::Yarr::BytecodePattern *byteCode() { return d()->byteCode; }
diff --git a/src/qml/jsruntime/qv4regexpobject.cpp b/src/qml/jsruntime/qv4regexpobject.cpp
index 85e37ebe82..735951e085 100644
--- a/src/qml/jsruntime/qv4regexpobject.cpp
+++ b/src/qml/jsruntime/qv4regexpobject.cpp
@@ -356,7 +356,7 @@ void RegExpPrototype::method_exec(const BuiltinFunction *, Scope &scope, CallDat
}
// fill in result data
- ScopedArrayObject array(scope, scope.engine->newArrayObject(scope.engine->regExpExecArrayClass, scope.engine->arrayPrototype()));
+ ScopedArrayObject array(scope, scope.engine->newArrayObject(scope.engine->internalClasses[EngineBase::Class_RegExpExecArray], scope.engine->arrayPrototype()));
int len = r->value()->captureCount();
array->arrayReserve(len);
ScopedValue v(scope);
diff --git a/src/qml/jsruntime/qv4regexpobject_p.h b/src/qml/jsruntime/qv4regexpobject_p.h
index 0fcfe93135..6f54a4ab92 100644
--- a/src/qml/jsruntime/qv4regexpobject_p.h
+++ b/src/qml/jsruntime/qv4regexpobject_p.h
@@ -103,7 +103,7 @@ DECLARE_HEAP_OBJECT(RegExpCtor, FunctionObject) {
struct RegExpObject: Object {
V4_OBJECT2(RegExpObject, Object)
Q_MANAGED_TYPE(RegExpObject)
- V4_INTERNALCLASS(regExpObjectClass)
+ V4_INTERNALCLASS(RegExpObject)
V4_PROTOTYPE(regExpPrototype)
// needs to be compatible with the flags in qv4jsir_p.h
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp
index 610db8ec00..df2af9de40 100644
--- a/src/qml/jsruntime/qv4runtime.cpp
+++ b/src/qml/jsruntime/qv4runtime.cpp
@@ -554,7 +554,7 @@ QV4::ReturnedValue RuntimeHelpers::addHelper(ExecutionEngine *engine, const Valu
if (!sright->d()->length())
return sleft->asReturnedValue();
MemoryManager *mm = engine->memoryManager;
- return (mm->alloc<String>(mm, sleft->d(), sright->d()))->asReturnedValue();
+ return (mm->alloc<String>(sleft->d(), sright->d()))->asReturnedValue();
}
double x = RuntimeHelpers::toNumber(pleft);
double y = RuntimeHelpers::toNumber(pright);
@@ -586,7 +586,7 @@ QV4::ReturnedValue Runtime::method_addString(ExecutionEngine *engine, const Valu
if (!sright->d()->length())
return pleft->asReturnedValue();
MemoryManager *mm = engine->memoryManager;
- return (mm->alloc<String>(mm, sleft->d(), sright->d()))->asReturnedValue();
+ return (mm->alloc<String>(sleft->d(), sright->d()))->asReturnedValue();
}
void Runtime::method_setProperty(ExecutionEngine *engine, const Value &object, int nameIndex, const Value &value)
@@ -599,41 +599,53 @@ void Runtime::method_setProperty(ExecutionEngine *engine, const Value &object, i
o->put(name, value);
}
-ReturnedValue Runtime::method_getElement(ExecutionEngine *engine, const Value &object, const Value &index)
+static Q_NEVER_INLINE ReturnedValue getElementIntFallback(ExecutionEngine *engine, const Value &object, uint idx)
{
+ Q_ASSERT(idx < UINT_MAX);
Scope scope(engine);
- uint idx = index.asArrayIndex();
ScopedObject o(scope, object);
if (!o) {
- if (idx < UINT_MAX) {
- if (const String *str = object.as<String>()) {
- if (idx >= (uint)str->toQString().length()) {
- return Encode::undefined();
- }
- const QString s = str->toQString().mid(idx, 1);
- return scope.engine->newString(s)->asReturnedValue();
+ if (const String *str = object.as<String>()) {
+ if (idx >= (uint)str->toQString().length()) {
+ return Encode::undefined();
}
+ const QString s = str->toQString().mid(idx, 1);
+ return scope.engine->newString(s)->asReturnedValue();
}
if (object.isNullOrUndefined()) {
- QString message = QStringLiteral("Cannot read property '%1' of %2").arg(index.toQStringNoThrow()).arg(object.toQStringNoThrow());
+ QString message = QStringLiteral("Cannot read property '%1' of %2").arg(idx).arg(object.toQStringNoThrow());
return engine->throwTypeError(message);
}
o = RuntimeHelpers::convertToObject(scope.engine, object);
- if (!o) // type error
- return Encode::undefined();
+ Q_ASSERT(!!o); // can't fail as null/undefined is covered above
+ }
+
+ if (o->arrayData() && !o->arrayData()->attrs) {
+ ScopedValue v(scope, o->arrayData()->get(idx));
+ if (!v->isEmpty())
+ return v->asReturnedValue();
}
- if (idx < UINT_MAX) {
- if (o->arrayData() && !o->arrayData()->attrs) {
- ScopedValue v(scope, o->arrayData()->get(idx));
- if (!v->isEmpty())
- return v->asReturnedValue();
+ return o->getIndexed(idx);
+}
+
+static Q_NEVER_INLINE ReturnedValue getElementFallback(ExecutionEngine *engine, const Value &object, const Value &index)
+{
+ Q_ASSERT(index.asArrayIndex() == UINT_MAX);
+ Scope scope(engine);
+
+ ScopedObject o(scope, object);
+ if (!o) {
+ if (object.isNullOrUndefined()) {
+ QString message = QStringLiteral("Cannot read property '%1' of %2").arg(index.toQStringNoThrow()).arg(object.toQStringNoThrow());
+ return engine->throwTypeError(message);
}
- return o->getIndexed(idx);
+ o = RuntimeHelpers::convertToObject(scope.engine, object);
+ Q_ASSERT(!!o); // can't fail as null/undefined is covered above
}
ScopedString name(scope, index.toString(engine));
@@ -642,18 +654,39 @@ ReturnedValue Runtime::method_getElement(ExecutionEngine *engine, const Value &o
return o->get(name);
}
-void Runtime::method_setElement(ExecutionEngine *engine, const Value &object, const Value &index, const Value &value)
+ReturnedValue Runtime::method_getElement(ExecutionEngine *engine, const Value &object, const Value &index)
+{
+ uint idx;
+ if (index.asArrayIndex(idx)) {
+ if (Heap::Base *b = object.heapObject()) {
+ if (b->vtable()->isObject) {
+ Heap::Object *o = static_cast<Heap::Object *>(b);
+ if (o->arrayData && o->arrayData->type == Heap::ArrayData::Simple) {
+ Heap::SimpleArrayData *s = o->arrayData.cast<Heap::SimpleArrayData>();
+ if (idx < s->values.size)
+ if (!s->data(idx).isEmpty())
+ return s->data(idx).asReturnedValue();
+ }
+ }
+ }
+ return getElementIntFallback(engine, object, idx);
+ }
+
+ return getElementFallback(engine, object, index);
+}
+
+static Q_NEVER_INLINE void setElementFallback(ExecutionEngine *engine, const Value &object, const Value &index, const Value &value)
{
Scope scope(engine);
ScopedObject o(scope, object.toObject(engine));
- if (scope.engine->hasException)
+ if (engine->hasException)
return;
- uint idx = index.asArrayIndex();
- if (idx < UINT_MAX) {
- if (o->arrayType() == Heap::ArrayData::Simple) {
- Heap::SimpleArrayData *s = static_cast<Heap::SimpleArrayData *>(o->arrayData());
- if (s && idx < s->values.size && !s->data(idx).isEmpty()) {
+ uint idx;
+ if (index.asArrayIndex(idx)) {
+ if (o->d()->arrayData && o->d()->arrayData->type == Heap::ArrayData::Simple) {
+ Heap::SimpleArrayData *s = o->d()->arrayData.cast<Heap::SimpleArrayData>();
+ if (idx < s->values.size) {
s->setData(engine, idx, value);
return;
}
@@ -666,6 +699,27 @@ void Runtime::method_setElement(ExecutionEngine *engine, const Value &object, co
o->put(name, value);
}
+void Runtime::method_setElement(ExecutionEngine *engine, const Value &object, const Value &index, const Value &value)
+{
+ uint idx;
+ if (index.asArrayIndex(idx)) {
+ if (Heap::Base *b = object.heapObject()) {
+ if (b->vtable()->isObject) {
+ Heap::Object *o = static_cast<Heap::Object *>(b);
+ if (o->arrayData && o->arrayData->type == Heap::ArrayData::Simple) {
+ Heap::SimpleArrayData *s = o->arrayData.cast<Heap::SimpleArrayData>();
+ if (idx < s->values.size) {
+ s->setData(engine, idx, value);
+ return;
+ }
+ }
+ }
+ }
+ }
+
+ return setElementFallback(engine, object, index, value);
+}
+
ReturnedValue Runtime::method_foreachIterator(ExecutionEngine *engine, const Value &in)
{
Scope scope(engine);
@@ -1354,7 +1408,7 @@ QV4::ReturnedValue Runtime::method_setupArgumentsObject(ExecutionEngine *engine)
{
Q_ASSERT(engine->current->type == Heap::ExecutionContext::Type_CallContext);
QV4::CallContext *c = static_cast<QV4::CallContext *>(engine->currentContext);
- QV4::InternalClass *ic = c->d()->strictMode ? engine->strictArgumentsObjectClass : engine->argumentsObjectClass;
+ QV4::InternalClass *ic = engine->internalClasses[c->d()->strictMode ? EngineBase::Class_StrictArgumentsObject : EngineBase::Class_ArgumentsObject];
return engine->memoryManager->allocObject<ArgumentsObject>(ic, engine->objectPrototype(), c)->asReturnedValue();
}
diff --git a/src/qml/jsruntime/qv4scopedvalue_p.h b/src/qml/jsruntime/qv4scopedvalue_p.h
index bc882bbd95..04a0c74133 100644
--- a/src/qml/jsruntime/qv4scopedvalue_p.h
+++ b/src/qml/jsruntime/qv4scopedvalue_p.h
@@ -102,7 +102,7 @@ struct ScopedValue;
struct Scope {
inline Scope(ExecutionContext *ctx)
- : engine(ctx->d()->engine)
+ : engine(ctx->engine())
, mark(engine->jsStackTop)
, result(*engine->jsAlloca(1))
{
diff --git a/src/qml/jsruntime/qv4sequenceobject_p.h b/src/qml/jsruntime/qv4sequenceobject_p.h
index dcab34d092..2b8d1ea716 100644
--- a/src/qml/jsruntime/qv4sequenceobject_p.h
+++ b/src/qml/jsruntime/qv4sequenceobject_p.h
@@ -65,6 +65,7 @@ namespace QV4 {
struct SequencePrototype : public QV4::Object
{
+ V4_PROTOTYPE(arrayPrototype)
void init();
static void method_valueOf(const BuiltinFunction *, Scope &scope, CallData *callData)
diff --git a/src/qml/jsruntime/qv4string.cpp b/src/qml/jsruntime/qv4string.cpp
index 71f85c2d71..c0183a46a7 100644
--- a/src/qml/jsruntime/qv4string.cpp
+++ b/src/qml/jsruntime/qv4string.cpp
@@ -75,10 +75,9 @@ bool String::isEqualTo(Managed *t, Managed *o)
}
-void Heap::String::init(MemoryManager *mm, const QString &t)
+void Heap::String::init(const QString &t)
{
Base::init();
- this->mm = mm;
subtype = String::StringType_Unknown;
@@ -90,10 +89,9 @@ void Heap::String::init(MemoryManager *mm, const QString &t)
len = text->size;
}
-void Heap::String::init(MemoryManager *mm, String *l, String *r)
+void Heap::String::init(String *l, String *r)
{
Base::init();
- this->mm = mm;
subtype = String::StringType_Unknown;
@@ -116,7 +114,7 @@ void Heap::String::init(MemoryManager *mm, String *l, String *r)
void Heap::String::destroy() {
if (!largestSubLength) {
- mm->changeUnmanagedHeapSizeUsage(qptrdiff(-text->size) * (int)sizeof(QChar));
+ internalClass->engine->memoryManager->changeUnmanagedHeapSizeUsage(qptrdiff(-text->size) * (int)sizeof(QChar));
if (!text->ref.deref())
QStringData::deallocate(text);
}
@@ -141,12 +139,12 @@ uint String::toUInt(bool *ok) const
return UINT_MAX;
}
-void String::makeIdentifierImpl(ExecutionEngine *e) const
+void String::makeIdentifierImpl() const
{
if (d()->largestSubLength)
d()->simplifyString();
Q_ASSERT(!d()->largestSubLength);
- e->identifierTable->identifier(this);
+ engine()->identifierTable->identifier(this);
}
void Heap::String::simplifyString() const
@@ -161,7 +159,7 @@ void Heap::String::simplifyString() const
text->ref.ref();
identifier = 0;
largestSubLength = 0;
- mm->changeUnmanagedHeapSizeUsage(qptrdiff(text->size) * (qptrdiff)sizeof(QChar));
+ internalClass->engine->memoryManager->changeUnmanagedHeapSizeUsage(qptrdiff(text->size) * (qptrdiff)sizeof(QChar));
}
void Heap::String::append(const String *data, QChar *ch)
diff --git a/src/qml/jsruntime/qv4string_p.h b/src/qml/jsruntime/qv4string_p.h
index 71e55cbcd4..2f34dd6139 100644
--- a/src/qml/jsruntime/qv4string_p.h
+++ b/src/qml/jsruntime/qv4string_p.h
@@ -53,6 +53,7 @@
#include <QtCore/qstring.h>
#include "qv4managed_p.h"
#include <QtCore/private/qnumeric_p.h>
+#include "qv4enginebase_p.h"
QT_BEGIN_NAMESPACE
@@ -71,8 +72,8 @@ struct Q_QML_PRIVATE_EXPORT String : Base {
};
#ifndef V4_BOOTSTRAP
- void init(MemoryManager *mm, const QString &text);
- void init(MemoryManager *mm, String *l, String *n);
+ void init(const QString &text);
+ void init(String *l, String *n);
void destroy();
void simplifyString() const;
int length() const {
@@ -125,7 +126,6 @@ struct Q_QML_PRIVATE_EXPORT String : Base {
mutable uint stringHash;
mutable uint largestSubLength;
uint len;
- MemoryManager *mm;
private:
static void append(const String *data, QChar *ch);
#endif
@@ -138,6 +138,7 @@ struct Q_QML_PRIVATE_EXPORT String : public Managed {
#ifndef V4_BOOTSTRAP
V4_MANAGED(String, Managed)
Q_MANAGED_TYPE(String)
+ V4_INTERNALCLASS(String)
V4_NEEDS_DESTROY
enum {
IsString = true
@@ -174,13 +175,13 @@ struct Q_QML_PRIVATE_EXPORT String : public Managed {
}
uint toUInt(bool *ok) const;
- void makeIdentifier(ExecutionEngine *e) const {
+ void makeIdentifier() const {
if (d()->identifier)
return;
- makeIdentifierImpl(e);
+ makeIdentifierImpl();
}
- void makeIdentifierImpl(ExecutionEngine *e) const;
+ void makeIdentifierImpl() const;
static uint createHashValue(const QChar *ch, int length, uint *subtype)
{
diff --git a/src/qml/jsruntime/qv4stringobject_p.h b/src/qml/jsruntime/qv4stringobject_p.h
index 5ccee3335e..ce046f4844 100644
--- a/src/qml/jsruntime/qv4stringobject_p.h
+++ b/src/qml/jsruntime/qv4stringobject_p.h
@@ -86,7 +86,7 @@ struct StringCtor : FunctionObject {
struct StringObject: Object {
V4_OBJECT2(StringObject, Object)
Q_MANAGED_TYPE(StringObject)
- V4_INTERNALCLASS(stringClass)
+ V4_INTERNALCLASS(StringObject)
V4_PROTOTYPE(stringPrototype)
Heap::String *getIndex(uint index) const {
@@ -112,6 +112,7 @@ struct StringCtor: FunctionObject
struct StringPrototype: StringObject
{
+ V4_PROTOTYPE(objectPrototype)
void init(ExecutionEngine *engine, Object *ctor);
static void method_toString(const BuiltinFunction *, Scope &scope, CallData *callData);
diff --git a/src/qml/jsruntime/qv4typedarray.cpp b/src/qml/jsruntime/qv4typedarray.cpp
index a34a8922e1..fe27d7c2d2 100644
--- a/src/qml/jsruntime/qv4typedarray.cpp
+++ b/src/qml/jsruntime/qv4typedarray.cpp
@@ -372,7 +372,9 @@ void Heap::TypedArray::init(Type t)
Heap::TypedArray *TypedArray::create(ExecutionEngine *e, Heap::TypedArray::Type t)
{
- return e->memoryManager->allocObject<TypedArray>(e->emptyClass, e->typedArrayPrototype + t, t);
+ QV4::InternalClass *ic = e->internalClasses[EngineBase::Class_Empty]->changeVTable(staticVTable());
+ ic = ic->changePrototype(e->typedArrayPrototype[t].d());
+ return e->memoryManager->allocObject<TypedArray>(ic, e->typedArrayPrototype + t, t);
}
ReturnedValue TypedArray::getIndexed(const Managed *m, uint index, bool *hasProperty)
diff --git a/src/qml/jsruntime/qv4typedarray_p.h b/src/qml/jsruntime/qv4typedarray_p.h
index 96786c8231..a472dfa607 100644
--- a/src/qml/jsruntime/qv4typedarray_p.h
+++ b/src/qml/jsruntime/qv4typedarray_p.h
@@ -149,6 +149,7 @@ struct TypedArrayCtor: FunctionObject
struct TypedArrayPrototype : Object
{
V4_OBJECT2(TypedArrayPrototype, Object)
+ V4_PROTOTYPE(objectPrototype)
void init(ExecutionEngine *engine, TypedArrayCtor *ctor);
diff --git a/src/qml/jsruntime/qv4variantobject_p.h b/src/qml/jsruntime/qv4variantobject_p.h
index e281602bb5..a7c6fa320c 100644
--- a/src/qml/jsruntime/qv4variantobject_p.h
+++ b/src/qml/jsruntime/qv4variantobject_p.h
@@ -105,6 +105,7 @@ struct VariantObject : Object
struct VariantPrototype : VariantObject
{
public:
+ V4_PROTOTYPE(objectPrototype)
void init();
static void method_preserve(const BuiltinFunction *, Scope &scope, CallData *callData);
diff --git a/src/qml/jsruntime/qv4vme_moth.cpp b/src/qml/jsruntime/qv4vme_moth.cpp
index e16df8dc60..7293630924 100644
--- a/src/qml/jsruntime/qv4vme_moth.cpp
+++ b/src/qml/jsruntime/qv4vme_moth.cpp
@@ -172,7 +172,7 @@ static QV4::Function *qt_v4ExtractFunction(QV4::ExecutionContext *context)
if (QV4::Function *function = context->getFunction())
return function;
else
- return context->d()->engine->globalCode;
+ return context->engine()->globalCode;
}
static void qt_v4TriggerBreakpoint(const Breakpoint &bp, QV4::Function *function)
@@ -304,7 +304,7 @@ using namespace QV4::Moth;
# define MOTH_END_INSTR(I) } \
genericInstr = reinterpret_cast<const Instr *>(code); \
- goto *genericInstr->common.code; \
+ goto *jumpTable[genericInstr->common.instructionType]; \
#else
@@ -362,11 +362,7 @@ Param traceParam(const Param &param)
if (engine->hasException) \
goto catchException
-QV4::ReturnedValue VME::run(ExecutionEngine *engine, const uchar *code
-#ifdef MOTH_THREADED_INTERPRETER
- , void ***storeJumpTable
-#endif
- )
+QV4::ReturnedValue VME::run(ExecutionEngine *engine, const uchar *code)
{
#ifdef DO_TRACE_INSTR
qDebug("Starting VME with context=%p and code=%p", context, code);
@@ -375,15 +371,11 @@ QV4::ReturnedValue VME::run(ExecutionEngine *engine, const uchar *code
qt_v4ResolvePendingBreakpointsHook();
#ifdef MOTH_THREADED_INTERPRETER
- if (storeJumpTable) {
#define MOTH_INSTR_ADDR(I, FMT) &&op_##I,
- static void *jumpTable[] = {
- FOR_EACH_MOTH_INSTR(MOTH_INSTR_ADDR)
- };
+ static void *jumpTable[] = {
+ FOR_EACH_MOTH_INSTR(MOTH_INSTR_ADDR)
+ };
#undef MOTH_INSTR_ADDR
- *storeJumpTable = jumpTable;
- return QV4::Primitive::undefinedValue().asReturnedValue();
- }
#endif
QV4::Value *stack = 0;
@@ -392,7 +384,6 @@ QV4::ReturnedValue VME::run(ExecutionEngine *engine, const uchar *code
const uchar *exceptionHandler = 0;
QV4::Scope scope(engine);
- QV4::ExecutionContext *context = engine->currentContext;
engine->current->lineNumber = -1;
#ifdef DO_TRACE_INSTR
@@ -402,7 +393,7 @@ QV4::ReturnedValue VME::run(ExecutionEngine *engine, const uchar *code
// setup lookup scopes
int scopeDepth = 0;
{
- QV4::Heap::ExecutionContext *scope = context->d();
+ QV4::Heap::ExecutionContext *scope = engine->current;
while (scope) {
++scopeDepth;
scope = scope->outer;
@@ -415,10 +406,10 @@ QV4::ReturnedValue VME::run(ExecutionEngine *engine, const uchar *code
};
Q_ALLOCA_VAR(Scopes, scopes, sizeof(Scopes)*(2 + 2*scopeDepth));
{
- scopes[0] = { const_cast<QV4::Value *>(static_cast<CompiledData::CompilationUnit*>(context->d()->compilationUnit)->constants), 0 };
+ scopes[0] = { const_cast<QV4::Value *>(static_cast<CompiledData::CompilationUnit*>(engine->current->compilationUnit)->constants), 0 };
// stack gets setup in push instruction
scopes[1] = { 0, 0 };
- QV4::Heap::ExecutionContext *scope = context->d();
+ QV4::Heap::ExecutionContext *scope = engine->current;
int i = 0;
while (scope) {
if (scope->type == QV4::Heap::ExecutionContext::Type_SimpleCallContext) {
@@ -442,7 +433,7 @@ QV4::ReturnedValue VME::run(ExecutionEngine *engine, const uchar *code
for (;;) {
const Instr *genericInstr = reinterpret_cast<const Instr *>(code);
#ifdef MOTH_THREADED_INTERPRETER
- goto *genericInstr->common.code;
+ goto *jumpTable[genericInstr->common.instructionType];
#else
switch (genericInstr->common.instructionType) {
#endif
@@ -461,12 +452,12 @@ QV4::ReturnedValue VME::run(ExecutionEngine *engine, const uchar *code
MOTH_BEGIN_INSTR(LoadRuntimeString)
// TRACE(value, "%s", instr.value.toString(context)->toQString().toUtf8().constData());
- VALUE(instr.result) = context->d()->compilationUnit->runtimeStrings[instr.stringId];
+ VALUE(instr.result) = engine->current->compilationUnit->runtimeStrings[instr.stringId];
MOTH_END_INSTR(LoadRuntimeString)
MOTH_BEGIN_INSTR(LoadRegExp)
// TRACE(value, "%s", instr.value.toString(context)->toQString().toUtf8().constData());
- VALUE(instr.result) = static_cast<CompiledData::CompilationUnit*>(context->d()->compilationUnit)->runtimeRegularExpressions[instr.regExpId];
+ VALUE(instr.result) = static_cast<CompiledData::CompilationUnit*>(engine->current->compilationUnit)->runtimeRegularExpressions[instr.regExpId];
MOTH_END_INSTR(LoadRegExp)
MOTH_BEGIN_INSTR(LoadClosure)
@@ -479,7 +470,7 @@ QV4::ReturnedValue VME::run(ExecutionEngine *engine, const uchar *code
MOTH_END_INSTR(LoadName)
MOTH_BEGIN_INSTR(GetGlobalLookup)
- QV4::Lookup *l = context->d()->lookups + instr.index;
+ QV4::Lookup *l = engine->current->lookups + instr.index;
STOREVALUE(instr.result, l->globalGetter(l, engine));
MOTH_END_INSTR(GetGlobalLookup)
@@ -494,7 +485,7 @@ QV4::ReturnedValue VME::run(ExecutionEngine *engine, const uchar *code
MOTH_END_INSTR(LoadElement)
MOTH_BEGIN_INSTR(LoadElementLookup)
- QV4::Lookup *l = context->d()->lookups + instr.lookup;
+ QV4::Lookup *l = engine->current->lookups + instr.lookup;
STOREVALUE(instr.result, l->indexedGetter(l, engine, VALUE(instr.base), VALUE(instr.index)));
MOTH_END_INSTR(LoadElementLookup)
@@ -504,7 +495,7 @@ QV4::ReturnedValue VME::run(ExecutionEngine *engine, const uchar *code
MOTH_END_INSTR(StoreElement)
MOTH_BEGIN_INSTR(StoreElementLookup)
- QV4::Lookup *l = context->d()->lookups + instr.lookup;
+ QV4::Lookup *l = engine->current->lookups + instr.lookup;
l->indexedSetter(l, engine, VALUE(instr.base), VALUE(instr.index), VALUE(instr.source));
CHECK_EXCEPTION;
MOTH_END_INSTR(StoreElementLookup)
@@ -514,7 +505,7 @@ QV4::ReturnedValue VME::run(ExecutionEngine *engine, const uchar *code
MOTH_END_INSTR(LoadProperty)
MOTH_BEGIN_INSTR(GetLookup)
- QV4::Lookup *l = context->d()->lookups + instr.index;
+ QV4::Lookup *l = engine->current->lookups + instr.index;
STOREVALUE(instr.result, l->getter(l, engine, VALUE(instr.base)));
MOTH_END_INSTR(GetLookup)
@@ -524,7 +515,7 @@ QV4::ReturnedValue VME::run(ExecutionEngine *engine, const uchar *code
MOTH_END_INSTR(StoreProperty)
MOTH_BEGIN_INSTR(SetLookup)
- QV4::Lookup *l = context->d()->lookups + instr.index;
+ QV4::Lookup *l = engine->current->lookups + instr.index;
l->setter(l, engine, VALUE(instr.base), VALUE(instr.source));
CHECK_EXCEPTION;
MOTH_END_INSTR(SetLookup)
@@ -595,7 +586,7 @@ QV4::ReturnedValue VME::run(ExecutionEngine *engine, const uchar *code
MOTH_END_INSTR(CallValue)
MOTH_BEGIN_INSTR(CallProperty)
- TRACE(property name, "%s, args=%u, argc=%u, this=%s", qPrintable(runtimeStrings[instr.name]->toQString()), instr.callData, instr.argc, (VALUE(instr.base)).toString(context)->toQString().toUtf8().constData());
+ TRACE(property name, "%s, args=%u, argc=%u, this=%s", qPrintable(runtimeStrings[instr.name]->toQString()), instr.callData, instr.argc, (VALUE(instr.base)).toString(engine)->toQString().toUtf8().constData());
Q_ASSERT(instr.callData + instr.argc + offsetof(QV4::CallData, args)/sizeof(QV4::Value) <= stackSize);
QV4::CallData *callData = reinterpret_cast<QV4::CallData *>(stack + instr.callData);
callData->tag = quint32(Value::ValueTypeInternal::Integer);
@@ -614,7 +605,7 @@ QV4::ReturnedValue VME::run(ExecutionEngine *engine, const uchar *code
MOTH_END_INSTR(CallPropertyLookup)
MOTH_BEGIN_INSTR(CallScopeObjectProperty)
- TRACE(property name, "%s, args=%u, argc=%u, this=%s", qPrintable(runtimeStrings[instr.name]->toQString()), instr.callData, instr.argc, (VALUE(instr.base)).toString(context)->toQString().toUtf8().constData());
+ TRACE(property name, "%s, args=%u, argc=%u, this=%s", qPrintable(runtimeStrings[instr.name]->toQString()), instr.callData, instr.argc, (VALUE(instr.base)).toString(engine)->toQString().toUtf8().constData());
Q_ASSERT(instr.callData + instr.argc + offsetof(QV4::CallData, args)/sizeof(QV4::Value) <= stackSize);
QV4::CallData *callData = reinterpret_cast<QV4::CallData *>(stack + instr.callData);
callData->tag = quint32(Value::ValueTypeInternal::Integer);
@@ -624,7 +615,7 @@ QV4::ReturnedValue VME::run(ExecutionEngine *engine, const uchar *code
MOTH_END_INSTR(CallScopeObjectProperty)
MOTH_BEGIN_INSTR(CallContextObjectProperty)
- TRACE(property name, "%s, args=%u, argc=%u, this=%s", qPrintable(runtimeStrings[instr.name]->toQString()), instr.callData, instr.argc, (VALUE(instr.base)).toString(context)->toQString().toUtf8().constData());
+ TRACE(property name, "%s, args=%u, argc=%u, this=%s", qPrintable(runtimeStrings[instr.name]->toQString()), instr.callData, instr.argc, (VALUE(instr.base)).toString(engine)->toQString().toUtf8().constData());
Q_ASSERT(instr.callData + instr.argc + offsetof(QV4::CallData, args)/sizeof(QV4::Value) <= stackSize);
QV4::CallData *callData = reinterpret_cast<QV4::CallData *>(stack + instr.callData);
callData->tag = quint32(Value::ValueTypeInternal::Integer);
@@ -675,18 +666,15 @@ QV4::ReturnedValue VME::run(ExecutionEngine *engine, const uchar *code
MOTH_BEGIN_INSTR(CallBuiltinPushCatchScope)
Runtime::method_pushCatchScope(static_cast<QV4::NoThrowEngine*>(engine), instr.name);
- context = engine->currentContext;
MOTH_END_INSTR(CallBuiltinPushCatchScope)
MOTH_BEGIN_INSTR(CallBuiltinPushScope)
Runtime::method_pushWithScope(VALUE(instr.arg), static_cast<QV4::NoThrowEngine*>(engine));
- context = engine->currentContext;
CHECK_EXCEPTION;
MOTH_END_INSTR(CallBuiltinPushScope)
MOTH_BEGIN_INSTR(CallBuiltinPopScope)
Runtime::method_popScope(static_cast<QV4::NoThrowEngine*>(engine));
- context = engine->currentContext;
MOTH_END_INSTR(CallBuiltinPopScope)
MOTH_BEGIN_INSTR(CallBuiltinForeachIteratorObject)
@@ -926,22 +914,22 @@ QV4::ReturnedValue VME::run(ExecutionEngine *engine, const uchar *code
#ifndef QT_NO_QML_DEBUGGER
MOTH_BEGIN_INSTR(Debug)
engine->current->lineNumber = instr.lineNumber;
- QV4::Debugging::Debugger *debugger = context->engine()->debugger();
+ QV4::Debugging::Debugger *debugger = engine->debugger();
if (debugger && debugger->pauseAtNextOpportunity())
debugger->maybeBreakAtInstruction();
if (qt_v4IsDebugging)
- qt_v4CheckForBreak(context);
+ qt_v4CheckForBreak(engine->currentContext);
MOTH_END_INSTR(Debug)
MOTH_BEGIN_INSTR(Line)
engine->current->lineNumber = instr.lineNumber;
if (qt_v4IsDebugging)
- qt_v4CheckForBreak(context);
+ qt_v4CheckForBreak(engine->currentContext);
MOTH_END_INSTR(Line)
#endif // QT_NO_QML_DEBUGGER
MOTH_BEGIN_INSTR(LoadThis)
- VALUE(instr.result) = context->thisObject();
+ VALUE(instr.result) = engine->currentContext->thisObject();
MOTH_END_INSTR(LoadThis)
MOTH_BEGIN_INSTR(LoadQmlContext)
@@ -967,25 +955,13 @@ QV4::ReturnedValue VME::run(ExecutionEngine *engine, const uchar *code
Q_ASSERT(false);
catchException:
- Q_ASSERT(context->engine()->hasException);
+ Q_ASSERT(engine->hasException);
if (!exceptionHandler)
return QV4::Encode::undefined();
code = exceptionHandler;
}
}
-#ifdef MOTH_THREADED_INTERPRETER
-void **VME::instructionJumpTable()
-{
- static void **jumpTable = 0;
- if (!jumpTable) {
- const uchar *code = 0;
- VME().run(0, code, &jumpTable);
- }
- return jumpTable;
-}
-#endif
-
QV4::ReturnedValue VME::exec(ExecutionEngine *engine, const uchar *code)
{
VME vme;
diff --git a/src/qml/jsruntime/qv4vme_moth_p.h b/src/qml/jsruntime/qv4vme_moth_p.h
index f8893509d9..8d46207f2b 100644
--- a/src/qml/jsruntime/qv4vme_moth_p.h
+++ b/src/qml/jsruntime/qv4vme_moth_p.h
@@ -67,16 +67,8 @@ class VME
public:
static QV4::ReturnedValue exec(QV4::ExecutionEngine *, const uchar *);
-#ifdef MOTH_THREADED_INTERPRETER
- static void **instructionJumpTable();
-#endif
-
private:
- QV4::ReturnedValue run(QV4::ExecutionEngine *, const uchar *code
-#ifdef MOTH_THREADED_INTERPRETER
- , void ***storeJumpTable = 0
-#endif
- );
+ QV4::ReturnedValue run(QV4::ExecutionEngine *, const uchar *code);
};
} // namespace Moth
diff --git a/src/qml/memory/qv4heap_p.h b/src/qml/memory/qv4heap_p.h
index a38a938588..f00ce4283c 100644
--- a/src/qml/memory/qv4heap_p.h
+++ b/src/qml/memory/qv4heap_p.h
@@ -53,6 +53,7 @@
#include <QtCore/QString>
#include <private/qv4global_p.h>
#include <private/qv4mmdefs_p.h>
+#include <private/qv4internalclass_p.h>
#include <QSharedPointer>
// To check if Heap::Base::init is called (meaning, all subclasses did their init and called their
@@ -69,10 +70,14 @@ QT_BEGIN_NAMESPACE
namespace QV4 {
+struct InternalClass;
+
struct VTable
{
const VTable * const parent;
const quint64 markTable;
+ uint inlinePropertyOffset : 16;
+ uint nInlineProperties : 16;
uint isExecutionContext : 1;
uint isString : 1;
uint isObject : 1;
@@ -94,13 +99,12 @@ struct Q_QML_EXPORT Base {
static Q_CONSTEXPR quint64 markTable = 0;
- const VTable *vt;
+ InternalClass *internalClass;
inline ReturnedValue asReturnedValue() const;
inline void mark(QV4::MarkStack *markStack);
- void setVtable(const VTable *v) { vt = v; }
- const VTable *vtable() const { return vt; }
+ const VTable *vtable() const { return internalClass->vtable; }
inline bool isMarked() const {
const HeapItem *h = reinterpret_cast<const HeapItem *>(this);
Chunk *c = h->chunk();
@@ -175,7 +179,7 @@ V4_ASSERT_IS_TRIVIAL(Base)
// for a size/offset translation when cross-compiling between 32- and
// 64-bit.
Q_STATIC_ASSERT(std::is_standard_layout<Base>::value);
-Q_STATIC_ASSERT(offsetof(Base, vt) == 0);
+Q_STATIC_ASSERT(offsetof(Base, internalClass) == 0);
Q_STATIC_ASSERT(sizeof(Base) == QT_POINTER_SIZE);
}
diff --git a/src/qml/memory/qv4mm.cpp b/src/qml/memory/qv4mm.cpp
index 64b07153cc..de97918fb0 100644
--- a/src/qml/memory/qv4mm.cpp
+++ b/src/qml/memory/qv4mm.cpp
@@ -348,8 +348,9 @@ static void increaseFreedCountForClass(const char *className)
(*freedObjectStatsGlobal())[className]++;
}
-void Chunk::sweep(ClassDestroyStatsCallback classCountPtr)
+bool Chunk::sweep(ClassDestroyStatsCallback classCountPtr)
{
+ bool hasUsedSlots = false;
SDUMP() << "sweeping chunk" << this;
HeapItem *o = realBase();
bool lastSlotFree = false;
@@ -395,6 +396,7 @@ void Chunk::sweep(ClassDestroyStatsCallback classCountPtr)
}
objectBitmap[i] = blackBitmap[i];
grayBitmap[i] = 0;
+ hasUsedSlots |= (blackBitmap[i] != 0);
extendsBitmap[i] = e;
lastSlotFree = !((objectBitmap[i]|extendsBitmap[i]) >> (sizeof(quintptr)*8 - 1));
SDUMP() << " new extends =" << binary(e);
@@ -403,6 +405,7 @@ void Chunk::sweep(ClassDestroyStatsCallback classCountPtr)
o += Chunk::Bits;
}
// DEBUG << "swept chunk" << this << "freed" << slotsFreed << "slots.";
+ return hasUsedSlots;
}
void Chunk::freeAll()
@@ -700,12 +703,21 @@ void BlockAllocator::sweep(ClassDestroyStatsCallback classCountPtr)
// qDebug() << "BlockAlloc: sweep";
usedSlotsAfterLastSweep = 0;
- for (auto c : chunks) {
- c->sweep(classCountPtr);
- c->sortIntoBins(freeBins, NumBins);
-// qDebug() << "used slots in chunk" << c << ":" << c->nUsedSlots();
- usedSlotsAfterLastSweep += c->nUsedSlots();
- }
+
+ auto isFree = [this, classCountPtr] (Chunk *c) {
+ bool isUsed = c->sweep(classCountPtr);
+
+ if (isUsed) {
+ c->sortIntoBins(freeBins, NumBins);
+ usedSlotsAfterLastSweep += c->nUsedSlots();
+ } else {
+ chunkAllocator->free(c);
+ }
+ return !isUsed;
+ };
+
+ auto newEnd = std::remove_if(chunks.begin(), chunks.end(), isFree);
+ chunks.erase(newEnd, chunks.end());
}
void BlockAllocator::freeAll()
@@ -922,13 +934,17 @@ Heap::Base *MemoryManager::allocData(std::size_t size)
return *m;
}
-Heap::Object *MemoryManager::allocObjectWithMemberData(std::size_t size, uint nMembers)
+Heap::Object *MemoryManager::allocObjectWithMemberData(const QV4::VTable *vtable, uint nMembers)
{
+ uint size = (vtable->nInlineProperties + vtable->inlinePropertyOffset)*sizeof(Value);
+ Q_ASSERT(!(size % sizeof(HeapItem)));
+
Heap::Object *o;
- if (!nMembers) {
+ if (nMembers <= vtable->nInlineProperties) {
o = static_cast<Heap::Object *>(allocData(size));
} else {
// Allocate both in one go through the block allocator
+ nMembers -= vtable->nInlineProperties;
std::size_t memberSize = align(sizeof(Heap::MemberData) + (nMembers - 1)*sizeof(Value));
size_t totalSize = size + memberSize;
Heap::MemberData *m;
@@ -947,7 +963,8 @@ Heap::Object *MemoryManager::allocObjectWithMemberData(std::size_t size, uint nM
Chunk::clearBit(c->extendsBitmap, index);
}
o->memberData.set(engine, m);
- m->setVtable(MemberData::staticVTable());
+ m->internalClass = engine->internalClasses[EngineBase::Class_MemberData];
+ Q_ASSERT(o->memberData->internalClass);
m->values.alloc = static_cast<uint>((memberSize - sizeof(Heap::MemberData) + sizeof(Value))/sizeof(Value));
m->values.size = o->memberData->values.alloc;
m->init();
@@ -1147,7 +1164,8 @@ void MemoryManager::runGC()
qDebug() << " Allocations since last GC" << allocationCount;
allocationCount = 0;
#endif
- qDebug() << "Allocated" << totalMem << "bytes in" << blockAllocator.chunks.size() << "chunks";
+ size_t oldChunks = blockAllocator.chunks.size();
+ qDebug() << "Allocated" << totalMem << "bytes in" << oldChunks << "chunks";
qDebug() << "Fragmented memory before GC" << (totalMem - usedBefore);
dumpBins(&blockAllocator);
@@ -1190,8 +1208,9 @@ void MemoryManager::runGC()
});
qDebug() << "Used memory before GC:" << usedBefore;
- qDebug() << "Used memory after GC :" << usedAfter;
- qDebug() << "Freed up bytes :" << (usedBefore - usedAfter);
+ qDebug() << "Used memory after GC:" << usedAfter;
+ qDebug() << "Freed up bytes :" << (usedBefore - usedAfter);
+ qDebug() << "Freed up chunks :" << (oldChunks - blockAllocator.chunks.size());
size_t lost = blockAllocator.allocatedMem() - memInBins - usedAfter;
if (lost)
qDebug() << "!!!!!!!!!!!!!!!!!!!!! LOST MEM:" << lost << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!";
diff --git a/src/qml/memory/qv4mm_p.h b/src/qml/memory/qv4mm_p.h
index df7d09dce0..17957d0cd6 100644
--- a/src/qml/memory/qv4mm_p.h
+++ b/src/qml/memory/qv4mm_p.h
@@ -211,12 +211,13 @@ public:
Q_DECL_CONSTEXPR static inline std::size_t align(std::size_t size)
{ return (size + Chunk::SlotSize - 1) & ~(Chunk::SlotSize - 1); }
- QV4::Heap::SimpleCallContext *allocSimpleCallContext(QV4::ExecutionEngine *v4)
+ QV4::Heap::CallContext *allocSimpleCallContext()
{
Heap::CallContext *ctxt = stackAllocator.allocate();
memset(ctxt, 0, sizeof(Heap::SimpleCallContext));
- ctxt->setVtable(QV4::SimpleCallContext::staticVTable());
- ctxt->init(v4);
+ ctxt->internalClass = SimpleCallContext::defaultInternalClass(engine);
+ Q_ASSERT(ctxt->internalClass && ctxt->internalClass->vtable);
+ ctxt->init();
return ctxt;
}
@@ -229,16 +230,20 @@ public:
V4_ASSERT_IS_TRIVIAL(typename ManagedType::Data)
size = align(size);
Heap::Base *o = allocData(size);
- o->setVtable(ManagedType::staticVTable());
+ InternalClass *ic = ManagedType::defaultInternalClass(engine);
+ ic = ic->changeVTable(ManagedType::staticVTable());
+ o->internalClass = ic;
+ Q_ASSERT(o->internalClass && o->internalClass->vtable);
return static_cast<typename ManagedType::Data *>(o);
}
template <typename ObjectType>
typename ObjectType::Data *allocateObject(InternalClass *ic)
{
- Heap::Object *o = allocObjectWithMemberData(align(sizeof(typename ObjectType::Data)), ic->size);
- o->setVtable(ObjectType::staticVTable());
+ Heap::Object *o = allocObjectWithMemberData(ObjectType::staticVTable(), ic->size);
o->internalClass = ic;
+ Q_ASSERT(o->internalClass && o->internalClass->vtable);
+ Q_ASSERT(ic->vtable == ObjectType::staticVTable());
return static_cast<typename ObjectType::Data *>(o);
}
@@ -246,11 +251,12 @@ public:
typename ObjectType::Data *allocateObject()
{
InternalClass *ic = ObjectType::defaultInternalClass(engine);
- Heap::Object *o = allocObjectWithMemberData(align(sizeof(typename ObjectType::Data)), ic->size);
- o->setVtable(ObjectType::staticVTable());
- Object *prototype = ObjectType::defaultPrototype(engine);
+ ic = ic->changeVTable(ObjectType::staticVTable());
+ ic = ic->changePrototype(ObjectType::defaultPrototype(engine)->d());
+ Heap::Object *o = allocObjectWithMemberData(ObjectType::staticVTable(), ic->size);
o->internalClass = ic;
- o->prototype.set(engine, prototype->d());
+ Q_ASSERT(o->internalClass && o->internalClass->vtable);
+ Q_ASSERT(o->internalClass->prototype == ObjectType::defaultPrototype(engine)->d());
return static_cast<typename ObjectType::Data *>(o);
}
@@ -258,8 +264,9 @@ public:
typename ManagedType::Data *allocWithStringData(std::size_t unmanagedSize, Arg1 arg1)
{
typename ManagedType::Data *o = reinterpret_cast<typename ManagedType::Data *>(allocString(unmanagedSize));
- o->setVtable(ManagedType::staticVTable());
- o->init(this, arg1);
+ o->internalClass = ManagedType::defaultInternalClass(engine);
+ Q_ASSERT(o->internalClass && o->internalClass->vtable);
+ o->init(arg1);
return o;
}
@@ -277,7 +284,8 @@ public:
{
Scope scope(engine);
Scoped<ObjectType> t(scope, allocateObject<ObjectType>(ic));
- t->d_unchecked()->prototype.set(engine, prototype->d());
+ Q_ASSERT(t->internalClass()->prototype == (prototype ? prototype->d() : 0));
+ Q_UNUSED(prototype);
t->d_unchecked()->init();
return t->d();
}
@@ -287,7 +295,8 @@ public:
{
Scope scope(engine);
Scoped<ObjectType> t(scope, allocateObject<ObjectType>(ic));
- t->d_unchecked()->prototype.set(engine, prototype->d());
+ Q_ASSERT(t->internalClass()->prototype == (prototype ? prototype->d() : 0));
+ Q_UNUSED(prototype);
t->d_unchecked()->init(arg1);
return t->d();
}
@@ -297,7 +306,8 @@ public:
{
Scope scope(engine);
Scoped<ObjectType> t(scope, allocateObject<ObjectType>(ic));
- t->d_unchecked()->prototype.set(engine, prototype->d());
+ Q_ASSERT(t->internalClass()->prototype == (prototype ? prototype->d() : 0));
+ Q_UNUSED(prototype);
t->d_unchecked()->init(arg1, arg2);
return t->d();
}
@@ -307,7 +317,8 @@ public:
{
Scope scope(engine);
Scoped<ObjectType> t(scope, allocateObject<ObjectType>(ic));
- t->d_unchecked()->prototype.set(engine, prototype->d());
+ Q_ASSERT(t->internalClass()->prototype == (prototype ? prototype->d() : 0));
+ Q_UNUSED(prototype);
t->d_unchecked()->init(arg1, arg2, arg3);
return t->d();
}
@@ -317,7 +328,8 @@ public:
{
Scope scope(engine);
Scoped<ObjectType> t(scope, allocateObject<ObjectType>(ic));
- t->d_unchecked()->prototype.set(engine, prototype->d());
+ Q_ASSERT(t->internalClass()->prototype == (prototype ? prototype->d() : 0));
+ Q_UNUSED(prototype);
t->d_unchecked()->init(arg1, arg2, arg3, arg4);
return t->d();
}
@@ -437,7 +449,7 @@ protected:
/// expects size to be aligned
Heap::Base *allocString(std::size_t unmanagedSize);
Heap::Base *allocData(std::size_t size);
- Heap::Object *allocObjectWithMemberData(std::size_t size, uint nMembers);
+ Heap::Object *allocObjectWithMemberData(const QV4::VTable *vtable, uint nMembers);
#ifdef DETAILED_MM_STATS
void willAllocate(std::size_t size);
diff --git a/src/qml/memory/qv4mmdefs_p.h b/src/qml/memory/qv4mmdefs_p.h
index bf29b44a2c..328797fb5e 100644
--- a/src/qml/memory/qv4mmdefs_p.h
+++ b/src/qml/memory/qv4mmdefs_p.h
@@ -186,7 +186,7 @@ struct Chunk {
return usedSlots;
}
- void sweep(ClassDestroyStatsCallback classCountPtr);
+ bool sweep(ClassDestroyStatsCallback classCountPtr);
void freeAll();
void resetBlackBits();
void collectGrayItems(QV4::MarkStack *markStack);
@@ -269,7 +269,7 @@ Q_STATIC_ASSERT(sizeof(HeapItem) == Chunk::SlotSize);
Q_STATIC_ASSERT(QT_POINTER_SIZE*8 == Chunk::Bits);
Q_STATIC_ASSERT((1 << Chunk::BitShift) == Chunk::Bits);
-struct MarkStack {\
+struct MarkStack {
MarkStack(ExecutionEngine *engine);
Heap::Base **top = 0;
Heap::Base **base = 0;
@@ -287,35 +287,6 @@ struct MarkStack {\
};
-// Base class for the execution engine
-
-#if defined(Q_CC_MSVC) || defined(Q_CC_GNU)
-#pragma pack(push, 1)
-#endif
-struct EngineBase {
- Heap::ExecutionContext *current = 0;
-
- Value *jsStackTop = 0;
- quint8 hasException = false;
- quint8 writeBarrierActive = false;
- quint16 unused = 0;
-#if QT_POINTER_SIZE == 8
- quint8 padding[4];
-#endif
- MemoryManager *memoryManager = 0;
- Runtime runtime;
-};
-#if defined(Q_CC_MSVC) || defined(Q_CC_GNU)
-#pragma pack(pop)
-#endif
-
-Q_STATIC_ASSERT(std::is_standard_layout<EngineBase>::value);
-Q_STATIC_ASSERT(offsetof(EngineBase, current) == 0);
-Q_STATIC_ASSERT(offsetof(EngineBase, jsStackTop) == offsetof(EngineBase, current) + QT_POINTER_SIZE);
-Q_STATIC_ASSERT(offsetof(EngineBase, hasException) == offsetof(EngineBase, jsStackTop) + QT_POINTER_SIZE);
-Q_STATIC_ASSERT(offsetof(EngineBase, memoryManager) == offsetof(EngineBase, hasException) + QT_POINTER_SIZE);
-Q_STATIC_ASSERT(offsetof(EngineBase, runtime) == offsetof(EngineBase, memoryManager) + QT_POINTER_SIZE);
-
// Some helper classes and macros to automate the generation of our
// tables used for marking objects
diff --git a/src/qml/memory/qv4writebarrier_p.h b/src/qml/memory/qv4writebarrier_p.h
index e36ea0749a..3182fd2aa9 100644
--- a/src/qml/memory/qv4writebarrier_p.h
+++ b/src/qml/memory/qv4writebarrier_p.h
@@ -149,6 +149,9 @@ struct HeapValue : Value {
void set(ExecutionEngine *e, const Value &newVal) {
WriteBarrier::write(e, base(), this, newVal);
}
+ void set(ExecutionEngine *e, Heap::Base *b) {
+ WriteBarrier::write(e, base(), this, b);
+ }
};
template <size_t offset>
diff --git a/src/qml/parser/qqmljslexer.cpp b/src/qml/parser/qqmljslexer.cpp
index 66f9eac126..53e67fde03 100644
--- a/src/qml/parser/qqmljslexer.cpp
+++ b/src/qml/parser/qqmljslexer.cpp
@@ -724,6 +724,11 @@ again:
return multilineStringLiteral ? T_MULTILINE_STRING_LITERAL : T_STRING_LITERAL;
} else if (_char == QLatin1Char('\\')) {
scanChar();
+ if (_codePtr > _endPtr) {
+ _errorCode = IllegalEscapeSequence;
+ _errorMessage = QCoreApplication::translate("QQmlParser", "End of file reached at escape sequence");
+ return T_ERROR;
+ }
QChar u;
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index 4a21acb050..d8779e0d12 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -449,6 +449,12 @@ The following functions are also on the Qt object.
\li \c "windows" - Windows
\li \c "winrt" - WinRT / UWP
\endlist
+
+ \row
+ \li \c platform.pluginName
+ \li This is the name of the platform set on the QGuiApplication instance
+ as returned by \l QGuiApplication::platformName()
+
\endtable
*/
diff --git a/src/qml/qml/qqmlglobal.cpp b/src/qml/qml/qqmlglobal.cpp
index 7939656107..6418812bae 100644
--- a/src/qml/qml/qqmlglobal.cpp
+++ b/src/qml/qml/qqmlglobal.cpp
@@ -343,6 +343,8 @@ QObject *QQmlGuiProvider::styleHints()
return o;
}
+QString QQmlGuiProvider::pluginName() const { return QString(); }
+
static QQmlGuiProvider *guiProvider = 0;
Q_QML_PRIVATE_EXPORT QQmlGuiProvider *QQml_setGuiProvider(QQmlGuiProvider *newProvider)
diff --git a/src/qml/qml/qqmlglobal_p.h b/src/qml/qml/qqmlglobal_p.h
index 707814e781..a6c113f5a7 100644
--- a/src/qml/qml/qqmlglobal_p.h
+++ b/src/qml/qml/qqmlglobal_p.h
@@ -311,6 +311,7 @@ public:
virtual QObject *styleHints();
virtual QStringList fontFamilies();
virtual bool openUrlExternally(QUrl &);
+ virtual QString pluginName() const;
};
Q_QML_PRIVATE_EXPORT QQmlGuiProvider *QQml_setGuiProvider(QQmlGuiProvider *);
diff --git a/src/qml/qml/qqmlplatform.cpp b/src/qml/qml/qqmlplatform.cpp
index 165cde5eb3..a8c402af2e 100644
--- a/src/qml/qml/qqmlplatform.cpp
+++ b/src/qml/qml/qqmlplatform.cpp
@@ -38,6 +38,7 @@
****************************************************************************/
#include "qqmlplatform_p.h"
+#include "qqmlglobal_p.h"
QT_BEGIN_NAMESPACE
@@ -78,6 +79,11 @@ QString QQmlPlatform::os()
#endif
}
+QString QQmlPlatform::pluginName() const
+{
+ return QQml_guiProvider()->pluginName();
+}
+
QT_END_NAMESPACE
#include "moc_qqmlplatform_p.cpp"
diff --git a/src/qml/qml/qqmlplatform_p.h b/src/qml/qml/qqmlplatform_p.h
index 6887720adb..6246ca7105 100644
--- a/src/qml/qml/qqmlplatform_p.h
+++ b/src/qml/qml/qqmlplatform_p.h
@@ -61,12 +61,14 @@ class Q_QML_PRIVATE_EXPORT QQmlPlatform : public QObject
{
Q_OBJECT
Q_PROPERTY(QString os READ os CONSTANT)
+ Q_PROPERTY(QString pluginName READ pluginName CONSTANT)
public:
explicit QQmlPlatform(QObject *parent = 0);
virtual ~QQmlPlatform();
static QString os();
+ QString pluginName() const;
private:
Q_DISABLE_COPY(QQmlPlatform)
diff --git a/src/qml/qml/qqmlpropertycache.cpp b/src/qml/qml/qqmlpropertycache.cpp
index 88ce2fa1b9..d18159841c 100644
--- a/src/qml/qml/qqmlpropertycache.cpp
+++ b/src/qml/qml/qqmlpropertycache.cpp
@@ -970,8 +970,11 @@ int QQmlPropertyCache::originalClone(QObject *object, int index)
QQmlData *data = QQmlData::get(object, false);
if (data && data->propertyCache) {
QQmlPropertyCache *cache = data->propertyCache;
- while (cache->signal(index)->isCloned())
+ QQmlPropertyData *sig = cache->signal(index);
+ while (sig && sig->isCloned()) {
--index;
+ sig = cache->signal(index);
+ }
} else {
while (QMetaObjectPrivate::signal(object->metaObject(), index).attributes() & QMetaMethod::Cloned)
--index;
diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp
index 40bd2e5020..e4293596d8 100644
--- a/src/qml/qml/qqmltypeloader.cpp
+++ b/src/qml/qml/qqmltypeloader.cpp
@@ -1320,8 +1320,8 @@ bool QQmlTypeLoader::Blob::fetchQmldir(const QUrl &url, const QV4::CompiledData:
{
QQmlQmldirData *data = typeLoader()->getQmldir(url);
- data->setImport(import);
- data->setPriority(priority);
+ data->setImport(this, import);
+ data->setPriority(this, priority);
if (data->status() == Error) {
// This qmldir must not exist - which is not an error
@@ -1349,7 +1349,7 @@ bool QQmlTypeLoader::Blob::updateQmldir(QQmlQmldirData *data, const QV4::Compile
QHash<const QV4::CompiledData::Import *, int>::iterator it = m_unresolvedImports.find(import);
if (it != m_unresolvedImports.end()) {
- *it = data->priority();
+ *it = data->priority(this);
}
// Release this reference at destruction
@@ -1482,7 +1482,7 @@ void QQmlTypeLoader::Blob::dependencyComplete(QQmlDataBlob *blob)
if (blob->type() == QQmlDataBlob::QmldirFile) {
QQmlQmldirData *data = static_cast<QQmlQmldirData *>(blob);
- const QV4::CompiledData::Import *import = data->import();
+ const QV4::CompiledData::Import *import = data->import(this);
QList<QQmlError> errors;
if (!qmldirDataAvailable(data, &errors)) {
@@ -1506,11 +1506,11 @@ bool QQmlTypeLoader::Blob::qmldirDataAvailable(QQmlQmldirData *data, QList<QQmlE
{
bool resolve = true;
- const QV4::CompiledData::Import *import = data->import();
- data->setImport(0);
+ const QV4::CompiledData::Import *import = data->import(this);
+ data->setImport(this, 0);
- int priority = data->priority();
- data->setPriority(0);
+ int priority = data->priority(this);
+ data->setPriority(this, 0);
if (import) {
// Do we need to resolve this import?
@@ -3069,7 +3069,7 @@ void QQmlScriptBlob::initializeFromCompilationUnit(QV4::CompiledData::Compilatio
}
QQmlQmldirData::QQmlQmldirData(const QUrl &url, QQmlTypeLoader *loader)
-: QQmlTypeLoader::Blob(url, QmldirFile, loader), m_import(0), m_priority(0)
+: QQmlTypeLoader::Blob(url, QmldirFile, loader)
{
}
@@ -3078,24 +3078,31 @@ const QString &QQmlQmldirData::content() const
return m_content;
}
-const QV4::CompiledData::Import *QQmlQmldirData::import() const
+const QV4::CompiledData::Import *QQmlQmldirData::import(QQmlTypeLoader::Blob *blob) const
{
- return m_import;
+ QHash<QQmlTypeLoader::Blob *, const QV4::CompiledData::Import *>::const_iterator it =
+ m_imports.find(blob);
+ if (it == m_imports.end())
+ return 0;
+ return *it;
}
-void QQmlQmldirData::setImport(const QV4::CompiledData::Import *import)
+void QQmlQmldirData::setImport(QQmlTypeLoader::Blob *blob, const QV4::CompiledData::Import *import)
{
- m_import = import;
+ m_imports[blob] = import;
}
-int QQmlQmldirData::priority() const
+int QQmlQmldirData::priority(QQmlTypeLoader::Blob *blob) const
{
- return m_priority;
+ QHash<QQmlTypeLoader::Blob *, int>::const_iterator it = m_priorities.find(blob);
+ if (it == m_priorities.end())
+ return 0;
+ return *it;
}
-void QQmlQmldirData::setPriority(int priority)
+void QQmlQmldirData::setPriority(QQmlTypeLoader::Blob *blob, int priority)
{
- m_priority = priority;
+ m_priorities[blob] = priority;
}
void QQmlQmldirData::dataReceived(const SourceCodeData &data)
diff --git a/src/qml/qml/qqmltypeloader_p.h b/src/qml/qml/qqmltypeloader_p.h
index 48e7d5cba4..f367fa6f58 100644
--- a/src/qml/qml/qqmltypeloader_p.h
+++ b/src/qml/qml/qqmltypeloader_p.h
@@ -572,11 +572,11 @@ private:
public:
const QString &content() const;
- const QV4::CompiledData::Import *import() const;
- void setImport(const QV4::CompiledData::Import *);
+ const QV4::CompiledData::Import *import(QQmlTypeLoader::Blob *) const;
+ void setImport(QQmlTypeLoader::Blob *, const QV4::CompiledData::Import *);
- int priority() const;
- void setPriority(int);
+ int priority(QQmlTypeLoader::Blob *) const;
+ void setPriority(QQmlTypeLoader::Blob *, int);
protected:
void dataReceived(const SourceCodeData &) override;
@@ -584,8 +584,8 @@ protected:
private:
QString m_content;
- const QV4::CompiledData::Import *m_import;
- int m_priority;
+ QHash<QQmlTypeLoader::Blob *, const QV4::CompiledData::Import *> m_imports;
+ QHash<QQmlTypeLoader::Blob *, int> m_priorities;
};
diff --git a/src/qml/qml/qqmlvmemetaobject.cpp b/src/qml/qml/qqmlvmemetaobject.cpp
index 9f86d1cae9..a2ab9bdfed 100644
--- a/src/qml/qml/qqmlvmemetaobject.cpp
+++ b/src/qml/qml/qqmlvmemetaobject.cpp
@@ -105,7 +105,7 @@ void QQmlVMEVariantQObjectPtr::objectDestroyed(QObject *)
QV4::Scope scope(v4);
QV4::Scoped<QV4::MemberData> sp(scope, m_target->propertyAndMethodStorage.value());
if (sp) {
- QV4::MemberData::Index index{ sp->d(), static_cast<uint>(m_index) };
+ QV4::MemberData::Index index{ sp->d(), sp->d()->values.values + m_index };
index.set(v4, QV4::Primitive::nullValue());
}
}
diff --git a/src/qml/qml/qqmlxmlhttprequest.cpp b/src/qml/qml/qqmlxmlhttprequest.cpp
index b18904fc73..9e8735cbc6 100644
--- a/src/qml/qml/qqmlxmlhttprequest.cpp
+++ b/src/qml/qml/qqmlxmlhttprequest.cpp
@@ -895,7 +895,7 @@ ReturnedValue NamedNodeMap::get(const Managed *m, String *name, bool *hasPropert
const NamedNodeMap *r = static_cast<const NamedNodeMap *>(m);
QV4::ExecutionEngine *v4 = r->engine();
- name->makeIdentifier(v4);
+ name->makeIdentifier();
if (name->equals(v4->id_length()))
return Primitive::fromInt32(r->d()->list().count()).asReturnedValue();
@@ -940,7 +940,7 @@ ReturnedValue NodeList::get(const Managed *m, String *name, bool *hasProperty)
const NodeList *r = static_cast<const NodeList *>(m);
QV4::ExecutionEngine *v4 = r->engine();
- name->makeIdentifier(v4);
+ name->makeIdentifier();
if (name->equals(v4->id_length()))
return Primitive::fromInt32(r->d()->d->children.count()).asReturnedValue();
diff --git a/src/qml/qtqmlglobal.h b/src/qml/qtqmlglobal.h
index 6704e55b52..387c28a945 100644
--- a/src/qml/qtqmlglobal.h
+++ b/src/qml/qtqmlglobal.h
@@ -40,18 +40,20 @@
#ifndef QTQMLGLOBAL_H
#define QTQMLGLOBAL_H
+#if defined(QT_BUILD_QMLDEVTOOLS_LIB) || defined(QT_QMLDEVTOOLS_LIB)
+# define QT_QML_BOOTSTRAPPED
+#endif
+
#include <QtCore/qglobal.h>
-#include <QtQml/qtqml-config.h>
-#if QT_CONFIG(qml_network)
-#include <QtNetwork/qtnetworkglobal.h>
+#ifndef QT_QML_BOOTSTRAPPED
+# include <QtQml/qtqml-config.h>
+# if QT_CONFIG(qml_network)
+# include <QtNetwork/qtnetworkglobal.h>
+# endif
#endif
QT_BEGIN_NAMESPACE
-#if defined(QT_BUILD_QMLDEVTOOLS_LIB) || defined(QT_QMLDEVTOOLS_LIB)
-# define QT_QML_BOOTSTRAPPED
-#endif
-
#if !defined(QT_QML_BOOTSTRAPPED) && !defined(QT_STATIC)
# if defined(QT_BUILD_QML_LIB)
# define Q_QML_EXPORT Q_DECL_EXPORT
diff --git a/src/qml/qtqmlglobal_p.h b/src/qml/qtqmlglobal_p.h
index 6547274d09..4c0ba338d8 100644
--- a/src/qml/qtqmlglobal_p.h
+++ b/src/qml/qtqmlglobal_p.h
@@ -52,49 +52,17 @@
//
#include <QtCore/private/qglobal_p.h>
-#include <QtQml/private/qtqml-config_p.h>
#include <QtQml/qtqmlglobal.h>
+#ifndef QT_QML_BOOTSTRAPPED
+# include <QtQml/private/qtqml-config_p.h>
+#endif
-// Define Q_ALLOCA_VAR macro to be used instead of #ifdeffing
-// the occurrences of alloca() in case it's not supported.
-// Q_ALLOCA_DECLARE and Q_ALLOCA_ASSIGN macros separate
-// memory allocation from the declaration and RAII.
-#define Q_ALLOCA_VAR(type, name, size) \
- Q_ALLOCA_DECLARE(type, name); \
- Q_ALLOCA_ASSIGN(type, name, size)
-
-#if defined(QT_BOOTSTRAPPED) || QT_CONFIG(alloca)
-
-#define Q_ALLOCA_DECLARE(type, name) \
- type *name = 0
-
-#define Q_ALLOCA_ASSIGN(type, name, size) \
- name = static_cast<type*>(alloca(size))
+#define Q_QML_PRIVATE_EXPORT Q_QML_EXPORT
+#if !defined(QT_QMLDEVTOOLS_LIB) && !defined(QT_BUILD_QMLDEVTOOLS_LIB)
+# define Q_QML_AUTOTEST_EXPORT Q_AUTOTEST_EXPORT
#else
-QT_BEGIN_NAMESPACE
-class Qt_AllocaWrapper
-{
-public:
- Qt_AllocaWrapper() { m_data = 0; }
- ~Qt_AllocaWrapper() { free(m_data); }
- void *data() { return m_data; }
- void allocate(int size) { m_data = malloc(size); }
-private:
- void *m_data;
-};
-QT_END_NAMESPACE
-
-#define Q_ALLOCA_DECLARE(type, name) \
- Qt_AllocaWrapper _qt_alloca_##name; \
- type *name = 0
-
-#define Q_ALLOCA_ASSIGN(type, name, size) \
- _qt_alloca_##name.allocate(size); \
- name = static_cast<type*>(_qt_alloca_##name.data())
-
+# define Q_QML_AUTOTEST_EXPORT
#endif
-#define Q_QML_PRIVATE_EXPORT Q_QML_EXPORT
-
#endif // QTQMLGLOBAL_P_H
diff --git a/src/qml/types/qqmlconnections.cpp b/src/qml/types/qqmlconnections.cpp
index 6e9cb5f1fe..e218cdcfe4 100644
--- a/src/qml/types/qqmlconnections.cpp
+++ b/src/qml/types/qqmlconnections.cpp
@@ -286,6 +286,7 @@ void QQmlConnections::connectSignals()
int signalIndex = QQmlPropertyPrivate::get(prop)->signalIndex();
QQmlBoundSignal *signal =
new QQmlBoundSignal(target, signalIndex, this, qmlEngine(this));
+ signal->setEnabled(d->enabled);
QQmlBoundSignalExpression *expression = ctxtdata ?
new QQmlBoundSignalExpression(target, signalIndex,
diff --git a/src/qml/types/qqmllistmodel.cpp b/src/qml/types/qqmllistmodel.cpp
index 44d968fd46..517411fa47 100644
--- a/src/qml/types/qqmllistmodel.cpp
+++ b/src/qml/types/qqmllistmodel.cpp
@@ -1076,6 +1076,7 @@ void ListElement::sync(ListElement *src, ListLayout *srcLayout, ListElement *tar
QVariant v = src->getProperty(srcRole, 0, 0);
target->setVariantProperty(targetRole, v);
}
+ break;
case ListLayout::Role::VariantMap:
{
QVariantMap *map = src->getVariantMapProperty(srcRole);
diff --git a/src/qml/util/qqmladaptormodel.cpp b/src/qml/util/qqmladaptormodel.cpp
index c77495a1a7..b9f6ea461a 100644
--- a/src/qml/util/qqmladaptormodel.cpp
+++ b/src/qml/util/qqmladaptormodel.cpp
@@ -61,14 +61,13 @@ public:
V4_DEFINE_EXTENSION(QQmlAdaptorModelEngineData, engineData)
-static QV4::ReturnedValue get_index(QV4::CallContext *ctx)
+static void get_index(const QV4::BuiltinFunction *, QV4::Scope &scope, QV4::CallData *callData)
{
- QV4::Scope scope(ctx);
- QV4::Scoped<QQmlDelegateModelItemObject> o(scope, ctx->thisObject().as<QQmlDelegateModelItemObject>());
+ QV4::Scoped<QQmlDelegateModelItemObject> o(scope, callData->thisObject.as<QQmlDelegateModelItemObject>());
if (!o)
- return ctx->engine()->throwTypeError(QStringLiteral("Not a valid VisualData object"));
+ RETURN_RESULT(scope.engine->throwTypeError(QStringLiteral("Not a valid VisualData object")));
- return QV4::Encode(o->d()->item->index);
+ RETURN_RESULT(QV4::Encode(o->d()->item->index));
}
template <typename T, typename M> static void setModelDataType(QMetaObjectBuilder *builder, M *metaType)
@@ -195,19 +194,18 @@ public:
dataType->watchedRoles += newRoles;
}
- static QV4::ReturnedValue get_hasModelChildren(QV4::CallContext *ctx)
+ static void get_hasModelChildren(const QV4::BuiltinFunction *, QV4::Scope &scope, QV4::CallData *callData)
{
- QV4::Scope scope(ctx);
- QV4::Scoped<QQmlDelegateModelItemObject> o(scope, ctx->thisObject().as<QQmlDelegateModelItemObject>());
+ QV4::Scoped<QQmlDelegateModelItemObject> o(scope, callData->thisObject.as<QQmlDelegateModelItemObject>());
if (!o)
- return ctx->engine()->throwTypeError(QStringLiteral("Not a valid VisualData object"));
+ RETURN_RESULT(scope.engine->throwTypeError(QStringLiteral("Not a valid VisualData object")));
const QQmlAdaptorModel *const model = static_cast<QQmlDMCachedModelData *>(o->d()->item)->type->model;
if (o->d()->item->index >= 0 && *model) {
const QAbstractItemModel * const aim = model->aim();
- return QV4::Encode(aim->hasChildren(aim->index(o->d()->item->index, 0, model->rootIndex)));
+ RETURN_RESULT(QV4::Encode(aim->hasChildren(aim->index(o->d()->item->index, 0, model->rootIndex))));
} else {
- return QV4::Encode(false);
+ RETURN_RESULT(QV4::Encode(false));
}
}
@@ -583,27 +581,25 @@ public:
}
}
- static QV4::ReturnedValue get_modelData(QV4::CallContext *ctx)
+ static void get_modelData(const QV4::BuiltinFunction *, QV4::Scope &scope, QV4::CallData *callData)
{
- QV4::Scope scope(ctx);
- QV4::Scoped<QQmlDelegateModelItemObject> o(scope, ctx->thisObject().as<QQmlDelegateModelItemObject>());
+ QV4::Scoped<QQmlDelegateModelItemObject> o(scope, callData->thisObject.as<QQmlDelegateModelItemObject>());
if (!o)
- return ctx->engine()->throwTypeError(QStringLiteral("Not a valid VisualData object"));
+ RETURN_RESULT(scope.engine->throwTypeError(QStringLiteral("Not a valid VisualData object")));
- return scope.engine->fromVariant(static_cast<QQmlDMListAccessorData *>(o->d()->item)->cachedData);
+ RETURN_RESULT(scope.engine->fromVariant(static_cast<QQmlDMListAccessorData *>(o->d()->item)->cachedData));
}
- static QV4::ReturnedValue set_modelData(QV4::CallContext *ctx)
+ static void set_modelData(const QV4::BuiltinFunction *, QV4::Scope &scope, QV4::CallData *callData)
{
- QV4::Scope scope(ctx);
- QV4::Scoped<QQmlDelegateModelItemObject> o(scope, ctx->thisObject().as<QQmlDelegateModelItemObject>());
+ QV4::Scoped<QQmlDelegateModelItemObject> o(scope, callData->thisObject.as<QQmlDelegateModelItemObject>());
if (!o)
- return ctx->engine()->throwTypeError(QStringLiteral("Not a valid VisualData object"));
- if (!ctx->argc())
- return ctx->engine()->throwTypeError();
+ RETURN_RESULT(scope.engine->throwTypeError(QStringLiteral("Not a valid VisualData object")));
+ if (!callData->argc)
+ RETURN_RESULT(scope.engine->throwTypeError());
- static_cast<QQmlDMListAccessorData *>(o->d()->item)->setModelData(scope.engine->toVariant(ctx->args()[0], QVariant::Invalid));
- return QV4::Encode::undefined();
+ static_cast<QQmlDMListAccessorData *>(o->d()->item)->setModelData(scope.engine->toVariant(callData->args[0], QVariant::Invalid));
+ RETURN_RESULT(QV4::Encode::undefined());
}
QV4::ReturnedValue get() override
diff --git a/src/quick/configure.json b/src/quick/configure.json
index 047fa8c948..65ad5b810b 100644
--- a/src/quick/configure.json
+++ b/src/quick/configure.json
@@ -34,7 +34,8 @@
"features": {
"d3d12": {
"label": "Direct3D 12",
- "purpose": "Provides a Direct3D 12 backend for the Qt Quick Scenegraph",
+ "purpose": "Provides a Direct3D 12 backend for the scenegraph.",
+ "section": "Qt Quick",
"condition": "tests.d3d12",
"output": [
"publicFeature"
@@ -42,7 +43,8 @@
},
"quick-animatedimage": {
"label": "AnimatedImage item",
- "purpose": "Provides the Qt Quick AnimatedImage Item",
+ "purpose": "Provides the AnimatedImage item.",
+ "section": "Qt Quick",
"condition": "features.movie",
"output": [
"privateFeature"
@@ -50,29 +52,33 @@
},
"quick-canvas": {
"label": "Canvas item",
- "purpose": "Provides the Qt Quick Canvas Item",
+ "purpose": "Provides the Canvas item.",
+ "section": "Qt Quick",
"condition": "features.quick-path",
"output": [
"privateFeature"
]
},
"quick-designer": {
- "label": "Support for Quick Designer",
- "purpose": "Provides support for the Qt Quick Designer in Qt Creator",
+ "label": "Support for Qt Quick Designer",
+ "purpose": "Provides support for the Qt Quick Designer in Qt Creator.",
+ "section": "Qt Quick",
"output": [
"privateFeature"
]
},
"quick-flipable": {
"label": "Flipable item",
- "purpose": "Provides the Qt Quick Flipable Item",
+ "purpose": "Provides the Flipable item.",
+ "section": "Qt Quick",
"output": [
"privateFeature"
]
},
"quick-gridview": {
"label": "GridView item",
- "purpose": "Provides the Qt Quick GridView item",
+ "purpose": "Provides the GridView item.",
+ "section": "Qt Quick",
"output": [
"privateFeature"
]
@@ -93,14 +99,16 @@
},
"quick-listview": {
"label": "ListView item",
- "purpose": "Provides the Qt Quick ListView item",
+ "purpose": "Provides the ListView item.",
+ "section": "Qt Quick",
"output": [
"privateFeature"
]
},
"quick-particles": {
"label": "Particle support",
- "purpose": "Provides a particle system for Qt Quick",
+ "purpose": "Provides a particle system.",
+ "section": "Qt Quick",
"condition": "features.quick-shadereffect && features.quick-sprite && features.opengl",
"output": [
"privateFeature"
@@ -108,14 +116,16 @@
},
"quick-path": {
"label": "Path support",
- "purpose": "Provides Path elements in Qt Quick",
+ "purpose": "Provides Path elements.",
+ "section": "Qt Quick",
"output": [
"privateFeature"
]
},
"quick-pathview": {
"label": "PathView item",
- "purpose": "Provides the Qt Quick PathView item",
+ "purpose": "Provides the PathView item.",
+ "section": "Qt Quick",
"condition": "features.quick-path",
"output": [
"privateFeature"
@@ -123,21 +133,24 @@
},
"quick-positioners": {
"label": "Positioner items",
- "purpose": "Provides Positioner items in Qt Quick",
+ "purpose": "Provides Positioner items.",
+ "section": "Qt Quick",
"output": [
"privateFeature"
]
},
"quick-shadereffect": {
"label": "ShaderEffect item",
- "purpose": "Provides Shader effects in Qt Quick",
+ "purpose": "Provides Shader effects.",
+ "section": "Qt Quick",
"output": [
"privateFeature"
]
},
"quick-sprite": {
"label": "Sprite item",
- "purpose": "Provides the Qt Quick Sprite Item",
+ "purpose": "Provides the Sprite item.",
+ "section": "Qt Quick",
"output": [
"privateFeature"
]
diff --git a/src/quick/designer/qquickdesignersupportitems.cpp b/src/quick/designer/qquickdesignersupportitems.cpp
index 2003b484ad..874faed0af 100644
--- a/src/quick/designer/qquickdesignersupportitems.cpp
+++ b/src/quick/designer/qquickdesignersupportitems.cpp
@@ -47,6 +47,7 @@
#include <private/qquicktextinput_p.h>
#include <private/qquicktextedit_p.h>
#include <private/qquicktransition_p.h>
+#include <private/qquickloader_p.h>
#include <private/qquickanimation_p.h>
#include <private/qqmlmetatype_p.h>
@@ -79,6 +80,12 @@ static void stopAnimation(QObject *object)
}
}
+static void makeLoaderSynchronous(QObject *object)
+{
+ if (QQuickLoader *loader = qobject_cast<QQuickLoader*>(object))
+ loader->setAsynchronous(false);
+}
+
static void allSubObjects(QObject *object, QObjectList &objectList)
{
// don't add null pointer and stop if the object is already in the list
@@ -137,6 +144,7 @@ void QQuickDesignerSupportItems::tweakObjects(QObject *object)
allSubObjects(object, objectList);
for (QObject* childObject : qAsConst(objectList)) {
stopAnimation(childObject);
+ makeLoaderSynchronous(childObject);
if (fixResourcePathsForObjectCallBack)
fixResourcePathsForObjectCallBack(childObject);
}
diff --git a/src/quick/doc/src/concepts/visualcanvas/adaptations.qdoc b/src/quick/doc/src/concepts/visualcanvas/adaptations.qdoc
index 76f863d07f..bcfdf311af 100644
--- a/src/quick/doc/src/concepts/visualcanvas/adaptations.qdoc
+++ b/src/quick/doc/src/concepts/visualcanvas/adaptations.qdoc
@@ -73,7 +73,7 @@ adaptations.
The default adaptation capable of providing the full Qt Quick 2 feature
set is the OpenGL adaptation. All of the details of the OpenGL
-adpatation can are available here:
+adaptation can are available here:
\l{qtquick-visualcanvas-scenegraph-renderer.html}{OpenGL Adaptation}
\section1 Software Adaptation
diff --git a/src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc b/src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc
index 2e41c85873..cb14c72b04 100644
--- a/src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc
+++ b/src/quick/doc/src/concepts/visualcanvas/scenegraph.qdoc
@@ -32,7 +32,7 @@
\section1 The Scene Graph in Qt Quick
Qt Quick 2 makes use of a dedicated scene graph based and a series of
-adpatations of which the default uses OpenGL ES 2.0 or OpenGL 2.0 for
+adaptations of which the default uses OpenGL ES 2.0 or OpenGL 2.0 for
its rendering. Using a scene graph for graphics rather than the
traditional imperative painting systems (QPainter and
similar), means the scene to be rendered can be retained between
diff --git a/src/quick/doc/src/concepts/visualcanvas/topic.qdoc b/src/quick/doc/src/concepts/visualcanvas/topic.qdoc
index 168c616d06..f6b4024f7a 100644
--- a/src/quick/doc/src/concepts/visualcanvas/topic.qdoc
+++ b/src/quick/doc/src/concepts/visualcanvas/topic.qdoc
@@ -57,7 +57,7 @@ See the documentation about the \l{qtquick-visualcanvas-visualparent.html}
Modern computer systems and devices use graphics processing units or GPUs to
render graphics. Qt Quick can leverage this graphics hardware by using graphics
-APIs like OpenGL. The default graphics adpatation for Qt Quick requires OpenGL and
+APIs like OpenGL. The default graphics adaptation for Qt Quick requires OpenGL and
it is used to display applications developed with Qt Quick in QML. In particular,
Qt Quick defines a scene graph which is then rendered. See the documentation about the
\l{qtquick-visualcanvas-scenegraph.html}{Scene Graph} for in-depth information about
diff --git a/src/quick/items/qquickanimatedimage_p.h b/src/quick/items/qquickanimatedimage_p.h
index 143fe8904d..54da093259 100644
--- a/src/quick/items/qquickanimatedimage_p.h
+++ b/src/quick/items/qquickanimatedimage_p.h
@@ -97,7 +97,6 @@ Q_SIGNALS:
void playingChanged();
void pausedChanged();
void frameChanged();
- void sourceSizeChanged();
private Q_SLOTS:
void movieUpdate();
diff --git a/src/quick/items/qquickevents.cpp b/src/quick/items/qquickevents.cpp
index ac0505da82..448b63c347 100644
--- a/src/quick/items/qquickevents.cpp
+++ b/src/quick/items/qquickevents.cpp
@@ -861,8 +861,9 @@ QTouchEvent *QQuickPointerTouchEvent::touchEventForItem(QQuickItem *item, bool i
}
parent = parent->parentItem();
}
- bool filterRelevant = isFiltering && grabberIsChild;
+ // when filtering, send points that are grabbed by a child and points that are not grabbed but inside
+ bool filterRelevant = isFiltering && (grabberIsChild || (!p->grabber() && item->contains(item->mapFromScene(p->scenePos()))));
if (!(isGrabber || isPressInside || filterRelevant))
continue;
diff --git a/src/quick/items/qquickevents_p_p.h b/src/quick/items/qquickevents_p_p.h
index cf6f83e5b1..3735d68a85 100644
--- a/src/quick/items/qquickevents_p_p.h
+++ b/src/quick/items/qquickevents_p_p.h
@@ -332,9 +332,9 @@ class Q_QUICK_PRIVATE_EXPORT QQuickPointerEvent : public QObject
Q_PROPERTY(Qt::MouseButtons buttons READ buttons)
public:
- QQuickPointerEvent(QObject *parent = nullptr)
+ QQuickPointerEvent(QObject *parent = nullptr, QQuickPointerDevice *device = nullptr)
: QObject(parent)
- , m_device(nullptr)
+ , m_device(device)
, m_event(nullptr)
, m_button(Qt::NoButton)
, m_pressedButtons(Qt::NoButton)
@@ -385,8 +385,8 @@ class Q_QUICK_PRIVATE_EXPORT QQuickPointerMouseEvent : public QQuickPointerEvent
{
Q_OBJECT
public:
- QQuickPointerMouseEvent(QObject *parent = nullptr)
- : QQuickPointerEvent(parent), m_mousePoint(new QQuickEventPoint(this)) { }
+ QQuickPointerMouseEvent(QObject *parent = nullptr, QQuickPointerDevice *device = nullptr)
+ : QQuickPointerEvent(parent, device), m_mousePoint(new QQuickEventPoint(this)) { }
QQuickPointerEvent *reset(QEvent *) override;
bool isPressEvent() const override;
@@ -411,8 +411,8 @@ class Q_QUICK_PRIVATE_EXPORT QQuickPointerTouchEvent : public QQuickPointerEvent
{
Q_OBJECT
public:
- QQuickPointerTouchEvent(QObject *parent = nullptr)
- : QQuickPointerEvent(parent)
+ QQuickPointerTouchEvent(QObject *parent = nullptr, QQuickPointerDevice *device = nullptr)
+ : QQuickPointerEvent(parent, device)
, m_pointCount(0)
, m_synthMouseEvent(QEvent::MouseMove, QPointF(), Qt::NoButton, Qt::NoButton, Qt::NoModifier)
{ }
@@ -500,18 +500,10 @@ public:
QQuickPointerDevice(DeviceType devType, PointerType pType, Capabilities caps, int maxPoints, int buttonCount, const QString &name, qint64 uniqueId = 0)
: m_deviceType(devType), m_pointerType(pType), m_capabilities(caps)
, m_maximumTouchPoints(maxPoints), m_buttonCount(buttonCount), m_name(name)
- , m_uniqueId(QPointingDeviceUniqueId::fromNumericId(uniqueId)), m_event(nullptr)
+ , m_uniqueId(QPointingDeviceUniqueId::fromNumericId(uniqueId))
{
- if (m_deviceType == Mouse) {
- m_event = new QQuickPointerMouseEvent;
- } else if (m_deviceType == TouchScreen || m_deviceType == TouchPad) {
- m_event = new QQuickPointerTouchEvent;
- } else {
- Q_ASSERT(false);
- }
}
- ~QQuickPointerDevice() { delete m_event; }
DeviceType type() const { return m_deviceType; }
PointerType pointerType() const { return m_pointerType; }
Capabilities capabilities() const { return m_capabilities; }
@@ -520,7 +512,6 @@ public:
int buttonCount() const { return m_buttonCount; }
QString name() const { return m_name; }
QPointingDeviceUniqueId uniqueId() const { return m_uniqueId; }
- QQuickPointerEvent *pointerEvent() const { return m_event; }
static QQuickPointerDevice *touchDevice(QTouchDevice *d);
static QList<QQuickPointerDevice *> touchDevices();
@@ -535,8 +526,6 @@ private:
int m_buttonCount;
QString m_name;
QPointingDeviceUniqueId m_uniqueId;
- // the device-specific event instance which is reused during event delivery
- QQuickPointerEvent *m_event;
Q_DISABLE_COPY(QQuickPointerDevice)
};
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index 4e52109582..a8a862bb2f 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -146,8 +146,8 @@ QQuickTransform::QQuickTransform(QQuickTransformPrivate &dd, QObject *parent)
QQuickTransform::~QQuickTransform()
{
Q_D(QQuickTransform);
- for (QQuickItem *item : qAsConst(d->items)) {
- QQuickItemPrivate *p = QQuickItemPrivate::get(item);
+ for (int ii = 0; ii < d->items.count(); ++ii) {
+ QQuickItemPrivate *p = QQuickItemPrivate::get(d->items.at(ii));
p->transforms.removeOne(this);
p->dirty(QQuickItemPrivate::Transform);
}
@@ -156,8 +156,8 @@ QQuickTransform::~QQuickTransform()
void QQuickTransform::update()
{
Q_D(QQuickTransform);
- for (QQuickItem *item : qAsConst(d->items)) {
- QQuickItemPrivate *p = QQuickItemPrivate::get(item);
+ for (int ii = 0; ii < d->items.count(); ++ii) {
+ QQuickItemPrivate *p = QQuickItemPrivate::get(d->items.at(ii));
p->dirty(QQuickItemPrivate::Transform);
}
}
@@ -169,7 +169,9 @@ QQuickContents::QQuickContents(QQuickItem *item)
QQuickContents::~QQuickContents()
{
- for (QQuickItem *child : m_item->childItems()) {
+ QList<QQuickItem *> children = m_item->childItems();
+ for (int i = 0; i < children.count(); ++i) {
+ QQuickItem *child = children.at(i);
QQuickItemPrivate::get(child)->removeItemChangeListener(this, QQuickItemPrivate::Geometry | QQuickItemPrivate::Destroyed);
}
}
@@ -192,8 +194,9 @@ bool QQuickContents::calcHeight(QQuickItem *changed)
} else {
qreal top = std::numeric_limits<qreal>::max();
qreal bottom = -std::numeric_limits<qreal>::max();
- const QList<QQuickItem*> children = m_item->childItems();
- for (QQuickItem *child : qAsConst(children)) {
+ QList<QQuickItem *> children = m_item->childItems();
+ for (int i = 0; i < children.count(); ++i) {
+ QQuickItem *child = children.at(i);
qreal y = child->y();
if (y + child->height() > bottom)
bottom = y + child->height();
@@ -226,8 +229,9 @@ bool QQuickContents::calcWidth(QQuickItem *changed)
} else {
qreal left = std::numeric_limits<qreal>::max();
qreal right = -std::numeric_limits<qreal>::max();
- const QList<QQuickItem*> children = m_item->childItems();
- for (QQuickItem *child : qAsConst(children)) {
+ QList<QQuickItem *> children = m_item->childItems();
+ for (int i = 0; i < children.count(); ++i) {
+ QQuickItem *child = children.at(i);
qreal x = child->x();
if (x + child->width() > right)
right = x + child->width();
@@ -246,7 +250,9 @@ void QQuickContents::complete()
{
QQuickItemPrivate::get(m_item)->addItemChangeListener(this, QQuickItemPrivate::Children);
- for (QQuickItem *child : m_item->childItems()) {
+ QList<QQuickItem *> children = m_item->childItems();
+ for (int i = 0; i < children.count(); ++i) {
+ QQuickItem *child = children.at(i);
QQuickItemPrivate::get(child)->addItemChangeListener(this, QQuickItemPrivate::Geometry | QQuickItemPrivate::Destroyed);
//###what about changes to visibility?
}
@@ -1347,7 +1353,8 @@ void QQuickKeysAttached::componentComplete()
#if QT_CONFIG(im)
Q_D(QQuickKeysAttached);
if (d->item) {
- for (QQuickItem *targetItem : qAsConst(d->targets)) {
+ for (int ii = 0; ii < d->targets.count(); ++ii) {
+ QQuickItem *targetItem = d->targets.at(ii);
if (targetItem && (targetItem->flags() & QQuickItem::ItemAcceptsInputMethod)) {
d->item->setFlag(QQuickItem::ItemAcceptsInputMethod);
break;
@@ -1369,10 +1376,11 @@ void QQuickKeysAttached::keyPressed(QKeyEvent *event, bool post)
// first process forwards
if (d->item && d->item->window()) {
d->inPress = true;
- for (QQuickItem *targetItem : qAsConst(d->targets)) {
- if (targetItem && targetItem->isVisible()) {
+ for (int ii = 0; ii < d->targets.count(); ++ii) {
+ QQuickItem *i = d->targets.at(ii);
+ if (i && i->isVisible()) {
event->accept();
- QCoreApplication::sendEvent(targetItem, event);
+ QCoreApplication::sendEvent(i, event);
if (event->isAccepted()) {
d->inPress = false;
return;
@@ -1412,10 +1420,11 @@ void QQuickKeysAttached::keyReleased(QKeyEvent *event, bool post)
if (d->item && d->item->window()) {
d->inRelease = true;
- for (QQuickItem *targetItem : qAsConst(d->targets)) {
- if (targetItem && targetItem->isVisible()) {
+ for (int ii = 0; ii < d->targets.count(); ++ii) {
+ QQuickItem *i = d->targets.at(ii);
+ if (i && i->isVisible()) {
event->accept();
- QCoreApplication::sendEvent(targetItem, event);
+ QCoreApplication::sendEvent(i, event);
if (event->isAccepted()) {
d->inRelease = false;
return;
@@ -1439,7 +1448,8 @@ void QQuickKeysAttached::inputMethodEvent(QInputMethodEvent *event, bool post)
Q_D(QQuickKeysAttached);
if (post == m_processPost && d->item && !d->inIM && d->item->window()) {
d->inIM = true;
- for (QQuickItem *targetItem : qAsConst(d->targets)) {
+ for (int ii = 0; ii < d->targets.count(); ++ii) {
+ QQuickItem *targetItem = d->targets.at(ii);
if (targetItem && targetItem->isVisible() && (targetItem->flags() & QQuickItem::ItemAcceptsInputMethod)) {
QCoreApplication::sendEvent(targetItem, event);
if (event->isAccepted()) {
@@ -1458,12 +1468,13 @@ QVariant QQuickKeysAttached::inputMethodQuery(Qt::InputMethodQuery query) const
{
Q_D(const QQuickKeysAttached);
if (d->item) {
- for (QQuickItem *targetItem : qAsConst(d->targets)) {
- if (targetItem && targetItem->isVisible() && (targetItem->flags() & QQuickItem::ItemAcceptsInputMethod) && targetItem == d->imeItem) {
- //### how robust is targetItem == d->imeItem check?
- QVariant v = targetItem->inputMethodQuery(query);
+ for (int ii = 0; ii < d->targets.count(); ++ii) {
+ QQuickItem *i = d->targets.at(ii);
+ if (i && i->isVisible() && (i->flags() & QQuickItem::ItemAcceptsInputMethod) && i == d->imeItem) {
+ //### how robust is i == d->imeItem check?
+ QVariant v = i->inputMethodQuery(query);
if (v.userType() == QVariant::RectF)
- v = d->item->mapRectFromItem(targetItem, v.toRectF()); //### cost?
+ v = d->item->mapRectFromItem(i, v.toRectF()); //### cost?
return v;
}
}
@@ -1637,9 +1648,11 @@ void QQuickItemPrivate::setImplicitLayoutMirror(bool mirror, bool inherit)
if (isMirrorImplicit)
setLayoutMirror(inherit ? inheritedLayoutMirror : false);
- for (QQuickItem *child : qAsConst(childItems)) {
- QQuickItemPrivate *childPrivate = QQuickItemPrivate::get(child);
- childPrivate->setImplicitLayoutMirror(inheritedLayoutMirror, inheritMirrorFromParent);
+ for (int i = 0; i < childItems.count(); ++i) {
+ if (QQuickItem *child = qmlobject_cast<QQuickItem *>(childItems.at(i))) {
+ QQuickItemPrivate *childPrivate = QQuickItemPrivate::get(child);
+ childPrivate->setImplicitLayoutMirror(inheritedLayoutMirror, inheritMirrorFromParent);
+ }
}
}
@@ -2395,7 +2408,8 @@ QQuickItem::~QQuickItem()
remove themselves from our list of transforms when that list has already
been destroyed after ~QQuickItem() has run.
*/
- for (QQuickTransform *t : qAsConst(d->transforms)) {
+ for (int ii = 0; ii < d->transforms.count(); ++ii) {
+ QQuickTransform *t = d->transforms.at(ii);
QQuickTransformPrivate *tp = QQuickTransformPrivate::get(t);
tp->items.removeOne(this);
}
@@ -2886,8 +2900,8 @@ QList<QQuickItem *> QQuickItemPrivate::paintOrderChildItems() const
// If none of the items have set Z then the paint order list is the same as
// the childItems list. This is by far the most common case.
bool haveZ = false;
- for (QQuickItem *childItem : qAsConst(childItems)) {
- if (QQuickItemPrivate::get(childItem)->z() != 0.) {
+ for (int i = 0; i < childItems.count(); ++i) {
+ if (QQuickItemPrivate::get(childItems.at(i))->z() != 0.) {
haveZ = true;
break;
}
@@ -2988,7 +3002,8 @@ void QQuickItemPrivate::refWindow(QQuickWindow *c)
if (!parentItem)
QQuickWindowPrivate::get(window)->parentlessItems.insert(q);
- for (QQuickItem *child : qAsConst(childItems)) {
+ for (int ii = 0; ii < childItems.count(); ++ii) {
+ QQuickItem *child = childItems.at(ii);
QQuickItemPrivate::get(child)->refWindow(c);
}
@@ -3040,7 +3055,8 @@ void QQuickItemPrivate::derefWindow()
paintNode = 0;
- for (QQuickItem *child : qAsConst(childItems)) {
+ for (int ii = 0; ii < childItems.count(); ++ii) {
+ QQuickItem *child = childItems.at(ii);
QQuickItemPrivate::get(child)->derefWindow();
}
@@ -3485,7 +3501,8 @@ void QQuickItemPrivate::transform_clear(QQmlListProperty<QQuickTransform> *prop)
QQuickItem *that = static_cast<QQuickItem *>(prop->object);
QQuickItemPrivate *p = QQuickItemPrivate::get(that);
- for (QQuickTransform *t : qAsConst(p->transforms)) {
+ for (int ii = 0; ii < p->transforms.count(); ++ii) {
+ QQuickTransform *t = p->transforms.at(ii);
QQuickTransformPrivate *tp = QQuickTransformPrivate::get(t);
tp->items.removeOne(that);
}
@@ -5850,9 +5867,8 @@ bool QQuickItemPrivate::setEffectiveVisibleRecur(bool newEffectiveVisible)
}
bool childVisibilityChanged = false;
- for (QQuickItem *childItem : qAsConst(childItems)) {
- childVisibilityChanged |= QQuickItemPrivate::get(childItem)->setEffectiveVisibleRecur(newEffectiveVisible);
- }
+ for (int ii = 0; ii < childItems.count(); ++ii)
+ childVisibilityChanged |= QQuickItemPrivate::get(childItems.at(ii))->setEffectiveVisibleRecur(newEffectiveVisible);
itemChange(QQuickItem::ItemVisibleHasChanged, effectiveVisible);
#if QT_CONFIG(accessibility)
@@ -5901,8 +5917,8 @@ void QQuickItemPrivate::setEffectiveEnableRecur(QQuickItem *scope, bool newEffec
}
}
- for (QQuickItem *childItem : qAsConst(childItems)) {
- QQuickItemPrivate::get(childItem)->setEffectiveEnableRecur(
+ for (int ii = 0; ii < childItems.count(); ++ii) {
+ QQuickItemPrivate::get(childItems.at(ii))->setEffectiveEnableRecur(
(flags & QQuickItem::ItemIsFocusScope) && scope ? q : scope, newEffectiveEnable);
}
@@ -6343,6 +6359,7 @@ void QQuickItem::setFlags(Flags flags)
\qmlproperty real QtQuick::Item::height
Defines the item's position and size.
+ The default value is \c 0.
The (x,y) position is relative to the \l parent.
diff --git a/src/quick/items/qquickrectangle.cpp b/src/quick/items/qquickrectangle.cpp
index 0c532bcd4c..65284eb532 100644
--- a/src/quick/items/qquickrectangle.cpp
+++ b/src/quick/items/qquickrectangle.cpp
@@ -1,6 +1,5 @@
/****************************************************************************
**
-** Copyright (C) 2017 Crimson AS <info@crimson.no>
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
@@ -270,9 +269,11 @@ QGradientStops QQuickGradient::gradientStops() const
void QQuickGradient::doUpdate()
{
- static_cast<QQuickItem*>(parent())->update();
+ emit updated();
}
+int QQuickRectanglePrivate::doUpdateSlotIdx = -1;
+
/*!
\qmltype Rectangle
\instantiates QQuickRectangle
@@ -326,6 +327,11 @@ QQuickRectangle::QQuickRectangle(QQuickItem *parent)
setFlag(ItemHasContents);
}
+void QQuickRectangle::doUpdate()
+{
+ update();
+}
+
/*!
\qmlproperty bool QtQuick::Rectangle::antialiasing
@@ -390,7 +396,16 @@ void QQuickRectangle::setGradient(QQuickGradient *gradient)
Q_D(QQuickRectangle);
if (d->gradient == gradient)
return;
+ static int updatedSignalIdx = -1;
+ if (updatedSignalIdx < 0)
+ updatedSignalIdx = QMetaMethod::fromSignal(&QQuickGradient::updated).methodIndex();
+ if (d->doUpdateSlotIdx < 0)
+ d->doUpdateSlotIdx = QQuickRectangle::staticMetaObject.indexOfSlot("doUpdate()");
+ if (d->gradient)
+ QMetaObject::disconnect(d->gradient, updatedSignalIdx, this, d->doUpdateSlotIdx);
d->gradient = gradient;
+ if (d->gradient)
+ QMetaObject::connect(d->gradient, updatedSignalIdx, this, d->doUpdateSlotIdx);
update();
}
diff --git a/src/quick/items/qquickrectangle_p.h b/src/quick/items/qquickrectangle_p.h
index 627f778e44..724a06013c 100644
--- a/src/quick/items/qquickrectangle_p.h
+++ b/src/quick/items/qquickrectangle_p.h
@@ -129,6 +129,9 @@ public:
QGradientStops gradientStops() const;
+Q_SIGNALS:
+ void updated();
+
private:
void doUpdate();
@@ -169,6 +172,9 @@ Q_SIGNALS:
protected:
QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) Q_DECL_OVERRIDE;
+private Q_SLOTS:
+ void doUpdate();
+
private:
Q_DISABLE_COPY(QQuickRectangle)
Q_DECLARE_PRIVATE(QQuickRectangle)
diff --git a/src/quick/items/qquickrectangle_p_p.h b/src/quick/items/qquickrectangle_p_p.h
index e771beec87..3c1aaf7661 100644
--- a/src/quick/items/qquickrectangle_p_p.h
+++ b/src/quick/items/qquickrectangle_p_p.h
@@ -76,6 +76,7 @@ public:
QQuickGradient *gradient;
QQuickPen *pen;
qreal radius;
+ static int doUpdateSlotIdx;
};
QT_END_NAMESPACE
diff --git a/src/quick/items/qquickview.cpp b/src/quick/items/qquickview.cpp
index 8313b53a7d..fca1805fc9 100644
--- a/src/quick/items/qquickview.cpp
+++ b/src/quick/items/qquickview.cpp
@@ -496,6 +496,7 @@ void QQuickViewPrivate::setRootObject(QObject *obj)
if (QQuickItem *sgItem = qobject_cast<QQuickItem *>(obj)) {
root = sgItem;
sgItem->setParentItem(q->QQuickWindow::contentItem());
+ QQml_setParent_noEvent(sgItem, q->QQuickWindow::contentItem());
} else if (qobject_cast<QWindow *>(obj)) {
qWarning() << "QQuickView does not support using windows as a root item." << endl
<< endl
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index 2c929113f6..2cb518d691 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -526,6 +526,7 @@ void QQuickWindowPrivate::init(QQuickWindow *c, QQuickRenderControl *control)
Q_Q(QQuickWindow);
contentItem = new QQuickRootItem;
+ QQml_setParent_noEvent(contentItem, c);
QQmlEngine::setObjectOwnership(contentItem, QQmlEngine::CppOwnership);
QQuickItemPrivate *contentItemPrivate = QQuickItemPrivate::get(contentItem);
contentItemPrivate->window = q;
@@ -751,13 +752,13 @@ void QQuickWindowPrivate::setMouseGrabber(QQuickItem *grabber)
if (grabber && touchMouseId != -1 && touchMouseDevice) {
// update the touch item for mouse touch id to the new grabber
- qCDebug(DBG_TOUCH_TARGET) << "TP (mouse)" << touchMouseId << "->" << q->mouseGrabberItem();
- auto point = touchMouseDevice->pointerEvent()->pointById(touchMouseId);
+ qCDebug(DBG_TOUCH_TARGET) << "TP (mouse)" << hex << touchMouseId << "->" << q->mouseGrabberItem();
+ auto point = pointerEventInstance(touchMouseDevice)->pointById(touchMouseId);
if (point)
point->setGrabber(grabber);
fromTouch = true;
} else {
- QQuickPointerEvent *event = QQuickPointerDevice::genericMouseDevice()->pointerEvent();
+ QQuickPointerEvent *event = pointerEventInstance(QQuickPointerDevice::genericMouseDevice());
Q_ASSERT(event->pointCount() == 1);
event->point(0)->setGrabber(grabber);
}
@@ -784,7 +785,7 @@ void QQuickWindowPrivate::grabTouchPoints(QQuickItem *grabber, const QVector<int
continue;
}
if (id == touchMouseId) {
- auto point = touchMouseDevice->pointerEvent()->pointById(id);
+ auto point = pointerEventInstance(touchMouseDevice)->pointById(id);
auto touchMouseGrabber = point->grabber();
if (touchMouseGrabber) {
point->setGrabber(nullptr);
@@ -798,7 +799,7 @@ void QQuickWindowPrivate::grabTouchPoints(QQuickItem *grabber, const QVector<int
const auto touchDevices = QQuickPointerDevice::touchDevices();
for (auto device : touchDevices) {
- auto point = device->pointerEvent()->pointById(id);
+ auto point = pointerEventInstance(device)->pointById(id);
if (!point)
continue;
QQuickItem *oldGrabber = point->grabber();
@@ -824,7 +825,7 @@ void QQuickWindowPrivate::removeGrabber(QQuickItem *grabber, bool mouse, bool to
if (Q_LIKELY(touch)) {
const auto touchDevices = QQuickPointerDevice::touchDevices();
for (auto device : touchDevices) {
- auto pointerEvent = device->pointerEvent();
+ auto pointerEvent = pointerEventInstance(device);
for (int i = 0; i < pointerEvent->pointCount(); ++i) {
if (pointerEvent->point(i)->grabber() == grabber) {
pointerEvent->point(i)->setGrabber(nullptr);
@@ -1493,13 +1494,13 @@ QQuickItem *QQuickWindow::mouseGrabberItem() const
Q_D(const QQuickWindow);
if (d->touchMouseId != -1 && d->touchMouseDevice) {
- QQuickPointerEvent *event = d->touchMouseDevice->pointerEvent();
+ QQuickPointerEvent *event = d->pointerEventInstance(d->touchMouseDevice);
auto point = event->pointById(d->touchMouseId);
Q_ASSERT(point);
return point->grabber();
}
- QQuickPointerEvent *event = QQuickPointerDevice::genericMouseDevice()->pointerEvent();
+ QQuickPointerEvent *event = d->pointerEventInstance(QQuickPointerDevice::genericMouseDevice());
Q_ASSERT(event->pointCount());
return event->point(0)->grabber();
}
@@ -1883,7 +1884,7 @@ bool QQuickWindowPrivate::deliverTouchCancelEvent(QTouchEvent *event)
// A TouchCancel event will typically not contain any points.
// Deliver it to all items that have active touches.
- QQuickPointerEvent *pointerEvent = QQuickPointerDevice::touchDevice(event->device())->pointerEvent();
+ QQuickPointerEvent *pointerEvent = pointerEventInstance(QQuickPointerDevice::touchDevice(event->device()));
QVector<QQuickItem *> grabbers = pointerEvent->grabbers();
for (QQuickItem *grabber: qAsConst(grabbers)) {
@@ -1979,8 +1980,14 @@ bool QQuickWindowPrivate::compressTouchEvent(QTouchEvent *event)
void QQuickWindowPrivate::handleTouchEvent(QTouchEvent *event)
{
translateTouchEvent(event);
- if (event->touchPoints().size())
- lastMousePosition = event->touchPoints().at(0).pos();
+ if (event->touchPoints().size()) {
+ auto point = event->touchPoints().at(0);
+ if (point.state() == Qt::TouchPointReleased) {
+ lastMousePosition = QPointF();
+ } else {
+ lastMousePosition = point.pos();
+ }
+ }
qCDebug(DBG_TOUCH) << event;
@@ -2107,6 +2114,32 @@ void QQuickWindowPrivate::flushFrameSynchronousEvents()
}
}
+QQuickPointerEvent *QQuickWindowPrivate::pointerEventInstance(QQuickPointerDevice *device) const
+{
+ // the list of devices should be very small so a linear search should be ok
+ for (QQuickPointerEvent *e: pointerEventInstances) {
+ if (e->device() == device)
+ return e;
+ }
+
+ QQuickPointerEvent *ev = nullptr;
+ QQuickWindow *q = const_cast<QQuickWindow*>(q_func());
+ switch (device->type()) {
+ case QQuickPointerDevice::Mouse:
+ ev = new QQuickPointerMouseEvent(q, device);
+ break;
+ case QQuickPointerDevice::TouchPad:
+ case QQuickPointerDevice::TouchScreen:
+ ev = new QQuickPointerTouchEvent(q, device);
+ break;
+ default:
+ // TODO tablet event types
+ break;
+ }
+ pointerEventInstances << ev;
+ return ev;
+}
+
/*!
\internal
Returns a QQuickPointerEvent instance suitable for wrapping and delivering \a event.
@@ -2117,25 +2150,29 @@ void QQuickWindowPrivate::flushFrameSynchronousEvents()
QQuickPointerEvent *QQuickWindowPrivate::pointerEventInstance(QEvent *event) const
{
QQuickPointerDevice *dev = nullptr;
+ QQuickPointerEvent *ev = nullptr;
switch (event->type()) {
case QEvent::MouseButtonPress:
case QEvent::MouseButtonRelease:
case QEvent::MouseButtonDblClick:
case QEvent::MouseMove:
dev = QQuickPointerDevice::genericMouseDevice();
+ ev = pointerEventInstance(dev);
break;
case QEvent::TouchBegin:
case QEvent::TouchUpdate:
case QEvent::TouchEnd:
case QEvent::TouchCancel:
dev = QQuickPointerDevice::touchDevice(static_cast<QTouchEvent *>(event)->device());
+ ev = pointerEventInstance(dev);
break;
// TODO tablet event types
default:
break;
}
- Q_ASSERT(dev);
- return dev->pointerEvent()->reset(event);
+
+ Q_ASSERT(ev);
+ return ev->reset(event);
}
void QQuickWindowPrivate::deliverPointerEvent(QQuickPointerEvent *event)
@@ -2227,7 +2264,7 @@ void QQuickWindowPrivate::deliverTouchEvent(QQuickPointerTouchEvent *event)
QQuickEventPoint *point = event->point(i);
if (point->state() == QQuickEventPoint::Released) {
int id = point->pointId();
- qCDebug(DBG_TOUCH_TARGET) << "TP" << id << "released";
+ qCDebug(DBG_TOUCH_TARGET) << "TP" << hex << id << "released";
point->setGrabber(nullptr);
if (id == touchMouseId) {
touchMouseId = -1;
@@ -2610,7 +2647,7 @@ bool QQuickWindowPrivate::sendFilteredTouchEvent(QQuickItem *target, QQuickItem
if (touchMouseUnset) {
// the point was grabbed as a pure touch point before, now it will be treated as mouse
// but the old receiver still needs to be informed
- if (auto oldGrabber = touchMouseDevice->pointerEvent()->pointById(tp.id())->grabber())
+ if (auto oldGrabber = pointerEventInstance(touchMouseDevice)->pointById(tp.id())->grabber())
oldGrabber->touchUngrabEvent();
}
touchMouseUnset = false; // We want to leave touchMouseId and touchMouseDevice set
@@ -3862,7 +3899,7 @@ QSGTexture *QQuickWindow::createTextureFromImage(const QImage &image, CreateText
initialized or OpenGL is not in use.
\note This function only has an effect when using the default OpenGL scene graph
- adpation.
+ adaptation.
\sa sceneGraphInitialized(), QSGTexture
*/
@@ -3970,7 +4007,7 @@ void QQuickWindow::setDefaultAlphaBuffer(bool useAlpha)
graph renderer. Clear these manually on demand.
\note This function only has an effect when using the default OpenGL scene graph
- adpation.
+ adaptation.
\sa QQuickWindow::beforeRendering()
*/
diff --git a/src/quick/items/qquickwindow_p.h b/src/quick/items/qquickwindow_p.h
index be915903c6..b3ff5a2b35 100644
--- a/src/quick/items/qquickwindow_p.h
+++ b/src/quick/items/qquickwindow_p.h
@@ -162,6 +162,10 @@ public:
void flushFrameSynchronousEvents();
void deliverDelayedTouchEvent();
+ // the device-specific event instances which are reused during event delivery
+ mutable QVector<QQuickPointerEvent *> pointerEventInstances;
+ QQuickPointerEvent *pointerEventInstance(QQuickPointerDevice *device) const;
+
// delivery of pointer events:
QQuickPointerEvent *pointerEventInstance(QEvent *ev) const;
void deliverPointerEvent(QQuickPointerEvent *);
diff --git a/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp b/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp
index 2ff180ea99..02cf8209d1 100644
--- a/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp
+++ b/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp
@@ -165,12 +165,12 @@ QRegion QSGAbstractSoftwareRenderer::optimizeRenderList()
// Keep up with obscured regions
if (node->isOpaque()) {
- m_obscuredRegion += QRegion(node->boundingRect());
+ m_obscuredRegion += node->boundingRectMin();
}
if (node->isDirty()) {
// Don't paint things outside of the rendering area
- if (!m_background->rect().toRect().contains(node->boundingRect(), /*proper*/ true)) {
+ if (!m_background->rect().toRect().contains(node->boundingRectMax(), /*proper*/ true)) {
// Some part(s) of node is(are) outside of the rendering area
QRegion renderArea(m_background->rect().toRect());
QRegion outsideRegions = node->dirtyRegion().subtracted(renderArea);
@@ -181,7 +181,7 @@ QRegion QSGAbstractSoftwareRenderer::optimizeRenderList()
// Get the dirty region's to pass to the next nodes
if (node->isOpaque()) {
// if isOpaque, subtract node's dirty rect from m_dirtyRegion
- m_dirtyRegion -= node->dirtyRegion();
+ m_dirtyRegion -= node->boundingRectMin();
} else {
// if isAlpha, add node's dirty rect to m_dirtyRegion
m_dirtyRegion += node->dirtyRegion();
@@ -264,7 +264,7 @@ void QSGAbstractSoftwareRenderer::nodeRemoved(QSGNode *node)
// Need to mark this region dirty in the other nodes
QRegion dirtyRegion = renderable->previousDirtyRegion(true);
if (dirtyRegion.isEmpty())
- dirtyRegion = renderable->boundingRect();
+ dirtyRegion = renderable->boundingRectMax();
m_dirtyRegion += dirtyRegion;
m_nodes.remove(node);
delete renderable;
diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarepublicnodes.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarepublicnodes.cpp
index d754089ce4..77d21ec042 100644
--- a/src/quick/scenegraph/adaptations/software/qsgsoftwarepublicnodes.cpp
+++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarepublicnodes.cpp
@@ -74,6 +74,9 @@ QSGSoftwareImageNode::~QSGSoftwareImageNode()
void QSGSoftwareImageNode::setTexture(QSGTexture *texture)
{
+ if (m_owns)
+ delete m_texture;
+
m_texture = texture; markDirty(DirtyMaterial);
m_cachedMirroredPixmapIsDirty = true;
}
diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenode.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenode.cpp
index f67e2106c8..8036baf166 100644
--- a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenode.cpp
+++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenode.cpp
@@ -54,10 +54,28 @@
#include <private/qsgrendernode_p.h>
#include <private/qsgtexture_p.h>
+#include <qmath.h>
+
Q_LOGGING_CATEGORY(lcRenderable, "qt.scenegraph.softwarecontext.renderable")
QT_BEGIN_NAMESPACE
+// Largest subrectangle with integer coordinates
+inline QRect toRectMin(const QRectF & r)
+{
+ int x1 = qCeil(r.left());
+ int x2 = qFloor(r.right());
+ int y1 = qCeil(r.top());
+ int y2 = qFloor(r.bottom());
+ return QRect(x1, y1, x2 - x1, y2 - y1);
+}
+
+// Smallest superrectangle with integer coordinates
+inline QRect toRectMax(const QRectF & r)
+{
+ return r.toAlignedRect();
+}
+
QSGSoftwareRenderableNode::QSGSoftwareRenderableNode(NodeType type, QSGNode *node)
: m_nodeType(type)
, m_isOpaque(true)
@@ -117,7 +135,7 @@ void QSGSoftwareRenderableNode::update()
// Update the Node properties
m_isDirty = true;
- QRect boundingRect;
+ QRectF boundingRect;
switch (m_nodeType) {
case QSGSoftwareRenderableNode::SimpleRect:
@@ -126,7 +144,7 @@ void QSGSoftwareRenderableNode::update()
else
m_isOpaque = false;
- boundingRect = m_handle.simpleRectNode->rect().toRect();
+ boundingRect = m_handle.simpleRectNode->rect();
break;
case QSGSoftwareRenderableNode::SimpleTexture:
if (!m_handle.simpleTextureNode->texture()->hasAlphaChannel() && !m_transform.isRotating())
@@ -134,7 +152,7 @@ void QSGSoftwareRenderableNode::update()
else
m_isOpaque = false;
- boundingRect = m_handle.simpleTextureNode->rect().toRect();
+ boundingRect = m_handle.simpleTextureNode->rect();
break;
case QSGSoftwareRenderableNode::Image:
// There isn't a way to tell, so assume it's not
@@ -148,7 +166,7 @@ void QSGSoftwareRenderableNode::update()
else
m_isOpaque = false;
- boundingRect = QRect(0, 0, m_handle.painterNode->size().width(), m_handle.painterNode->size().height());
+ boundingRect = QRectF(0, 0, m_handle.painterNode->size().width(), m_handle.painterNode->size().height());
break;
case QSGSoftwareRenderableNode::Rectangle:
if (m_handle.rectangleNode->isOpaque() && !m_transform.isRotating())
@@ -156,19 +174,19 @@ void QSGSoftwareRenderableNode::update()
else
m_isOpaque = false;
- boundingRect = m_handle.rectangleNode->rect().toRect();
+ boundingRect = m_handle.rectangleNode->rect();
break;
case QSGSoftwareRenderableNode::Glyph:
// Always has alpha
m_isOpaque = false;
- boundingRect = m_handle.glpyhNode->boundingRect().toAlignedRect();
+ boundingRect = m_handle.glpyhNode->boundingRect();
break;
case QSGSoftwareRenderableNode::NinePatch:
// Difficult to tell, assume non-opaque
m_isOpaque = false;
- boundingRect = m_handle.ninePatchNode->bounds().toRect();
+ boundingRect = m_handle.ninePatchNode->bounds();
break;
case QSGSoftwareRenderableNode::SimpleRectangle:
if (m_handle.simpleRectangleNode->color().alpha() == 255 && !m_transform.isRotating())
@@ -176,7 +194,7 @@ void QSGSoftwareRenderableNode::update()
else
m_isOpaque = false;
- boundingRect = m_handle.simpleRectangleNode->rect().toRect();
+ boundingRect = m_handle.simpleRectangleNode->rect();
break;
case QSGSoftwareRenderableNode::SimpleImage:
if (!m_handle.simpleImageNode->texture()->hasAlphaChannel() && !m_transform.isRotating())
@@ -184,12 +202,12 @@ void QSGSoftwareRenderableNode::update()
else
m_isOpaque = false;
- boundingRect = m_handle.simpleImageNode->rect().toRect();
+ boundingRect = m_handle.simpleImageNode->rect();
break;
#if QT_CONFIG(quick_sprite)
case QSGSoftwareRenderableNode::SpriteNode:
m_isOpaque = m_handle.spriteNode->isOpaque();
- boundingRect = m_handle.spriteNode->rect().toRect();
+ boundingRect = m_handle.spriteNode->rect();
break;
#endif
case QSGSoftwareRenderableNode::RenderNode:
@@ -198,27 +216,32 @@ void QSGSoftwareRenderableNode::update()
else
m_isOpaque = false;
- boundingRect = m_handle.renderNode->rect().toRect();
+ boundingRect = m_handle.renderNode->rect();
break;
default:
break;
}
- m_boundingRect = m_transform.mapRect(boundingRect);
+ const QRectF transformedRect = m_transform.mapRect(boundingRect);
+ m_boundingRectMin = toRectMin(transformedRect);
+ m_boundingRectMax = toRectMax(transformedRect);
if (m_hasClipRegion && m_clipRegion.rectCount() <= 1) {
// If there is a clipRegion, and it is empty, the item wont be rendered
- if (m_clipRegion.isEmpty())
- m_boundingRect = QRect();
- else
- m_boundingRect = m_boundingRect.intersected(m_clipRegion.rects().first());
+ if (m_clipRegion.isEmpty()) {
+ m_boundingRectMin = QRect();
+ m_boundingRectMax = QRect();
+ } else {
+ m_boundingRectMin = m_boundingRectMin.intersected(m_clipRegion.rects().first());
+ m_boundingRectMax = m_boundingRectMax.intersected(m_clipRegion.rects().first());
+ }
}
// Overrides
if (m_opacity < 1.0f)
m_isOpaque = false;
- m_dirtyRegion = QRegion(m_boundingRect);
+ m_dirtyRegion = QRegion(m_boundingRectMax);
}
struct RenderNodeState : public QSGRenderNode::RenderState
@@ -267,7 +290,7 @@ QRegion QSGSoftwareRenderableNode::renderNode(QPainter *painter, bool forceOpaqu
painter->restore();
const QRect br = m_handle.renderNode->flags().testFlag(QSGRenderNode::BoundedRectRendering)
- ? m_boundingRect // already mapped to world
+ ? m_boundingRectMax // already mapped to world
: QRect(0, 0, painter->device()->width(), painter->device()->height());
m_previousDirtyRegion = QRegion(br);
m_isDirty = false;
@@ -338,19 +361,13 @@ QRegion QSGSoftwareRenderableNode::renderNode(QPainter *painter, bool forceOpaqu
painter->restore();
QRegion areaToBeFlushed = m_dirtyRegion;
- m_previousDirtyRegion = QRegion(m_boundingRect);
+ m_previousDirtyRegion = QRegion(m_boundingRectMax);
m_isDirty = false;
m_dirtyRegion = QRegion();
return areaToBeFlushed;
}
-QRect QSGSoftwareRenderableNode::boundingRect() const
-{
- // This returns the bounding area of a renderable node in world coordinates
- return m_boundingRect;
-}
-
bool QSGSoftwareRenderableNode::isDirtyRegionEmpty() const
{
return m_dirtyRegion.isEmpty();
@@ -395,12 +412,12 @@ void QSGSoftwareRenderableNode::markMaterialDirty()
void QSGSoftwareRenderableNode::addDirtyRegion(const QRegion &dirtyRegion, bool forceDirty)
{
- // Check if the dirty region applys to this node
+ // Check if the dirty region applies to this node
QRegion prev = m_dirtyRegion;
- if (dirtyRegion.intersects(boundingRect())) {
+ if (dirtyRegion.intersects(m_boundingRectMax)) {
if (forceDirty)
m_isDirty = true;
- m_dirtyRegion += dirtyRegion.intersected(boundingRect());
+ m_dirtyRegion += dirtyRegion.intersected(m_boundingRectMax);
}
qCDebug(lcRenderable) << "addDirtyRegion: " << dirtyRegion << "old dirtyRegion: " << prev << "new dirtyRegion: " << m_dirtyRegion;
}
@@ -410,7 +427,7 @@ void QSGSoftwareRenderableNode::subtractDirtyRegion(const QRegion &dirtyRegion)
QRegion prev = m_dirtyRegion;
if (m_isDirty) {
// Check if this rect concerns us
- if (dirtyRegion.intersects(QRegion(boundingRect()))) {
+ if (dirtyRegion.intersects(m_boundingRectMax)) {
m_dirtyRegion -= dirtyRegion;
if (m_dirtyRegion.isEmpty())
m_isDirty = false;
@@ -426,7 +443,7 @@ QRegion QSGSoftwareRenderableNode::previousDirtyRegion(bool wasRemoved) const
if (wasRemoved)
return m_previousDirtyRegion;
- return m_previousDirtyRegion.subtracted(QRegion(m_boundingRect));
+ return m_previousDirtyRegion.subtracted(QRegion(m_boundingRectMax));
}
QRegion QSGSoftwareRenderableNode::dirtyRegion() const
diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenode_p.h b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenode_p.h
index 473578c185..8fc87db179 100644
--- a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenode_p.h
+++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenode_p.h
@@ -98,7 +98,8 @@ public:
void update();
QRegion renderNode(QPainter *painter, bool forceOpaquePainting = false);
- QRect boundingRect() const;
+ QRect boundingRectMin() const { return m_boundingRectMin; }
+ QRect boundingRectMax() const { return m_boundingRectMax; }
NodeType type() const { return m_nodeType; }
bool isOpaque() const { return m_isOpaque; }
bool isDirty() const { return m_isDirty; }
@@ -149,7 +150,8 @@ private:
bool m_hasClipRegion;
float m_opacity;
- QRect m_boundingRect;
+ QRect m_boundingRectMin;
+ QRect m_boundingRectMax;
};
QT_END_NAMESPACE
diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
index b8ebeaca63..78f2c86f6c 100644
--- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
+++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
@@ -2966,7 +2966,11 @@ void Renderer::visualizeBatch(Batch *b)
for (int ds=0; ds<b->drawSets.size(); ++ds) {
const DrawSet &set = b->drawSets.at(ds);
glVertexAttribPointer(a.position, 2, a.type, false, g->sizeOfVertex(), (void *) (qintptr) (set.vertices));
+#ifdef QSG_SEPARATE_INDEX_BUFFER
+ glDrawElements(g->drawingMode(), set.indexCount, GL_UNSIGNED_SHORT, (void *) (qintptr) (b->ibo.data + set.indices));
+#else
glDrawElements(g->drawingMode(), set.indexCount, GL_UNSIGNED_SHORT, (void *) (qintptr) (b->vbo.data + set.indices));
+#endif
}
} else {
Element *e = b->first;
diff --git a/src/quick/scenegraph/coreapi/qsgnode.cpp b/src/quick/scenegraph/coreapi/qsgnode.cpp
index 7ac3914023..e400928d4e 100644
--- a/src/quick/scenegraph/coreapi/qsgnode.cpp
+++ b/src/quick/scenegraph/coreapi/qsgnode.cpp
@@ -792,7 +792,7 @@ QSGBasicGeometryNode::~QSGBasicGeometryNode()
If the node has the flag QSGNode::OwnsGeometry set, it will also delete the
geometry object it is pointing to. This flag is not set by default.
- If the geometry is changed whitout calling setGeometry() again, the user
+ If the geometry is changed without calling setGeometry() again, the user
must also mark the geometry as dirty using QSGNode::markDirty().
\sa markDirty()
@@ -845,7 +845,7 @@ void QSGBasicGeometryNode::setGeometry(QSGGeometry *geometry)
The geometry node supports two types of materials, the opaqueMaterial and the normal
material. The opaqueMaterial is used when the accumulated scene graph opacity at the
- time of rendering is 1. The primary usecase is to special case opaque rendering
+ time of rendering is 1. The primary use case is to special case opaque rendering
to avoid an extra operation in the fragment shader can have significant performance
impact on embedded graphics chips. The opaque material is optional.
@@ -887,7 +887,7 @@ QSGGeometryNode::QSGGeometryNode(QSGGeometryNodePrivate &dd)
Deletes this geometry node.
The flags QSGNode::OwnsMaterial, QSGNode::OwnsOpaqueMaterial and
- QSGNode::OwnsGeometry decides weither the geometry node should also
+ QSGNode::OwnsGeometry decides whether the geometry node should also
delete the materials and geometry. By default, these flags are disabled.
*/
@@ -961,7 +961,7 @@ void QSGGeometryNode::setRenderOrder(int order)
Geometry nodes must have a material before they can be added to the
scene graph.
- If the material is changed whitout calling setMaterial() again, the user
+ If the material is changed without calling setMaterial() again, the user
must also mark the material as dirty using QSGNode::markDirty().
*/
@@ -991,7 +991,7 @@ void QSGGeometryNode::setMaterial(QSGMaterial *material)
allowed to set QSGMaterial::Blending to true and draw transparent
pixels.
- If the material is changed whitout calling setOpaqueMaterial()
+ If the material is changed without calling setOpaqueMaterial()
again, the user must also mark the opaque material as dirty using
QSGNode::markDirty().
@@ -1371,7 +1371,7 @@ void QSGOpacityNode::setOpacity(qreal opacity)
Returns this node's accumulated opacity.
- This vaule is calculated during rendering and only stored
+ This value is calculated during rendering and only stored
in the opacity node temporarily.
\internal
diff --git a/src/quick/scenegraph/coreapi/qsgrenderer.cpp b/src/quick/scenegraph/coreapi/qsgrenderer.cpp
index bb2671f6c3..8fbd402a2f 100644
--- a/src/quick/scenegraph/coreapi/qsgrenderer.cpp
+++ b/src/quick/scenegraph/coreapi/qsgrenderer.cpp
@@ -99,7 +99,7 @@ void QSGBindableFboId::bind() const
#endif
/*!
\class QSGRenderer
- \brief The renderer class is the abstract baseclass use for rendering the
+ \brief The renderer class is the abstract baseclass used for rendering the
QML scene graph.
The renderer is not tied to any particular surface. It expects a context to
@@ -295,7 +295,7 @@ void QSGRenderer::preprocess()
// We need to take a copy here, in case any of the preprocess calls deletes a node that
// is in the preprocess list and thus, changes the m_nodes_to_preprocess behind our backs
- // For the default case, when this does not happen, the cost is neglishible.
+ // For the default case, when this does not happen, the cost is negligible.
QSet<QSGNode *> items = m_nodes_to_preprocess;
for (QSet<QSGNode *>::const_iterator it = items.constBegin();
diff --git a/src/quick/util/qquickglobal.cpp b/src/quick/util/qquickglobal.cpp
index 2070fd7ff0..1d2f3de1df 100644
--- a/src/quick/util/qquickglobal.cpp
+++ b/src/quick/util/qquickglobal.cpp
@@ -814,6 +814,11 @@ public:
return false;
#endif
}
+
+ QString pluginName() const override
+ {
+ return QGuiApplication::platformName();
+ }
};
diff --git a/src/quick/util/qquickpixmapcache.cpp b/src/quick/util/qquickpixmapcache.cpp
index 8df1a892e4..e026608150 100644
--- a/src/quick/util/qquickpixmapcache.cpp
+++ b/src/quick/util/qquickpixmapcache.cpp
@@ -497,7 +497,7 @@ void QQuickPixmapReader::networkRequestDone(QNetworkReply *reply)
QByteArray all = reply->readAll();
QBuffer buff(&all);
buff.open(QIODevice::ReadOnly);
- if (!readImage(reply->url(), &buff, &image, &errorString, &readSize, job->requestSize, job->data->providerOptions))
+ if (!readImage(reply->url(), &buff, &image, &errorString, &readSize, job->requestSize, job->providerOptions))
error = QQuickPixmapReply::Decoding;
}
// send completion event to the QQuickPixmapReply
diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp
index 4d021cb680..2e8623f508 100644
--- a/src/quickwidgets/qquickwidget.cpp
+++ b/src/quickwidgets/qquickwidget.cpp
@@ -1440,6 +1440,9 @@ bool QQuickWidget::event(QEvent *e)
d->offscreenWindow->setWindowState(resolveWindowState(windowState()));
break;
+ case QEvent::ShortcutOverride:
+ return QCoreApplication::sendEvent(d->offscreenWindow, e);
+
default:
break;
}
@@ -1596,10 +1599,10 @@ QQuickWindow *QQuickWidget::quickWindow() const
void QQuickWidget::paintEvent(QPaintEvent *event)
{
- Q_UNUSED(event)
Q_D(QQuickWidget);
if (d->useSoftwareRenderer) {
QPainter painter(this);
+ d->updateRegion = d->updateRegion.united(event->region());
if (d->updateRegion.isNull()) {
//Paint everything
painter.drawImage(rect(), d->softwareImage);
diff --git a/tests/auto/particles/qquickparticlesystem/data/crashaffectors.qml b/tests/auto/particles/qquickparticlesystem/data/crashaffectors.qml
index de105916a7..61599adc09 100644
--- a/tests/auto/particles/qquickparticlesystem/data/crashaffectors.qml
+++ b/tests/auto/particles/qquickparticlesystem/data/crashaffectors.qml
@@ -1,31 +1,26 @@
/****************************************************************************
**
** Copyright (C) 2017 reMarkable A/S
-** Contact: http://www.qt.io/licensing/
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL21$
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 or version 3 as published by the Free
-** Software Foundation and appearing in the file LICENSE.LGPLv21 and
-** LICENSE.LGPLv3 included in the packaging of this file. Please review the
-** following information to ensure the GNU Lesser General Public License
-** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** As a special exception, The Qt Company gives you certain additional
-** rights. These rights are described in The Qt Company LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp b/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp
index 584bd10151..441f8c113f 100644
--- a/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp
+++ b/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp
@@ -46,7 +46,7 @@
using namespace QV4;
using namespace QV4::Debugging;
-typedef QV4::ReturnedValue (*InjectedFunction)(QV4::CallContext*);
+typedef void (*InjectedFunction)(const QV4::BuiltinFunction *, QV4::Scope &scope, QV4::CallData *callData);
Q_DECLARE_METATYPE(InjectedFunction)
static bool waitForSignal(QObject* obj, const char* signal, int timeout = 10000)
@@ -438,11 +438,11 @@ void tst_qv4debugger::addBreakPointWhilePaused()
QCOMPARE(state.lineNumber, 2);
}
-static QV4::ReturnedValue someCall(QV4::CallContext *ctx)
+static void someCall(const QV4::BuiltinFunction *, QV4::Scope &scope, QV4::CallData *)
{
- static_cast<QV4Debugger *>(ctx->d()->engine->debugger())
+ static_cast<QV4Debugger *>(scope.engine->debugger())
->removeBreakPoint("removeBreakPointForNextInstruction", 2);
- return QV4::Encode::undefined();
+ RETURN_UNDEFINED();
}
void tst_qv4debugger::removeBreakPointForNextInstruction()
diff --git a/tests/auto/qml/ecmascripttests/test262.py b/tests/auto/qml/ecmascripttests/test262.py
index 99f029cffd..9f0a7c1dee 100755
--- a/tests/auto/qml/ecmascripttests/test262.py
+++ b/tests/auto/qml/ecmascripttests/test262.py
@@ -569,6 +569,7 @@ def Main():
#logging.basicConfig(level=logging.DEBUG)
os.environ["TZ"] = "PST8PDT"
os.environ["LANG"] = "en_US.UTF-8"
+ os.environ["LC_TIME"] = "en_US.UTF-8"
parser = BuildOptions()
(options, args) = parser.parse_args()
ValidateOptions(options)
diff --git a/tests/auto/qml/qqmlconnections/data/disabled-at-start.qml b/tests/auto/qml/qqmlconnections/data/disabled-at-start.qml
new file mode 100644
index 0000000000..1a823f87f6
--- /dev/null
+++ b/tests/auto/qml/qqmlconnections/data/disabled-at-start.qml
@@ -0,0 +1,14 @@
+import QtQuick 2.9
+
+Item {
+ id: root
+
+ property bool tested: false
+ signal testMe()
+
+ Connections {
+ target: root
+ enabled: false
+ onTestMe: root.tested = true;
+ }
+}
diff --git a/tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp b/tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp
index 1ed94fcb93..22e9724c61 100644
--- a/tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp
+++ b/tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp
@@ -52,6 +52,7 @@ private slots:
void rewriteErrors();
void singletonTypeTarget();
void enableDisable_QTBUG_36350();
+ void disabledAtStart();
void clearImplicitTarget();
void onWithoutASignal();
@@ -354,6 +355,23 @@ void tst_qqmlconnections::enableDisable_QTBUG_36350()
delete item;
}
+void tst_qqmlconnections::disabledAtStart()
+{
+ QQmlEngine engine;
+ QQmlComponent c(&engine, testFileUrl("disabled-at-start.qml"));
+ QObject * const object = c.create();
+
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("tested").toBool(), false);
+ const int index = object->metaObject()->indexOfSignal("testMe()");
+ const QMetaMethod method = object->metaObject()->method(index);
+ method.invoke(object, Qt::DirectConnection);
+ QCOMPARE(object->property("tested").toBool(), false);
+
+ delete object;
+}
+
//QTBUG-56499
void tst_qqmlconnections::clearImplicitTarget()
{
diff --git a/tests/auto/qml/qqmlecmascript/data/qtbug60547/TestObject.qml b/tests/auto/qml/qqmlecmascript/data/qtbug60547/TestObject.qml
new file mode 100644
index 0000000000..5f022f605a
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/qtbug60547/TestObject.qml
@@ -0,0 +1,11 @@
+import QtQuick 2.0
+import "components"
+
+QtObject {
+ id: root
+ property int counter
+ function increment() {
+ counter++
+ return counter
+ }
+}
diff --git a/tests/auto/qml/qqmlecmascript/data/qtbug60547/components/Counter.qml b/tests/auto/qml/qqmlecmascript/data/qtbug60547/components/Counter.qml
new file mode 100644
index 0000000000..3c5e65a340
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/qtbug60547/components/Counter.qml
@@ -0,0 +1,4 @@
+import QtQuick 2.0
+
+QtObject {}
+
diff --git a/tests/auto/qml/qqmlecmascript/data/qtbug60547/main.qml b/tests/auto/qml/qqmlecmascript/data/qtbug60547/main.qml
new file mode 100644
index 0000000000..b09366e9df
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/qtbug60547/main.qml
@@ -0,0 +1,8 @@
+import QtQml 2.0
+
+TestObject {
+ Component.onCompleted: {
+ increment()
+ }
+}
+
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index 07ae9821e9..45f312e934 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -341,6 +341,7 @@ private slots:
void redefineGlobalProp();
void freeze_empty_object();
void singleBlockLoops();
+ void qtbug_60547();
private:
// static void propertyVarWeakRefCallback(v8::Persistent<v8::Value> object, void* parameter);
@@ -8358,6 +8359,16 @@ void tst_qqmlecmascript::singleBlockLoops()
QVERIFY(!component.isError());
}
+// 'counter' was incorrectly resolved as a type rather than a variable.
+// This fix ensures it looks up the right thing.
+void tst_qqmlecmascript::qtbug_60547()
+{
+ QQmlComponent component(&engine, testFileUrl("qtbug60547/main.qml"));
+ QScopedPointer<QObject> object(component.create());
+ QVERIFY2(!object.isNull(), qPrintable(component.errorString()));
+ QCOMPARE(object->property("counter"), QVariant(int(1)));
+}
+
QTEST_MAIN(tst_qqmlecmascript)
#include "tst_qqmlecmascript.moc"
diff --git a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp
index 3f6107ab2b..07569efc72 100644
--- a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp
+++ b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp
@@ -36,6 +36,7 @@
#include <QSignalSpy>
#include <QDebug>
#include <QBuffer>
+#include <QCryptographicHash>
#include <QQmlComponent>
#include <QQmlNetworkAccessManagerFactory>
#include <QQmlExpression>
diff --git a/tests/auto/qml/qqmlextensionplugin/tst_qqmlextensionplugin.cpp b/tests/auto/qml/qqmlextensionplugin/tst_qqmlextensionplugin.cpp
index 124a107a37..268010ead8 100644
--- a/tests/auto/qml/qqmlextensionplugin/tst_qqmlextensionplugin.cpp
+++ b/tests/auto/qml/qqmlextensionplugin/tst_qqmlextensionplugin.cpp
@@ -1,31 +1,26 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2017 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL21$
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 or version 3 as published by the Free
-** Software Foundation and appearing in the file LICENSE.LGPLv21 and
-** LICENSE.LGPLv3 included in the packaging of this file. Please review the
-** following information to ensure the GNU Lesser General Public License
-** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** As a special exception, The Qt Company gives you certain additional
-** rights. These rights are described in The Qt Company LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/tests/auto/qml/qqmllanguage/data/ConcurrentLoadA.qml b/tests/auto/qml/qqmllanguage/data/ConcurrentLoadA.qml
new file mode 100644
index 0000000000..3d538c7572
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/ConcurrentLoadA.qml
@@ -0,0 +1,7 @@
+import QtQuick 2.0
+import testModule 1.0
+
+Item {
+ Test {}
+}
+
diff --git a/tests/auto/qml/qqmllanguage/data/ConcurrentLoadB.qml b/tests/auto/qml/qqmllanguage/data/ConcurrentLoadB.qml
new file mode 100644
index 0000000000..3d538c7572
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/ConcurrentLoadB.qml
@@ -0,0 +1,7 @@
+import QtQuick 2.0
+import testModule 1.0
+
+Item {
+ Test {}
+}
+
diff --git a/tests/auto/qml/qqmllanguage/data/concurrentLoad_main.qml b/tests/auto/qml/qqmllanguage/data/concurrentLoad_main.qml
new file mode 100644
index 0000000000..8cfc90ac96
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/concurrentLoad_main.qml
@@ -0,0 +1,5 @@
+import QtQuick 2.0
+Rectangle {
+ConcurrentLoadA {}
+ConcurrentLoadB {}
+}
diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
index cc5b8cacbc..15f19d550b 100644
--- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
+++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
@@ -267,6 +267,8 @@ private slots:
void instanceof_data();
void instanceof();
+ void concurrentLoadQmlDir();
+
private:
QQmlEngine engine;
QStringList defaultImportPathList;
@@ -4559,6 +4561,20 @@ void tst_qqmllanguage::instanceof()
}
}
+void tst_qqmllanguage::concurrentLoadQmlDir()
+{
+ ThreadedTestHTTPServer server(dataDirectory());
+ QString serverdir = server.urlString("/lib/");
+ engine.setImportPathList(QStringList(defaultImportPathList) << serverdir);
+
+ QQmlComponent component(&engine, testFileUrl("concurrentLoad_main.qml"));
+ QTRY_VERIFY(component.isReady());
+ VERIFY_ERRORS(0);
+ QScopedPointer<QObject> o(component.create());
+ QVERIFY(!o.isNull());
+ engine.setImportPathList(defaultImportPathList);
+}
+
QTEST_MAIN(tst_qqmllanguage)
#include "tst_qqmllanguage.moc"
diff --git a/tests/auto/qml/qqmlparser/tst_qqmlparser.cpp b/tests/auto/qml/qqmlparser/tst_qqmlparser.cpp
index 357482b93f..ba2b836a6d 100644
--- a/tests/auto/qml/qqmlparser/tst_qqmlparser.cpp
+++ b/tests/auto/qml/qqmlparser/tst_qqmlparser.cpp
@@ -49,6 +49,7 @@ private slots:
void qmlParser_data();
void qmlParser();
#endif
+ void invalidEscapeSequence();
private:
QStringList excludedDirs;
@@ -192,6 +193,17 @@ void tst_qqmlparser::qmlParser()
}
#endif
+void tst_qqmlparser::invalidEscapeSequence()
+{
+ using namespace QQmlJS;
+
+ Engine engine;
+ Lexer lexer(&engine);
+ lexer.setCode(QLatin1String("\"\\"), 1);
+ Parser parser(&engine);
+ parser.parse();
+}
+
QTEST_MAIN(tst_qqmlparser)
#include "tst_qqmlparser.moc"
diff --git a/tests/auto/qml/qqmlsettings/data/aliases.qml b/tests/auto/qml/qqmlsettings/data/aliases.qml
index 18bd7a0e07..dd11147532 100644
--- a/tests/auto/qml/qqmlsettings/data/aliases.qml
+++ b/tests/auto/qml/qqmlsettings/data/aliases.qml
@@ -38,8 +38,10 @@ QtObject {
property double doubleProperty: 3.45
property string stringProperty: "foo"
property url urlProperty: "http://www.qt-project.org"
+ property var objectProperty: {"foo":"bar"}
property var intListProperty: [1, 2, 3]
property var stringListProperty: ["a", "b", "c"]
+ property var objectListProperty: [{"a":"b"}, {"c":"d"}]
property date dateProperty: "2000-01-02"
// QTBUG-32295: Expected property type
//property time timeProperty: "12:34:56"
@@ -58,8 +60,10 @@ QtObject {
property alias doubleProperty: root.doubleProperty
property alias stringProperty: root.stringProperty
property alias urlProperty: root.urlProperty
+ property alias objectProperty: root.objectProperty
property alias intListProperty: root.intListProperty
property alias stringListProperty: root.stringListProperty
+ property alias objectListProperty: root.objectListProperty
property alias dateProperty: root.dateProperty
// QTBUG-32295: Expected property type
//property alias timeProperty: root.timeProperty
diff --git a/tests/auto/qml/qqmlsettings/data/cpp-aliases.qml b/tests/auto/qml/qqmlsettings/data/cpp-aliases.qml
index 8540838fb9..f5b18d1825 100644
--- a/tests/auto/qml/qqmlsettings/data/cpp-aliases.qml
+++ b/tests/auto/qml/qqmlsettings/data/cpp-aliases.qml
@@ -40,8 +40,10 @@ CppObject {
property alias doubleProperty: obj.doubleProperty
property alias stringProperty: obj.stringProperty
property alias urlProperty: obj.urlProperty
+ property alias objectProperty: obj.objectProperty
property alias intListProperty: obj.intListProperty
property alias stringListProperty: obj.stringListProperty
+ property alias objectListProperty: obj.objectListProperty
property alias dateProperty: obj.dateProperty
// QTBUG-32295: Expected property type
//property alias timeProperty: obj.timeProperty
diff --git a/tests/auto/qml/qqmlsettings/data/types.qml b/tests/auto/qml/qqmlsettings/data/types.qml
index d1301af057..c4efa0be7c 100644
--- a/tests/auto/qml/qqmlsettings/data/types.qml
+++ b/tests/auto/qml/qqmlsettings/data/types.qml
@@ -38,8 +38,10 @@ QtObject {
property double doubleProperty
property string stringProperty
property url urlProperty
+ property var objectProperty
property var intListProperty
property var stringListProperty
+ property var objectListProperty
property date dateProperty
// QTBUG-32295: Expected property type
// property time timeProperty
@@ -64,8 +66,10 @@ QtObject {
to.doubleProperty = from.doubleProperty
to.stringProperty = from.stringProperty
to.urlProperty = from.urlProperty
+ to.objectProperty = from.objectProperty
to.intListProperty = from.intListProperty
to.stringListProperty = from.stringListProperty
+ to.objectListProperty = from.objectListProperty
to.dateProperty = from.dateProperty
//to.timeProperty = from.timeProperty
to.sizeProperty = from.sizeProperty
@@ -84,8 +88,10 @@ QtObject {
property double doubleProperty: 3.45
property string stringProperty: "foo"
property url urlProperty: "http://www.qt-project.org"
+ property var objectProperty: {"foo":"bar"}
property var intListProperty: [1, 2, 3]
property var stringListProperty: ["a", "b", "c"]
+ property var objectListProperty: [{"a":"b"}, {"c":"d"}]
property date dateProperty: "2000-01-02"
// QTBUG-32295: Expected property type
//property time timeProperty: "12:34:56"
diff --git a/tests/auto/qml/qqmlsettings/tst_qqmlsettings.cpp b/tests/auto/qml/qqmlsettings/tst_qqmlsettings.cpp
index c2e20f8892..e08389045c 100644
--- a/tests/auto/qml/qqmlsettings/tst_qqmlsettings.cpp
+++ b/tests/auto/qml/qqmlsettings/tst_qqmlsettings.cpp
@@ -55,25 +55,36 @@ private slots:
void initial();
};
+// ### Replace keyValueMap("foo", "bar") with QVariantMap({{"foo", "bar"}})
+// when C++11 uniform initialization can be used (not supported by MSVC 2013).
+static QVariantMap keyValueMap(const QString &key, const QString &value)
+{
+ QVariantMap var;
+ var.insert(key, value);
+ return var;
+}
+
class CppObject : public QObject
{
Q_OBJECT
- Q_PROPERTY(int intProperty READ intProperty WRITE setIntProperty NOTIFY intPropertyChanged)
- Q_PROPERTY(bool boolProperty READ boolProperty WRITE setBoolProperty NOTIFY boolPropertyChanged)
- Q_PROPERTY(qreal realProperty READ realProperty WRITE setRealProperty NOTIFY realPropertyChanged)
- Q_PROPERTY(double doubleProperty READ doubleProperty WRITE setDoubleProperty NOTIFY doublePropertyChanged)
- Q_PROPERTY(QString stringProperty READ stringProperty WRITE setStringProperty NOTIFY stringPropertyChanged)
- Q_PROPERTY(QUrl urlProperty READ urlProperty WRITE setUrlProperty NOTIFY urlPropertyChanged)
- Q_PROPERTY(QVariant varProperty READ varProperty WRITE setVarProperty NOTIFY varPropertyChanged)
- Q_PROPERTY(QVariantList intListProperty READ intListProperty WRITE setIntListProperty NOTIFY intListPropertyChanged)
- Q_PROPERTY(QVariantList stringListProperty READ stringListProperty WRITE setStringListProperty NOTIFY stringListPropertyChanged)
- Q_PROPERTY(QDate dateProperty READ dateProperty WRITE setDateProperty NOTIFY datePropertyChanged)
- // QTBUG-32295: Q_PROPERTY(QTime timeProperty READ timeProperty WRITE setTimeProperty NOTIFY timePropertyChanged)
- Q_PROPERTY(QSizeF sizeProperty READ sizeProperty WRITE setSizeProperty NOTIFY sizePropertyChanged)
- Q_PROPERTY(QPointF pointProperty READ pointProperty WRITE setPointProperty NOTIFY pointPropertyChanged)
- Q_PROPERTY(QRectF rectProperty READ rectProperty WRITE setRectProperty NOTIFY rectPropertyChanged)
- Q_PROPERTY(QColor colorProperty READ colorProperty WRITE setColorProperty NOTIFY colorPropertyChanged)
- Q_PROPERTY(QFont fontProperty READ fontProperty WRITE setFontProperty NOTIFY fontPropertyChanged)
+ Q_PROPERTY(int intProperty MEMBER m_intProperty NOTIFY intPropertyChanged)
+ Q_PROPERTY(bool boolProperty MEMBER m_boolProperty NOTIFY boolPropertyChanged)
+ Q_PROPERTY(qreal realProperty MEMBER m_realProperty NOTIFY realPropertyChanged)
+ Q_PROPERTY(double doubleProperty MEMBER m_doubleProperty NOTIFY doublePropertyChanged)
+ Q_PROPERTY(QString stringProperty MEMBER m_stringProperty NOTIFY stringPropertyChanged)
+ Q_PROPERTY(QUrl urlProperty MEMBER m_urlProperty NOTIFY urlPropertyChanged)
+ Q_PROPERTY(QVariant varProperty MEMBER m_varProperty NOTIFY varPropertyChanged)
+ Q_PROPERTY(QVariantMap objectProperty MEMBER m_objectProperty NOTIFY objectPropertyChanged)
+ Q_PROPERTY(QVariantList intListProperty MEMBER m_intListProperty NOTIFY intListPropertyChanged)
+ Q_PROPERTY(QVariantList stringListProperty MEMBER m_stringListProperty NOTIFY stringListPropertyChanged)
+ Q_PROPERTY(QVariantList objectListProperty MEMBER m_objectListProperty NOTIFY objectListPropertyChanged)
+ Q_PROPERTY(QDate dateProperty MEMBER m_dateProperty NOTIFY datePropertyChanged)
+ // QTBUG-32295: Q_PROPERTY(QTime timeProperty MEMBER m_timeProperty NOTIFY timePropertyChanged)
+ Q_PROPERTY(QSizeF sizeProperty MEMBER m_sizeProperty NOTIFY sizePropertyChanged)
+ Q_PROPERTY(QPointF pointProperty MEMBER m_pointProperty NOTIFY pointPropertyChanged)
+ Q_PROPERTY(QRectF rectProperty MEMBER m_rectProperty NOTIFY rectPropertyChanged)
+ Q_PROPERTY(QColor colorProperty MEMBER m_colorProperty NOTIFY colorPropertyChanged)
+ Q_PROPERTY(QFont fontProperty MEMBER m_fontProperty NOTIFY fontPropertyChanged)
public:
CppObject(QObject *parent = 0) : QObject(parent),
@@ -83,8 +94,10 @@ public:
m_doubleProperty(3.45),
m_stringProperty("foo"),
m_urlProperty("http://www.qt-project.org"),
+ m_objectProperty(keyValueMap("foo", "bar")),
m_intListProperty(QVariantList() << 1 << 2 << 3),
m_stringListProperty(QVariantList() << "a" << "b" << "c"),
+ m_objectListProperty(QVariantList() << keyValueMap("a", "b") << keyValueMap("c", "d")),
m_dateProperty(2000, 1, 2),
// QTBUG-32295: m_timeProperty(12, 34, 56),
m_sizeProperty(12, 34),
@@ -94,143 +107,6 @@ public:
{
}
- int intProperty() const { return m_intProperty; }
- bool boolProperty() const { return m_boolProperty; }
- qreal realProperty() const { return m_realProperty; }
- double doubleProperty() const { return m_doubleProperty; }
- QString stringProperty() const { return m_stringProperty; }
- QUrl urlProperty() const { return m_urlProperty; }
- QVariant varProperty() const { return m_varProperty; }
- QVariantList intListProperty() const { return m_intListProperty; }
- QVariantList stringListProperty() const { return m_stringListProperty; }
- QDate dateProperty() const { return m_dateProperty; }
- QSizeF sizeProperty() const { return m_sizeProperty; }
- QPointF pointProperty() const { return m_pointProperty; }
- QRectF rectProperty() const { return m_rectProperty; }
- QColor colorProperty() const { return m_colorProperty; }
- QFont fontProperty() const { return m_fontProperty; }
-
-public slots:
- void setIntProperty(int arg)
- {
- if (m_intProperty != arg) {
- m_intProperty = arg;
- emit intPropertyChanged(arg);
- }
- }
-
- void setBoolProperty(bool arg)
- {
- if (m_boolProperty != arg) {
- m_boolProperty = arg;
- emit boolPropertyChanged(arg);
- }
- }
-
- void setRealProperty(qreal arg)
- {
- if (m_realProperty != arg) {
- m_realProperty = arg;
- emit realPropertyChanged(arg);
- }
- }
-
- void setDoubleProperty(double arg)
- {
- if (m_doubleProperty != arg) {
- m_doubleProperty = arg;
- emit doublePropertyChanged(arg);
- }
- }
-
- void setStringProperty(const QString &arg)
- {
- if (m_stringProperty != arg) {
- m_stringProperty = arg;
- emit stringPropertyChanged(arg);
- }
- }
-
- void setUrlProperty(const QUrl &arg)
- {
- if (m_urlProperty != arg) {
- m_urlProperty = arg;
- emit urlPropertyChanged(arg);
- }
- }
-
- void setVarProperty(const QVariant &arg)
- {
- if (m_varProperty != arg) {
- m_varProperty = arg;
- emit varPropertyChanged(arg);
- }
- }
-
- void setIntListProperty(const QVariantList &arg)
- {
- if (m_intListProperty != arg) {
- m_intListProperty = arg;
- emit intListPropertyChanged(arg);
- }
- }
-
- void setStringListProperty(const QVariantList &arg)
- {
- if (m_stringListProperty != arg) {
- m_stringListProperty = arg;
- emit stringListPropertyChanged(arg);
- }
- }
-
- void setDateProperty(const QDate &arg)
- {
- if (m_dateProperty != arg) {
- m_dateProperty = arg;
- emit datePropertyChanged(arg);
- }
- }
-
- void setSizeProperty(const QSizeF &arg)
- {
- if (m_sizeProperty != arg) {
- m_sizeProperty = arg;
- emit sizePropertyChanged(arg);
- }
- }
-
- void setPointProperty(const QPointF &arg)
- {
- if (m_pointProperty != arg) {
- m_pointProperty = arg;
- emit pointPropertyChanged(arg);
- }
- }
-
- void setRectProperty(const QRectF &arg)
- {
- if (m_rectProperty != arg) {
- m_rectProperty = arg;
- emit rectPropertyChanged(arg);
- }
- }
-
- void setColorProperty(const QColor &arg)
- {
- if (m_colorProperty != arg) {
- m_colorProperty = arg;
- emit colorPropertyChanged(arg);
- }
- }
-
- void setFontProperty(const QFont &arg)
- {
- if (m_fontProperty != arg) {
- m_fontProperty = arg;
- emit fontPropertyChanged(arg);
- }
- }
-
signals:
void intPropertyChanged(int arg);
void boolPropertyChanged(bool arg);
@@ -239,8 +115,10 @@ signals:
void stringPropertyChanged(const QString &arg);
void urlPropertyChanged(const QUrl &arg);
void varPropertyChanged(const QVariant &arg);
+ void objectPropertyChanged(const QVariantMap &arg);
void intListPropertyChanged(const QVariantList &arg);
void stringListPropertyChanged(const QVariantList &arg);
+ void objectListPropertyChanged(const QVariantList &arg);
void datePropertyChanged(const QDate &arg);
void sizePropertyChanged(const QSizeF &arg);
void pointPropertyChanged(const QPointF &arg);
@@ -256,8 +134,10 @@ private:
QString m_stringProperty;
QUrl m_urlProperty;
QVariant m_varProperty;
+ QVariantMap m_objectProperty;
QVariantList m_intListProperty;
QVariantList m_stringListProperty;
+ QVariantList m_objectListProperty;
QDate m_dateProperty;
QSizeF m_sizeProperty;
QPointF m_pointProperty;
@@ -316,8 +196,10 @@ void tst_QQmlSettings::types()
QCOMPARE(root->property("doubleProperty").toDouble(), static_cast<double>(0.0));
QCOMPARE(root->property("stringProperty").toString(), QString());
QCOMPARE(root->property("urlProperty").toUrl(), QUrl());
+ QCOMPARE(root->property("objectProperty").toMap(), QVariantMap());
QCOMPARE(root->property("intListProperty").toList(), QVariantList());
QCOMPARE(root->property("stringListProperty").toList(), QVariantList());
+ QCOMPARE(root->property("objectListProperty").toList(), QVariantList());
QCOMPARE(root->property("dateProperty").toDate(), QDate());
// QTBUG-32295: QCOMPARE(root->property("timeProperty").toDate(), QTime());
QCOMPARE(root->property("sizeProperty").toSizeF(), QSizeF());
@@ -333,8 +215,10 @@ void tst_QQmlSettings::types()
QCOMPARE(settings->property("doubleProperty").toDouble(), static_cast<double>(3.45));
QCOMPARE(settings->property("stringProperty").toString(), QStringLiteral("foo"));
QCOMPARE(settings->property("urlProperty").toUrl(), QUrl("http://www.qt-project.org"));
+ QCOMPARE(settings->property("objectProperty").toMap(), keyValueMap("foo","bar"));
QCOMPARE(settings->property("intListProperty").toList(), QVariantList() << 1 << 2 << 3);
QCOMPARE(settings->property("stringListProperty").toList(), QVariantList() << QStringLiteral("a") << QStringLiteral("b") << QStringLiteral("c"));
+ QCOMPARE(settings->property("objectListProperty").toList(), QVariantList() << keyValueMap("a", "b") << keyValueMap("c","d"));
QCOMPARE(settings->property("dateProperty").toDate(), QDate(2000, 01, 02));
// QTBUG-32295: QCOMPARE(settings->property("timeProperty").toDate(), QTime(12, 34, 56));
QCOMPARE(settings->property("sizeProperty").toSizeF(), QSizeF(12, 34));
@@ -351,9 +235,11 @@ void tst_QQmlSettings::types()
QCOMPARE(root->property("doubleProperty").toDouble(), static_cast<double>(3.45));
QCOMPARE(root->property("stringProperty").toString(), QStringLiteral("foo"));
QCOMPARE(root->property("urlProperty").toUrl(), QUrl("http://www.qt-project.org"));
+ QCOMPARE(root->property("objectProperty").toMap(), keyValueMap("foo","bar"));
QCOMPARE(root->property("intListProperty").toList(), QVariantList() << 1 << 2 << 3);
QCOMPARE(root->property("stringListProperty").toList(), QVariantList() << QStringLiteral("a") << QStringLiteral("b") << QStringLiteral("c"));
QCOMPARE(root->property("dateProperty").toDate(), QDate(2000, 01, 02));
+ QCOMPARE(root->property("objectListProperty").toList(), QVariantList() << keyValueMap("a", "b") << keyValueMap("c","d"));
// QTBUG-32295: QCOMPARE(root->property("timeProperty").toDate(), QTime(12, 34, 56));
QCOMPARE(root->property("sizeProperty").toSizeF(), QSizeF(12, 34));
QCOMPARE(root->property("pointProperty").toPointF(), QPointF(12, 34));
@@ -368,8 +254,10 @@ void tst_QQmlSettings::types()
QVERIFY(root->setProperty("doubleProperty", static_cast<double>(6.78)));
QVERIFY(root->setProperty("stringProperty", QStringLiteral("bar")));
QVERIFY(root->setProperty("urlProperty", QUrl("https://codereview.qt-project.org")));
+ QVERIFY(root->setProperty("objectProperty", keyValueMap("bar", "baz")));
QVERIFY(root->setProperty("intListProperty", QVariantList() << 4 << 5 << 6));
QVERIFY(root->setProperty("stringListProperty", QVariantList() << QStringLiteral("d") << QStringLiteral("e") << QStringLiteral("f")));
+ QVERIFY(root->setProperty("objectListProperty", QVariantList() << keyValueMap("e", "f") << keyValueMap("g", "h")));
QVERIFY(root->setProperty("dateProperty", QDate(2010, 02, 01)));
// QTBUG-32295: QVERIFY(root->setProperty("timeProperty", QTime(6, 56, 34)));
QVERIFY(root->setProperty("sizeProperty", QSizeF(56, 78)));
@@ -387,8 +275,10 @@ void tst_QQmlSettings::types()
QTRY_COMPARE(settings->property("doubleProperty").toDouble(), static_cast<double>(6.78));
QTRY_COMPARE(settings->property("stringProperty").toString(), QStringLiteral("bar"));
QTRY_COMPARE(settings->property("urlProperty").toUrl(), QUrl("https://codereview.qt-project.org"));
+ QTRY_COMPARE(settings->property("objectProperty").toMap(), keyValueMap("bar", "baz"));
QTRY_COMPARE(settings->property("intListProperty").toList(), QVariantList() << 4 << 5 << 6);
QTRY_COMPARE(settings->property("stringListProperty").toList(), QVariantList() << QStringLiteral("d") << QStringLiteral("e") << QStringLiteral("f"));
+ QTRY_COMPARE(settings->property("objectListProperty").toList(), QVariantList() << keyValueMap("e", "f") << keyValueMap("g", "h"));
QTRY_COMPARE(settings->property("dateProperty").toDate(), QDate(2010, 02, 01));
// QTBUG-32295: QTRY_COMPARE(settings->property("timeProperty").toDate(), QTime(6, 56, 34));
QTRY_COMPARE(settings->property("sizeProperty").toSizeF(), QSizeF(56, 78));
@@ -404,8 +294,10 @@ void tst_QQmlSettings::types()
QTRY_COMPARE(qs.value("doubleProperty").toDouble(), static_cast<double>(6.78));
QTRY_COMPARE(qs.value("stringProperty").toString(), QStringLiteral("bar"));
QTRY_COMPARE(qs.value("urlProperty").toUrl(), QUrl("https://codereview.qt-project.org"));
+ QTRY_COMPARE(qs.value("objectProperty").toMap(), keyValueMap("bar", "baz"));
QTRY_COMPARE(qs.value("intListProperty").toList(), QVariantList() << 4 << 5 << 6);
QTRY_COMPARE(qs.value("stringListProperty").toList(), QVariantList() << QStringLiteral("d") << QStringLiteral("e") << QStringLiteral("f"));
+ QTRY_COMPARE(qs.value("objectListProperty").toList(), QVariantList() << keyValueMap("e", "f") << keyValueMap("g", "h"));
QTRY_COMPARE(qs.value("dateProperty").toDate(), QDate(2010, 02, 01));
// QTBUG-32295: QTRY_COMPARE(qs.value("timeProperty").toDate(), QTime(6, 56, 34));
QTRY_COMPARE(qs.value("sizeProperty").toSizeF(), QSizeF(56, 78));
@@ -440,8 +332,10 @@ void tst_QQmlSettings::aliases()
QCOMPARE(root->property("doubleProperty").toDouble(), static_cast<double>(3.45));
QCOMPARE(root->property("stringProperty").toString(), QStringLiteral("foo"));
QCOMPARE(root->property("urlProperty").toUrl(), QUrl("http://www.qt-project.org"));
+ QCOMPARE(root->property("objectProperty").toMap(), keyValueMap("foo","bar"));
QCOMPARE(root->property("intListProperty").toList(), QVariantList() << 1 << 2 << 3);
QCOMPARE(root->property("stringListProperty").toList(), QVariantList() << QStringLiteral("a") << QStringLiteral("b") << QStringLiteral("c"));
+ QCOMPARE(root->property("objectListProperty").toList(), QVariantList() << keyValueMap("a", "b") << keyValueMap("c","d"));
QCOMPARE(root->property("dateProperty").toDate(), QDate(2000, 01, 02));
// QTBUG-32295: QCOMPARE(root->property("timeProperty").toDate(), QTime(12, 34, 56));
QCOMPARE(root->property("sizeProperty").toSizeF(), QSizeF(12, 34));
@@ -457,8 +351,10 @@ void tst_QQmlSettings::aliases()
QCOMPARE(settings->property("doubleProperty").toDouble(), static_cast<double>(3.45));
QCOMPARE(settings->property("stringProperty").toString(), QStringLiteral("foo"));
QCOMPARE(settings->property("urlProperty").toUrl(), QUrl("http://www.qt-project.org"));
+ QCOMPARE(settings->property("objectProperty").toMap(), keyValueMap("foo","bar"));
QCOMPARE(settings->property("intListProperty").toList(), QVariantList() << 1 << 2 << 3);
QCOMPARE(settings->property("stringListProperty").toList(), QVariantList() << QStringLiteral("a") << QStringLiteral("b") << QStringLiteral("c"));
+ QCOMPARE(settings->property("objectListProperty").toList(), QVariantList() << keyValueMap("a", "b") << keyValueMap("c","d"));
QCOMPARE(settings->property("dateProperty").toDate(), QDate(2000, 01, 02));
// QTBUG-32295: QCOMPARE(settings->property("timeProperty").toDate(), QTime(12, 34, 56));
QCOMPARE(settings->property("sizeProperty").toSizeF(), QSizeF(12, 34));
@@ -474,8 +370,10 @@ void tst_QQmlSettings::aliases()
QVERIFY(settings->setProperty("doubleProperty", static_cast<double>(6.78)));
QVERIFY(settings->setProperty("stringProperty", QStringLiteral("bar")));
QVERIFY(settings->setProperty("urlProperty", QUrl("https://codereview.qt-project.org")));
+ QVERIFY(settings->setProperty("objectProperty", keyValueMap("bar", "baz")));
QVERIFY(settings->setProperty("intListProperty", QVariantList() << 4 << 5 << 6));
QVERIFY(settings->setProperty("stringListProperty", QVariantList() << QStringLiteral("d") << QStringLiteral("e") << QStringLiteral("f")));
+ QVERIFY(settings->setProperty("objectListProperty", QVariantList() << keyValueMap("e", "f") << keyValueMap("g", "h")));
QVERIFY(settings->setProperty("dateProperty", QDate(2010, 02, 01)));
// QTBUG-32295: QVERIFY(settings->setProperty("timeProperty", QTime(6, 56, 34)));
QVERIFY(settings->setProperty("sizeProperty", QSizeF(56, 78)));
@@ -492,8 +390,10 @@ void tst_QQmlSettings::aliases()
QTRY_COMPARE(qs.value("doubleProperty").toDouble(), static_cast<double>(6.78));
QTRY_COMPARE(qs.value("stringProperty").toString(), QStringLiteral("bar"));
QTRY_COMPARE(qs.value("urlProperty").toUrl(), QUrl("https://codereview.qt-project.org"));
+ QTRY_COMPARE(qs.value("objectProperty").toMap(), keyValueMap("bar", "baz"));
QTRY_COMPARE(qs.value("intListProperty").toList(), QVariantList() << 4 << 5 << 6);
QTRY_COMPARE(qs.value("stringListProperty").toList(), QVariantList() << QStringLiteral("d") << QStringLiteral("e") << QStringLiteral("f"));
+ QTRY_COMPARE(qs.value("objectListProperty").toList(), QVariantList() << keyValueMap("e", "f") << keyValueMap("g", "h"));
QTRY_COMPARE(qs.value("dateProperty").toDate(), QDate(2010, 02, 01));
// QTBUG-32295: QTRY_COMPARE(qs.value("timeProperty").toDate(), QTime(6, 56, 34));
QTRY_COMPARE(qs.value("sizeProperty").toSizeF(), QSizeF(56, 78));
diff --git a/tests/auto/qml/qqmlxmlhttprequest/data/send_patch.qml b/tests/auto/qml/qqmlxmlhttprequest/data/send_patch.qml
index 2abf1c60a8..dd4dd435a5 100644
--- a/tests/auto/qml/qqmlxmlhttprequest/data/send_patch.qml
+++ b/tests/auto/qml/qqmlxmlhttprequest/data/send_patch.qml
@@ -1,31 +1,26 @@
/****************************************************************************
**
-** Copyright (C) 2015 Canonical Limited and/or its subsidiary(-ies).
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2017 Canonical Limited and/or its subsidiary(-ies).
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL21$
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 or version 3 as published by the Free
-** Software Foundation and appearing in the file LICENSE.LGPLv21 and
-** LICENSE.LGPLv3 included in the packaging of this file. Please review the
-** following information to ensure the GNU Lesser General Public License
-** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** As a special exception, The Qt Company gives you certain additional
-** rights. These rights are described in The Qt Company LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp b/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp
index 63da28b7ba..49135ca920 100644
--- a/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp
+++ b/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp
@@ -250,7 +250,7 @@ void tst_QQuickWorkerScript::scriptError_onLoad()
QVERIFY(worker != 0);
QTRY_COMPARE(qquickworkerscript_lastWarning,
- testFileUrl("script_error_onLoad.js").toString() + QLatin1String(":3:10: Expected token `,'"));
+ testFileUrl("script_error_onLoad.js").toString() + QLatin1String(":3:10: SyntaxError: Expected token `,'"));
qInstallMessageHandler(previousMsgHandler);
qApp->processEvents();
diff --git a/tests/auto/qmltest/statemachine/tst_signaltransition.qml b/tests/auto/qmltest/statemachine/tst_signaltransition.qml
index 0e35207670..a57826855a 100644
--- a/tests/auto/qmltest/statemachine/tst_signaltransition.qml
+++ b/tests/auto/qmltest/statemachine/tst_signaltransition.qml
@@ -1,32 +1,27 @@
/****************************************************************************
**
-** Copyright (C) 2014 Ford Motor Company
-** Copyright (C) 2016 The Qt Company
+** Copyright (C) 2017 Ford Motor Company
+** Copyright (C) 2017 The Qt Company
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL21$
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 or version 3 as published by the Free
-** Software Foundation and appearing in the file LICENSE.LGPLv21 and
-** LICENSE.LGPLv3 included in the packaging of this file. Please review the
-** following information to ensure the GNU Lesser General Public License
-** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** As a special exception, The Qt Company gives you certain additional
-** rights. These rights are described in The Qt Company LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/tests/auto/qmltest/statemachine/tst_triggeredArguments1.qml b/tests/auto/qmltest/statemachine/tst_triggeredArguments1.qml
index 5d2e867da4..34c172aded 100644
--- a/tests/auto/qmltest/statemachine/tst_triggeredArguments1.qml
+++ b/tests/auto/qmltest/statemachine/tst_triggeredArguments1.qml
@@ -1,31 +1,26 @@
/****************************************************************************
**
-** Copyright (C) 2016 Ford Motor Company
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2017 Ford Motor Company
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL21$
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 or version 3 as published by the Free
-** Software Foundation and appearing in the file LICENSE.LGPLv21 and
-** LICENSE.LGPLv3 included in the packaging of this file. Please review the
-** following information to ensure the GNU Lesser General Public License
-** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** As a special exception, The Qt Company gives you certain additional
-** rights. These rights are described in The Qt Company LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/tests/auto/qmltest/statemachine/tst_triggeredArguments2.qml b/tests/auto/qmltest/statemachine/tst_triggeredArguments2.qml
index f60f2ff78c..73bc653404 100644
--- a/tests/auto/qmltest/statemachine/tst_triggeredArguments2.qml
+++ b/tests/auto/qmltest/statemachine/tst_triggeredArguments2.qml
@@ -1,31 +1,26 @@
/****************************************************************************
**
-** Copyright (C) 2016 Ford Motor Company
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2017 Ford Motor Company
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL21$
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 or version 3 as published by the Free
-** Software Foundation and appearing in the file LICENSE.LGPLv21 and
-** LICENSE.LGPLv3 included in the packaging of this file. Please review the
-** following information to ensure the GNU Lesser General Public License
-** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** As a special exception, The Qt Company gives you certain additional
-** rights. These rights are described in The Qt Company LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/tests/auto/quick/qquickanimatedsprite/data/sourceSwitch.qml b/tests/auto/quick/qquickanimatedsprite/data/sourceSwitch.qml
index 18a8f52661..c81a765c7e 100644
--- a/tests/auto/quick/qquickanimatedsprite/data/sourceSwitch.qml
+++ b/tests/auto/quick/qquickanimatedsprite/data/sourceSwitch.qml
@@ -1,31 +1,26 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL21$
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 or version 3 as published by the Free
-** Software Foundation and appearing in the file LICENSE.LGPLv21 and
-** LICENSE.LGPLv3 included in the packaging of this file. Please review the
-** following information to ensure the GNU Lesser General Public License
-** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** As a special exception, The Qt Company gives you certain additional
-** rights. These rights are described in The Qt Company LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/tests/auto/quick/qquickanimators/data/positionerWithAnimator.qml b/tests/auto/quick/qquickanimators/data/positionerWithAnimator.qml
index bfd475266e..bd3b42b397 100644
--- a/tests/auto/quick/qquickanimators/data/positionerWithAnimator.qml
+++ b/tests/auto/quick/qquickanimators/data/positionerWithAnimator.qml
@@ -1,31 +1,26 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL21$
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 or version 3 as published by the Free
-** Software Foundation and appearing in the file LICENSE.LGPLv21 and
-** LICENSE.LGPLv3 included in the packaging of this file. Please review the
-** following information to ensure the GNU Lesser General Public License
-** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** As a special exception, The Qt Company gives you certain additional
-** rights. These rights are described in The Qt Company LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/tests/auto/quick/qquickapplication/BLACKLIST b/tests/auto/quick/qquickapplication/BLACKLIST
deleted file mode 100644
index 81592db56f..0000000000
--- a/tests/auto/quick/qquickapplication/BLACKLIST
+++ /dev/null
@@ -1,2 +0,0 @@
-[active]
-osx-10.11
diff --git a/tests/auto/quick/qquickapplication/data/tst_platformname.qml b/tests/auto/quick/qquickapplication/data/tst_platformname.qml
new file mode 100644
index 0000000000..1bcd66ac8d
--- /dev/null
+++ b/tests/auto/quick/qquickapplication/data/tst_platformname.qml
@@ -0,0 +1,6 @@
+import QtQuick 2.0;
+
+Item {
+ id: root;
+ property string platformName: Qt.platform.pluginName
+}
diff --git a/tests/auto/quick/qquickapplication/qquickapplication.pro b/tests/auto/quick/qquickapplication/qquickapplication.pro
index c47f5472b7..00b5bb3a18 100644
--- a/tests/auto/quick/qquickapplication/qquickapplication.pro
+++ b/tests/auto/quick/qquickapplication/qquickapplication.pro
@@ -3,7 +3,8 @@ TARGET = tst_qquickapplication
macx:CONFIG -= app_bundle
SOURCES += tst_qquickapplication.cpp
-OTHER_FILES += data/tst_displayname.qml
+OTHER_FILES += data/tst_displayname.qml \
+ data/tst_platformname.qml
include (../../shared/util.pri)
diff --git a/tests/auto/quick/qquickapplication/tst_qquickapplication.cpp b/tests/auto/quick/qquickapplication/tst_qquickapplication.cpp
index d780b91260..e428a1fc6e 100644
--- a/tests/auto/quick/qquickapplication/tst_qquickapplication.cpp
+++ b/tests/auto/quick/qquickapplication/tst_qquickapplication.cpp
@@ -53,6 +53,7 @@ private slots:
void styleHints();
void cleanup();
void displayName();
+ void platformName();
private:
QQmlEngine engine;
@@ -264,6 +265,24 @@ void tst_qquickapplication::displayName()
QCOMPARE(QGuiApplication::applicationDisplayName(), name[2]);
}
+void tst_qquickapplication::platformName()
+{
+ // Set up QML component
+ QQmlComponent component(&engine, testFileUrl("tst_platformname.qml"));
+ QQuickItem *item = qobject_cast<QQuickItem *>(component.create());
+ QVERIFY(item);
+ QQuickView view;
+ item->setParentItem(view.rootObject());
+
+ // Get native platform name
+ QString guiApplicationPlatformName = QGuiApplication::platformName();
+ QVERIFY(!guiApplicationPlatformName.isEmpty());
+
+ // Get platform name from QML component and verify it's same
+ QString qmlPlatformName = qvariant_cast<QString>(item->property("platformName"));
+ QCOMPARE(qmlPlatformName, guiApplicationPlatformName);
+}
+
QTEST_MAIN(tst_qquickapplication)
#include "tst_qquickapplication.moc"
diff --git a/tests/auto/quick/qquickfocusscope/BLACKLIST b/tests/auto/quick/qquickfocusscope/BLACKLIST
new file mode 100644
index 0000000000..cc3c8b6e8a
--- /dev/null
+++ b/tests/auto/quick/qquickfocusscope/BLACKLIST
@@ -0,0 +1,2 @@
+[canvasFocus]
+osx-10.11
diff --git a/tests/auto/quick/qquickitem/data/childAtRectangle.qml b/tests/auto/quick/qquickitem/data/childAtRectangle.qml
index d459c2b3f1..2aaaedb06f 100644
--- a/tests/auto/quick/qquickitem/data/childAtRectangle.qml
+++ b/tests/auto/quick/qquickitem/data/childAtRectangle.qml
@@ -1,31 +1,26 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL21$
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 or version 3 as published by the Free
-** Software Foundation and appearing in the file LICENSE.LGPLv21 and
-** LICENSE.LGPLv3 included in the packaging of this file. Please review the
-** following information to ensure the GNU Lesser General Public License
-** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** As a special exception, The Qt Company gives you certain additional
-** rights. These rights are described in The Qt Company LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/tests/auto/quick/qquickitem/data/shortcutOverride.qml b/tests/auto/quick/qquickitem/data/shortcutOverride.qml
index fab9175c17..247b5fea04 100644
--- a/tests/auto/quick/qquickitem/data/shortcutOverride.qml
+++ b/tests/auto/quick/qquickitem/data/shortcutOverride.qml
@@ -1,31 +1,26 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL21$
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 or version 3 as published by the Free
-** Software Foundation and appearing in the file LICENSE.LGPLv21 and
-** LICENSE.LGPLv3 included in the packaging of this file. Please review the
-** following information to ensure the GNU Lesser General Public License
-** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** As a special exception, The Qt Company gives you certain additional
-** rights. These rights are described in The Qt Company LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/tests/auto/quick/qquickitem2/data/nonexistentPropertyConnection.qml b/tests/auto/quick/qquickitem2/data/nonexistentPropertyConnection.qml
new file mode 100644
index 0000000000..ed0632a68a
--- /dev/null
+++ b/tests/auto/quick/qquickitem2/data/nonexistentPropertyConnection.qml
@@ -0,0 +1,11 @@
+import QtQuick 2.4
+
+Item {
+ function hint() {
+ }
+
+ Connections {
+ target: BlaBlaBla
+ onHint: hint();
+ }
+}
diff --git a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
index cc74b7e07d..09e89ff85f 100644
--- a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
+++ b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
@@ -98,6 +98,7 @@ private slots:
void mapCoordinatesRect();
void mapCoordinatesRect_data();
void propertyChanges();
+ void nonexistentPropertyConnection();
void transforms();
void transforms_data();
void childrenRect();
@@ -2612,6 +2613,15 @@ void tst_QQuickItem::propertyChanges()
delete window;
}
+void tst_QQuickItem::nonexistentPropertyConnection()
+{
+ // QTBUG-56551: don't crash
+ QQmlComponent component(&engine, testFileUrl("nonexistentPropertyConnection.qml"));
+ QObject *o = component.create();
+ QVERIFY(o);
+ delete o;
+}
+
void tst_QQuickItem::childrenRect()
{
QQuickView *window = new QQuickView(0);
diff --git a/tests/auto/quick/qquickrectangle/data/gradient-multiple.qml b/tests/auto/quick/qquickrectangle/data/gradient-multiple.qml
new file mode 100644
index 0000000000..d58c857008
--- /dev/null
+++ b/tests/auto/quick/qquickrectangle/data/gradient-multiple.qml
@@ -0,0 +1,30 @@
+import QtQuick 2.0
+
+Item {
+ property alias firstRectangle: r1
+ property alias secondRectangle: r2
+ Rectangle {
+ id: r1
+ gradient: someObject.someGradient
+ anchors.fill: parent
+ }
+ Rectangle {
+ id: r2
+ gradient: someObject.someGradient
+ anchors.fill: parent
+ }
+
+ function changeGradient() {
+ firstStop.color = "red"
+ secondStop.color = "blue"
+ }
+
+ QtObject {
+ id: someObject
+ property Gradient someGradient: Gradient {
+ GradientStop { id: firstStop; position: 0.0; color: "gray" }
+ GradientStop { id: secondStop; position: 1.0; color: "white" }
+ }
+ }
+}
+
diff --git a/tests/auto/quick/qquickrectangle/data/gradient-separate.qml b/tests/auto/quick/qquickrectangle/data/gradient-separate.qml
new file mode 100644
index 0000000000..8ae3f3296b
--- /dev/null
+++ b/tests/auto/quick/qquickrectangle/data/gradient-separate.qml
@@ -0,0 +1,20 @@
+import QtQuick 2.0
+
+Rectangle {
+
+ function changeGradient() {
+ firstStop.color = "red"
+ secondStop.color = "blue"
+ }
+
+ QtObject {
+ id: someObject
+ property Gradient someGradient: Gradient {
+ GradientStop { id: firstStop; position: 0.0; color: "gray" }
+ GradientStop { id: secondStop; position: 1.0; color: "white" }
+ }
+ }
+
+ gradient: someObject.someGradient
+}
+
diff --git a/tests/auto/quick/qquickrectangle/tst_qquickrectangle.cpp b/tests/auto/quick/qquickrectangle/tst_qquickrectangle.cpp
index 65c7e387a0..0d79592e37 100644
--- a/tests/auto/quick/qquickrectangle/tst_qquickrectangle.cpp
+++ b/tests/auto/quick/qquickrectangle/tst_qquickrectangle.cpp
@@ -32,6 +32,7 @@
#include <QtQml/qqmlengine.h>
#include <QtQml/qqmlcomponent.h>
#include <QtQuick/qquickview.h>
+#include <private/qquickitem_p.h>
#include <private/qquickrectangle_p.h>
#include "../../shared/util.h"
@@ -46,6 +47,8 @@ private slots:
void color();
void gradient();
void gradient_border();
+ void gradient_separate();
+ void gradient_multiple();
void antialiasing();
private:
@@ -111,6 +114,62 @@ void tst_qquickrectangle::gradient_border()
QVERIFY(QTest::qWaitForWindowExposed(&view));
}
+// A gradient not defined inline with the Rectangle using it should still change
+// that Rectangle.
+void tst_qquickrectangle::gradient_separate()
+{
+ QQuickView view;
+ view.setSource(testFileUrl("gradient-separate.qml"));
+ view.show();
+
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
+
+ QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(view.rootObject());
+ QVERIFY(rect);
+
+ // Start off clean
+ QQuickItemPrivate *rectPriv = QQuickItemPrivate::get(rect);
+ bool isDirty = rectPriv->dirtyAttributes & QQuickItemPrivate::Content;
+ QVERIFY(!isDirty);
+
+ QMetaObject::invokeMethod(rect, "changeGradient");
+
+ // Changing the gradient should have scheduled an update of the item.
+ isDirty = rectPriv->dirtyAttributes & QQuickItemPrivate::Content;
+ QVERIFY(isDirty);
+}
+
+// When a gradient is changed, every Rectangle connected to it must update.
+void tst_qquickrectangle::gradient_multiple()
+{
+ QQuickView view;
+ view.setSource(testFileUrl("gradient-multiple.qml"));
+ view.show();
+
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
+
+ QQuickRectangle *firstRect = qobject_cast<QQuickRectangle*>(view.rootObject()->property("firstRectangle").value<QObject*>());
+ QQuickRectangle *secondRect = qobject_cast<QQuickRectangle*>(view.rootObject()->property("secondRectangle").value<QObject*>());
+ QVERIFY(firstRect);
+ QVERIFY(secondRect);
+
+ // Start off clean
+ QQuickItemPrivate *firstRectPriv = QQuickItemPrivate::get(firstRect);
+ QQuickItemPrivate *secondRectPriv = QQuickItemPrivate::get(secondRect);
+ bool firstIsDirty = firstRectPriv->dirtyAttributes & QQuickItemPrivate::Content;
+ bool secondIsDirty = secondRectPriv->dirtyAttributes & QQuickItemPrivate::Content;
+ QVERIFY(!firstIsDirty);
+ QVERIFY(!secondIsDirty);
+
+ QMetaObject::invokeMethod(view.rootObject(), "changeGradient");
+
+ // Changing the gradient should have scheduled an update of both items
+ firstIsDirty = firstRectPriv->dirtyAttributes & QQuickItemPrivate::Content;
+ secondIsDirty = secondRectPriv->dirtyAttributes & QQuickItemPrivate::Content;
+ QVERIFY(firstIsDirty);
+ QVERIFY(secondIsDirty);
+}
+
void tst_qquickrectangle::antialiasing()
{
QQmlComponent component(&engine);
diff --git a/tests/auto/quick/qquickview/data/findChild.qml b/tests/auto/quick/qquickview/data/findChild.qml
new file mode 100644
index 0000000000..8cbc46abe2
--- /dev/null
+++ b/tests/auto/quick/qquickview/data/findChild.qml
@@ -0,0 +1,9 @@
+import QtQuick 2.0
+Item {
+ width: 200
+ height: 200
+ objectName: "rootObject"
+ Item {
+ objectName: "rootObjectChild"
+ }
+}
diff --git a/tests/auto/quick/qquickview/tst_qquickview.cpp b/tests/auto/quick/qquickview/tst_qquickview.cpp
index fa9192edb4..04d21457e6 100644
--- a/tests/auto/quick/qquickview/tst_qquickview.cpp
+++ b/tests/auto/quick/qquickview/tst_qquickview.cpp
@@ -70,6 +70,7 @@ private slots:
void resizemodeitem();
void errors();
void engine();
+ void findChild();
};
@@ -265,6 +266,45 @@ void tst_QQuickView::engine()
delete view4;
}
+void tst_QQuickView::findChild()
+{
+ QQuickView view;
+ view.setSource(testFileUrl("findChild.qml"));
+
+ // QQuickView
+ // |_ QQuickWindow::contentItem
+ // | |_ QQuickView::rootObject: QML Item("rootObject") (findChild.qml)
+ // | | |_ QML Item("rootObjectChild") (findChild.qml)
+ // | |_ QObject("contentItemChild")
+ // |_ QObject("viewChild")
+
+ QObject *viewChild = new QObject(&view);
+ viewChild->setObjectName("viewChild");
+
+ QObject *contentItemChild = new QObject(view.contentItem());
+ contentItemChild->setObjectName("contentItemChild");
+
+ QObject *rootObject = view.rootObject();
+ QVERIFY(rootObject);
+
+ QObject *rootObjectChild = rootObject->findChild<QObject *>("rootObjectChild");
+ QVERIFY(rootObjectChild);
+
+ QCOMPARE(view.findChild<QObject *>("viewChild"), viewChild);
+ QCOMPARE(view.findChild<QObject *>("contentItemChild"), contentItemChild);
+ QCOMPARE(view.findChild<QObject *>("rootObject"), rootObject);
+ QCOMPARE(view.findChild<QObject *>("rootObjectChild"), rootObjectChild);
+
+ QVERIFY(!view.contentItem()->findChild<QObject *>("viewChild")); // sibling
+ QCOMPARE(view.contentItem()->findChild<QObject *>("contentItemChild"), contentItemChild);
+ QCOMPARE(view.contentItem()->findChild<QObject *>("rootObject"), rootObject);
+ QCOMPARE(view.contentItem()->findChild<QObject *>("rootObjectChild"), rootObjectChild);
+
+ QVERIFY(!view.rootObject()->findChild<QObject *>("viewChild")); // ancestor
+ QVERIFY(!view.rootObject()->findChild<QObject *>("contentItemChild")); // cousin
+ QVERIFY(!view.rootObject()->findChild<QObject *>("rootObject")); // self
+}
+
QTEST_MAIN(tst_QQuickView)
#include "tst_qquickview.moc"
diff --git a/tests/auto/quick/qquickwindow/BLACKLIST b/tests/auto/quick/qquickwindow/BLACKLIST
deleted file mode 100644
index 157808fdbf..0000000000
--- a/tests/auto/quick/qquickwindow/BLACKLIST
+++ /dev/null
@@ -1,4 +0,0 @@
-[requestActivate]
-osx-10.11
-[attachedProperty]
-osx-10.11
diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
index d454f9b7bc..91d577fb6f 100644
--- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
+++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
@@ -375,6 +375,8 @@ private slots:
void testDragEventPropertyPropagation();
+ void findChild();
+
private:
QTouchDevice *touchDevice;
QTouchDevice *touchDeviceWithVelocity;
@@ -2825,6 +2827,28 @@ void tst_qquickwindow::testDragEventPropertyPropagation()
}
}
+void tst_qquickwindow::findChild()
+{
+ QQuickWindow window;
+
+ // QQuickWindow
+ // |_ QQuickWindow::contentItem
+ // | |_ QObject("contentItemChild")
+ // |_ QObject("viewChild")
+
+ QObject *windowChild = new QObject(&window);
+ windowChild->setObjectName("windowChild");
+
+ QObject *contentItemChild = new QObject(window.contentItem());
+ contentItemChild->setObjectName("contentItemChild");
+
+ QCOMPARE(window.findChild<QObject *>("windowChild"), windowChild);
+ QCOMPARE(window.findChild<QObject *>("contentItemChild"), contentItemChild);
+
+ QVERIFY(!window.contentItem()->findChild<QObject *>("viewChild")); // sibling
+ QCOMPARE(window.contentItem()->findChild<QObject *>("contentItemChild"), contentItemChild);
+}
+
QTEST_MAIN(tst_qquickwindow)
#include "tst_qquickwindow.moc"
diff --git a/tests/auto/quick/touchmouse/tst_touchmouse.cpp b/tests/auto/quick/touchmouse/tst_touchmouse.cpp
index 671cefd6f5..39f2961927 100644
--- a/tests/auto/quick/touchmouse/tst_touchmouse.cpp
+++ b/tests/auto/quick/touchmouse/tst_touchmouse.cpp
@@ -571,7 +571,7 @@ void tst_TouchMouse::buttonOnFlickable()
QQuickWindowPrivate *windowPriv = QQuickWindowPrivate::get(window.data());
QVERIFY(windowPriv->touchMouseId != -1);
- auto pointerEvent = QQuickPointerDevice::touchDevices().at(0)->pointerEvent();
+ auto pointerEvent = windowPriv->pointerEventInstance(QQuickPointerDevice::touchDevices().at(0));
QCOMPARE(pointerEvent->point(0)->grabber(), eventItem1);
QCOMPARE(window->mouseGrabberItem(), eventItem1);
@@ -632,7 +632,7 @@ void tst_TouchMouse::touchButtonOnFlickable()
QQuickWindowPrivate *windowPriv = QQuickWindowPrivate::get(window.data());
QVERIFY(windowPriv->touchMouseId == -1);
- auto pointerEvent = QQuickPointerDevice::touchDevices().at(0)->pointerEvent();
+ auto pointerEvent = windowPriv->pointerEventInstance(QQuickPointerDevice::touchDevices().at(0));
QCOMPARE(pointerEvent->point(0)->grabber(), eventItem2);
QCOMPARE(window->mouseGrabberItem(), nullptr);
@@ -758,7 +758,7 @@ void tst_TouchMouse::buttonOnDelayedPressFlickable()
// for the touchMouseId to the new grabber.
QCOMPARE(window->mouseGrabberItem(), flickable);
QVERIFY(windowPriv->touchMouseId != -1);
- auto pointerEvent = QQuickPointerDevice::touchDevices().at(0)->pointerEvent();
+ auto pointerEvent = windowPriv->pointerEventInstance(QQuickPointerDevice::touchDevices().at(0));
QCOMPARE(pointerEvent->point(0)->grabber(), flickable);
QTest::touchEvent(window.data(), device).release(0, p3, window.data());
@@ -1422,7 +1422,6 @@ void tst_TouchMouse::hoverEnabled()
QSignalSpy exitSpy2(mouseArea2, SIGNAL(exited()));
QSignalSpy clickSpy2(mouseArea2, SIGNAL(clicked(QQuickMouseEvent *)));
- QPoint p0(50, 50);
QPoint p1(150, 150);
QPoint p2(150, 250);
@@ -1448,9 +1447,6 @@ void tst_TouchMouse::hoverEnabled()
QVERIFY(!mouseArea2->hovered());
// ------------------------- Touch click on mouseArea2
- if (QGuiApplication::platformName().compare(QLatin1String("xcb"), Qt::CaseInsensitive) == 0)
- QSKIP("hover can be momentarily inconsistent on X11, depending on timing of flushFrameSynchronousEvents with touch and mouse movements (QTBUG-55350)");
-
QTest::touchEvent(window.data(), device).press(0, p2, window.data());
QVERIFY(mouseArea1->hovered());
diff --git a/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp b/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp
index bd051ec990..60495596d1 100644
--- a/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp
+++ b/tests/auto/quickwidgets/qquickwidget/tst_qquickwidget.cpp
@@ -59,6 +59,7 @@ private slots:
void reparentToNewWindow();
void nullEngine();
void keyEvents();
+ void shortcuts();
};
@@ -365,6 +366,38 @@ void tst_qquickwidget::keyEvents()
QTRY_VERIFY(widget.ok);
}
+class ShortcutEventFilter : public QObject
+{
+public:
+ bool eventFilter(QObject *obj, QEvent *e) override {
+ if (e->type() == QEvent::ShortcutOverride)
+ shortcutOk = true;
+
+ return QObject::eventFilter(obj, e);
+ }
+
+ bool shortcutOk = false;
+};
+
+void tst_qquickwidget::shortcuts()
+{
+ // Verify that ShortcutOverride events do not get lost. (QTBUG-60988)
+ KeyHandlingWidget widget;
+ widget.setSource(testFileUrl("rectangle.qml"));
+ widget.show();
+ QVERIFY(QTest::qWaitForWindowExposed(widget.window(), 5000));
+
+ // Send to the widget, verify that the QQuickWindow sees it.
+
+ ShortcutEventFilter filter;
+ widget.quickWindow()->installEventFilter(&filter);
+
+ QKeyEvent e(QEvent::ShortcutOverride, Qt::Key_A, Qt::ControlModifier);
+ QCoreApplication::sendEvent(&widget, &e);
+
+ QTRY_VERIFY(filter.shortcutOk);
+}
+
QTEST_MAIN(tst_qquickwidget)
#include "tst_qquickwidget.moc"
diff --git a/tests/benchmarks/benchmarks.pro b/tests/benchmarks/benchmarks.pro
index 5e6bc65815..07a6d5ecaa 100644
--- a/tests/benchmarks/benchmarks.pro
+++ b/tests/benchmarks/benchmarks.pro
@@ -1,5 +1,5 @@
TEMPLATE = subdirs
-SUBDIRS = qml script
+SUBDIRS = qml
qtConfig(private_tests) {
qtConfig(opengl(es1|es2)?):SUBDIRS += particles
}
diff --git a/tests/benchmarks/particles/affectors/affectors.pro b/tests/benchmarks/particles/affectors/affectors.pro
index 3351228a4b..35e1f514cc 100644
--- a/tests/benchmarks/particles/affectors/affectors.pro
+++ b/tests/benchmarks/particles/affectors/affectors.pro
@@ -1,10 +1,10 @@
-CONFIG += benchmark
+# This benchmark is broken, see QTBUG-60621
+#CONFIG += benchmark
+TEMPLATE = app
TARGET = tst_affectors
SOURCES += tst_affectors.cpp
macx:CONFIG -= app_bundle
-testDataFiles.files = data
-testDataFiles.path = .
-DEPLOYMENT += testDataFiles
+DEFINES += SRCDIR=\\\"$$PWD\\\"
QT += quickparticles-private testlib
diff --git a/tests/benchmarks/particles/affectors/tst_affectors.cpp b/tests/benchmarks/particles/affectors/tst_affectors.cpp
index 99d175564b..4c611c6faa 100644
--- a/tests/benchmarks/particles/affectors/tst_affectors.cpp
+++ b/tests/benchmarks/particles/affectors/tst_affectors.cpp
@@ -48,6 +48,11 @@ tst_affectors::tst_affectors()
{
}
+inline QUrl TEST_FILE(const QString &filename)
+{
+ return QUrl::fromLocalFile(QLatin1String(SRCDIR) + QLatin1String("/data/") + filename);
+}
+
void tst_affectors::test_basic_data()
{
QTest::addColumn<int> ("dt");
@@ -69,7 +74,7 @@ void tst_affectors::test_filtered_data()
void tst_affectors::test_basic()
{
QFETCH(int, dt);
- QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml");
+ QQuickView* view = createView(TEST_FILE("basic.qml"));
QQuickParticleSystem* system = view->rootObject()->findChild<QQuickParticleSystem*>("system");
//Pretend we're running, but we manually advance the simulation
system->m_running = true;
@@ -109,7 +114,7 @@ void tst_affectors::test_basic()
void tst_affectors::test_filtered()
{
QFETCH(int, dt);
- QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/filtered.qml");
+ QQuickView* view = createView(TEST_FILE("filtered.qml"));
QQuickParticleSystem* system = view->rootObject()->findChild<QQuickParticleSystem*>("system");
//Pretend we're running, but we manually advance the simulation
system->m_running = true;
diff --git a/tests/benchmarks/particles/emission/emission.pro b/tests/benchmarks/particles/emission/emission.pro
index f6730e60ff..963346ebdd 100644
--- a/tests/benchmarks/particles/emission/emission.pro
+++ b/tests/benchmarks/particles/emission/emission.pro
@@ -1,4 +1,5 @@
-CONFIG += benchmark
+# This benchmark is broken, see QTBUG-60621
+#CONFIG += benchmark
TARGET = tst_emission
SOURCES += tst_emission.cpp
macx:CONFIG -= app_bundle
diff --git a/tests/benchmarks/qml/animation/tst_animation.cpp b/tests/benchmarks/qml/animation/tst_animation.cpp
index 59f5a57f5c..27622ed013 100644
--- a/tests/benchmarks/qml/animation/tst_animation.cpp
+++ b/tests/benchmarks/qml/animation/tst_animation.cpp
@@ -41,8 +41,11 @@ public:
private slots:
void abstractAnimation();
+
+#if defined(QT_BUILD_INTERNAL)
void bulkValueAnimator();
void propertyUpdater();
+#endif
void animationtree_qml();
@@ -75,6 +78,7 @@ void tst_animation::abstractAnimation()
}
}
+#if defined(QT_BUILD_INTERNAL)
void tst_animation::bulkValueAnimator()
{
QBENCHMARK {
@@ -90,6 +94,7 @@ void tst_animation::propertyUpdater()
delete updater;
}
}
+#endif // QT_BUILD_INTERNAL
void tst_animation::animationtree_qml()
{
diff --git a/tests/benchmarks/qml/js/js.pro b/tests/benchmarks/qml/js/js.pro
index 7711e7130d..b1448d8eb8 100644
--- a/tests/benchmarks/qml/js/js.pro
+++ b/tests/benchmarks/qml/js/js.pro
@@ -1,7 +1,7 @@
TEMPLATE = subdirs
SUBDIRS = \
qjsengine \
-# qjsvalue \ ### FIXME: doesn't build
+ qjsvalue \
qjsvalueiterator \
TRUSTED_BENCHMARKS += \
diff --git a/tests/benchmarks/qml/js/qjsengine/qjsengine.pro b/tests/benchmarks/qml/js/qjsengine/qjsengine.pro
index e49a48f779..c4aba78756 100644
--- a/tests/benchmarks/qml/js/qjsengine/qjsengine.pro
+++ b/tests/benchmarks/qml/js/qjsengine/qjsengine.pro
@@ -1,6 +1,8 @@
+CONFIG += benchmark
TEMPLATE = app
TARGET = tst_bench_qjsengine
SOURCES += tst_qjsengine.cpp
QT += qml testlib
+macos:CONFIG -= app_bundle
diff --git a/tests/benchmarks/qml/js/qjsengine/tst_qjsengine.cpp b/tests/benchmarks/qml/js/qjsengine/tst_qjsengine.cpp
index 9da310d976..d13751385c 100644
--- a/tests/benchmarks/qml/js/qjsengine/tst_qjsengine.cpp
+++ b/tests/benchmarks/qml/js/qjsengine/tst_qjsengine.cpp
@@ -324,7 +324,7 @@ void tst_QJSEngine::newQObject()
{
newEngine();
QBENCHMARK {
- (void)m_engine->newQObject(QCoreApplication::instance());
+ (void)m_engine->newQObject(new QObject);
}
}
diff --git a/tests/benchmarks/qml/js/qjsvalue/qjsvalue.pro b/tests/benchmarks/qml/js/qjsvalue/qjsvalue.pro
index c646613799..edfb619608 100644
--- a/tests/benchmarks/qml/js/qjsvalue/qjsvalue.pro
+++ b/tests/benchmarks/qml/js/qjsvalue/qjsvalue.pro
@@ -5,3 +5,4 @@ TARGET = tst_bench_qjsvalue
SOURCES += tst_qjsvalue.cpp
QT += qml testlib
+macos:CONFIG -= app_bundle
diff --git a/tests/benchmarks/qml/js/qjsvalue/tst_qjsvalue.cpp b/tests/benchmarks/qml/js/qjsvalue/tst_qjsvalue.cpp
index 5cb0f2f44b..7488d613e5 100644
--- a/tests/benchmarks/qml/js/qjsvalue/tst_qjsvalue.cpp
+++ b/tests/benchmarks/qml/js/qjsvalue/tst_qjsvalue.cpp
@@ -943,7 +943,7 @@ void tst_QJSValue::defineStandardTestValues()
QTest::newRow("regexp") << m_engine->evaluate("new RegExp('foo')");
QTest::newRow("error") << m_engine->evaluate("new Error");
- QTest::newRow("qobject") << m_engine->newQObject(this);
+ QTest::newRow("qobject") << m_engine->newQObject(new QObject);
#if 0 // no qmetaobject
QTest::newRow("qmetaobject") << m_engine->newQMetaObject(&QJSEngine::staticMetaObject);
#endif
diff --git a/tests/benchmarks/qml/qml.pro b/tests/benchmarks/qml/qml.pro
index f1fe87e532..437d13c87e 100644
--- a/tests/benchmarks/qml/qml.pro
+++ b/tests/benchmarks/qml/qml.pro
@@ -9,7 +9,7 @@ SUBDIRS += \
qqmlcomponent \
qqmlmetaproperty \
librarymetrics_performance \
-# script \ ### FIXME: doesn't build
+ script \
js \
creation
diff --git a/tests/benchmarks/qml/qqmlchangeset/tst_qqmlchangeset.cpp b/tests/benchmarks/qml/qqmlchangeset/tst_qqmlchangeset.cpp
index bbfb52343c..cdbec699dc 100644
--- a/tests/benchmarks/qml/qqmlchangeset/tst_qqmlchangeset.cpp
+++ b/tests/benchmarks/qml/qqmlchangeset/tst_qqmlchangeset.cpp
@@ -1,31 +1,26 @@
/****************************************************************************
**
-** Copyright (C) 2016 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Milian Wolff <milian.wolff@kdab.com>
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Milian Wolff <milian.wolff@kdab.com>
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL21$
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 or version 3 as published by the Free
-** Software Foundation and appearing in the file LICENSE.LGPLv21 and
-** LICENSE.LGPLv3 included in the packaging of this file. Please review the
-** following information to ensure the GNU Lesser General Public License
-** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** As a special exception, The Qt Company gives you certain additional
-** rights. These rights are described in The Qt Company LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/tests/benchmarks/qml/qqmldebugtrace/qqmldebugtrace.pro b/tests/benchmarks/qml/qqmldebugtrace/qqmldebugtrace.pro
deleted file mode 100644
index 556842af80..0000000000
--- a/tests/benchmarks/qml/qqmldebugtrace/qqmldebugtrace.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-CONFIG += benchmark
-QT += qml testlib
-TEMPLATE = app
-TARGET = tst_qqmldebugtrace
-macx:CONFIG -= app_bundle
-
-SOURCES += tst_qqmldebugtrace.cpp
-
diff --git a/tests/benchmarks/qml/qqmldebugtrace/tst_qqmldebugtrace.cpp b/tests/benchmarks/qml/qqmldebugtrace/tst_qqmldebugtrace.cpp
deleted file mode 100644
index 68b34deb3a..0000000000
--- a/tests/benchmarks/qml/qqmldebugtrace/tst_qqmldebugtrace.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtCore/QElapsedTimer>
-#include <QObject>
-#include <qtest.h>
-
-class tst_qqmldebugtrace : public QObject
-{
- Q_OBJECT
-
-public:
- tst_qqmldebugtrace() {}
-
-private slots:
- void all();
- void startElapsed();
- void doubleElapsed();
- void trace();
-};
-
-void tst_qqmldebugtrace::all()
-{
- QBENCHMARK {
- QElapsedTimer t;
- t.start();
- t.nsecsElapsed();
- }
-}
-
-void tst_qqmldebugtrace::startElapsed()
-{
- QElapsedTimer t;
- QBENCHMARK {
- t.start();
- t.nsecsElapsed();
- }
-}
-
-void tst_qqmldebugtrace::doubleElapsed()
-{
- QElapsedTimer t;
- t.start();
- QBENCHMARK {
- t.nsecsElapsed();
- t.nsecsElapsed();
- }
-}
-
-void tst_qqmldebugtrace::trace()
-{
- QString s("A decent sized string of text here.");
- QBENCHMARK {
- QByteArray data;
- QDataStream ds(&data, QIODevice::WriteOnly);
- ds << (qint64)100 << (int)5 << (int)5 << s;
- }
-}
-
-QTEST_MAIN(tst_qqmldebugtrace)
-
-#include "tst_qqmldebugtrace.moc"
diff --git a/tests/benchmarks/qml/script/tst_script.cpp b/tests/benchmarks/qml/script/tst_script.cpp
index 3829f3df6a..a48d6bdec7 100644
--- a/tests/benchmarks/qml/script/tst_script.cpp
+++ b/tests/benchmarks/qml/script/tst_script.cpp
@@ -52,10 +52,8 @@ private slots:
void property_getter_qmetaproperty();
#endif
void property_qobject();
- void property_qmlobject();
void setproperty_js();
- void setproperty_qmlobject();
void function_js();
#if 0
@@ -63,7 +61,6 @@ private slots:
void function_cpp();
#endif
void function_qobject();
- void function_qmlobject();
void function_args_js();
#if 0
@@ -71,7 +68,6 @@ private slots:
void function_args_cpp();
#endif
void function_args_qobject();
- void function_args_qmlobject();
void signal_unconnected();
void signal_qml();
@@ -178,7 +174,7 @@ void tst_script::property_js()
}
}
-#if 0
+#if 0 // This requires internal API access in V4
static QJSValue property_getter_method(QScriptContext *, QJSEngine *engine)
{
static int x = 0;
@@ -305,26 +301,6 @@ void tst_script::property_qobject()
}
}
-void tst_script::property_qmlobject()
-{
- QQmlEngine qmlengine;
-
- TestObject to;
- QV8Engine *engine = QQmlEnginePrivate::getV8Engine(&qmlengine);
- v8::HandleScope handle_scope;
- v8::Context::Scope scope(engine->context());
- QJSValue v = engine->scriptValueFromInternal(engine->qobjectWrapper()->newQObject(&to));
-
- QJSValueList args;
- args << v;
- QJSValue prog = qmlengine.evaluate(PROPERTY_PROGRAM).call(args);
- prog.call();
-
- QBENCHMARK {
- prog.call();
- }
-}
-
#define SETPROPERTY_PROGRAM \
"(function(testObject) { return (function() { " \
" for (var ii = 0; ii < 10000; ++ii) { " \
@@ -349,27 +325,6 @@ void tst_script::setproperty_js()
}
}
-void tst_script::setproperty_qmlobject()
-{
- QQmlEngine qmlengine;
-
- TestObject to;
-
- QV8Engine *engine = QQmlEnginePrivate::getV8Engine(&qmlengine);
- v8::HandleScope handle_scope;
- v8::Context::Scope scope(engine->context());
- QJSValue v = engine->scriptValueFromInternal(engine->qobjectWrapper()->newQObject(&to));
-
- QJSValueList args;
- args << v;
- QJSValue prog = qmlengine.evaluate(SETPROPERTY_PROGRAM).call(args);
- prog.call();
-
- QBENCHMARK {
- prog.call();
- }
-}
-
#define FUNCTION_PROGRAM \
"(function(testObject) { return (function() { " \
" var test = 0; " \
@@ -437,27 +392,6 @@ void tst_script::function_qobject()
}
}
-void tst_script::function_qmlobject()
-{
- QQmlEngine qmlengine;
-
- TestObject to;
-
- QV8Engine *engine = QQmlEnginePrivate::getV8Engine(&qmlengine);
- v8::HandleScope handle_scope;
- v8::Context::Scope scope(engine->context());
- QJSValue v = engine->scriptValueFromInternal(engine->qobjectWrapper()->newQObject(&to));
-
- QJSValueList args;
- args << v;
- QJSValue prog = qmlengine.evaluate(FUNCTION_PROGRAM).call(args);
- prog.call();
-
- QBENCHMARK {
- prog.call();
- }
-}
-
#define FUNCTION_ARGS_PROGRAM \
"(function(testObject) { return (function() { " \
" var test = 0; " \
@@ -525,27 +459,6 @@ void tst_script::function_args_qobject()
}
}
-void tst_script::function_args_qmlobject()
-{
- QQmlEngine qmlengine;
-
- TestObject to;
-
- QV8Engine *engine = QQmlEnginePrivate::getV8Engine(&qmlengine);
- v8::HandleScope handle_scope;
- v8::Context::Scope scope(engine->context());
- QJSValue v = engine->scriptValueFromInternal(engine->qobjectWrapper()->newQObject(&to));
-
- QJSValueList args;
- args << v;
- QJSValue prog = qmlengine.evaluate(FUNCTION_ARGS_PROGRAM).call(args);
- prog.call();
-
- QBENCHMARK {
- prog.call();
- }
-}
-
void tst_script::signal_unconnected()
{
QQmlEngine engine;
diff --git a/tests/benchmarks/script/qjsvalue/qjsvalue.pro b/tests/benchmarks/script/qjsvalue/qjsvalue.pro
deleted file mode 100644
index 1b39091dea..0000000000
--- a/tests/benchmarks/script/qjsvalue/qjsvalue.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-CONFIG += benchmark
-TEMPLATE = app
-TARGET = tst_bench_qjsvalue
-INCLUDEPATH += .
-macx:CONFIG -= app_bundle
-CONFIG += release
-
-SOURCES += tst_qjsvalue.cpp
-
-QT += core-private qml-private testlib
diff --git a/tests/benchmarks/script/qjsvalue/tst_qjsvalue.cpp b/tests/benchmarks/script/qjsvalue/tst_qjsvalue.cpp
deleted file mode 100644
index f1bdb78c7b..0000000000
--- a/tests/benchmarks/script/qjsvalue/tst_qjsvalue.cpp
+++ /dev/null
@@ -1,99 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <qtest.h>
-#include <QJSEngine>
-#include <QJSValue>
-
-class tst_QJSValue : public QObject
-{
- Q_OBJECT
-public:
- tst_QJSValue() {}
-
-private slots:
- void fillArray();
-
- void property();
-
- void setProperty();
-
- void call();
-};
-
-void tst_QJSValue::fillArray()
-{
- QJSEngine eng;
- static const int ArrayLength = 10000;
- QJSValue array = eng.newArray(ArrayLength);
- QBENCHMARK {
- for (int i = 0; i < ArrayLength; ++i)
- array.setProperty(i, i);
- }
-}
-
-void tst_QJSValue::property()
-{
- QJSEngine eng;
- QJSValue object = eng.newObject();
- QString propertyName = QString::fromLatin1("foo");
- object.setProperty(propertyName, 123);
- QVERIFY(object.property(propertyName).isNumber());
- QBENCHMARK {
- object.property(propertyName);
- }
-}
-
-void tst_QJSValue::setProperty()
-{
- QJSEngine eng;
- QJSValue object = eng.newObject();
- QString propertyName = QString::fromLatin1("foo");
- QJSValue value(123);
- QBENCHMARK {
- object.setProperty(propertyName, value);
- }
-}
-
-#define TEST_FUNCTION_SOURCE "(function() { return 123; })"
-
-void tst_QJSValue::call()
-{
- QJSEngine eng;
- QJSValue fun = eng.evaluate(TEST_FUNCTION_SOURCE);
- QVERIFY(fun.isCallable());
- QJSValueList args;
- QVERIFY(fun.call(args).isNumber());
- QBENCHMARK {
- fun.call(args);
- }
-}
-
-QTEST_MAIN(tst_QJSValue)
-
-#include "tst_qjsvalue.moc"
diff --git a/tests/benchmarks/script/script.pro b/tests/benchmarks/script/script.pro
deleted file mode 100644
index 37dc03801d..0000000000
--- a/tests/benchmarks/script/script.pro
+++ /dev/null
@@ -1,4 +0,0 @@
-TEMPLATE = subdirs
-
-SUBDIRS += \
- qjsvalue
diff --git a/tests/manual/v4/v8-bench.js b/tests/manual/v4/v8-bench.js
index 41a04fa29a..bfce6231e4 100644
--- a/tests/manual/v4/v8-bench.js
+++ b/tests/manual/v4/v8-bench.js
@@ -202,6 +202,9 @@ BenchmarkSuite.prototype.NotifyError = function(error) {
// Runs a single benchmark for at least a second and computes the
// average time it takes to run a single iteration.
BenchmarkSuite.prototype.RunSingleBenchmark = function(benchmark, data) {
+ // run the garbage collector, to give more reproducible conditions to each test
+ gc()
+
function Measure(data) {
var elapsed = 0;
var start = new Date();
diff --git a/tools/qmlcachegen/qmlcache.prf b/tools/qmlcachegen/qmlcache.prf
index 4470db0d09..330da358b7 100644
--- a/tools/qmlcachegen/qmlcache.prf
+++ b/tools/qmlcachegen/qmlcache.prf
@@ -3,6 +3,11 @@ static {
return()
}
+android {
+ message("QML cache generation ahead of time is not supported on Android")
+ return()
+}
+
qtPrepareTool(QML_CACHEGEN, qmlcachegen, _ARCH_CHECK)
isEmpty(TARGETPATH): error("Must set TARGETPATH (QML import name) for ahead-of-time QML cache generation")
diff --git a/tools/qmleasing/mainwindow.cpp b/tools/qmleasing/mainwindow.cpp
index 627e23ac87..c1a87642a5 100644
--- a/tools/qmleasing/mainwindow.cpp
+++ b/tools/qmleasing/mainwindow.cpp
@@ -98,7 +98,6 @@ MainWindow::MainWindow(QWidget *parent) :
connect(ui_properties.importButton, SIGNAL(clicked()), importDialog, SLOT(show()));
connect(importDialog, SIGNAL(finished(int)), this, SLOT(importData(int)));
- connect(this, SIGNAL(close()), this, SLOT(doClose()));
initQml();
}
diff --git a/tools/qmlplugindump/qmltypereader.cpp b/tools/qmlplugindump/qmltypereader.cpp
index 9dfb6fc1e0..06f6086d4a 100644
--- a/tools/qmlplugindump/qmltypereader.cpp
+++ b/tools/qmlplugindump/qmltypereader.cpp
@@ -1,31 +1,26 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL21$
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 or version 3 as published by the Free
-** Software Foundation and appearing in the file LICENSE.LGPLv21 and
-** LICENSE.LGPLv3 included in the packaging of this file. Please review the
-** following information to ensure the GNU Lesser General Public License
-** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** As a special exception, The Qt Company gives you certain additional
-** rights. These rights are described in The Qt Company LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/tools/qmlplugindump/qmltypereader.h b/tools/qmlplugindump/qmltypereader.h
index b995566e0b..bb31cf43e1 100644
--- a/tools/qmlplugindump/qmltypereader.h
+++ b/tools/qmlplugindump/qmltypereader.h
@@ -1,31 +1,26 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the tools applications of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL21$
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 or version 3 as published by the Free
-** Software Foundation and appearing in the file LICENSE.LGPLv21 and
-** LICENSE.LGPLv3 included in the packaging of this file. Please review the
-** following information to ensure the GNU Lesser General Public License
-** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** As a special exception, The Qt Company gives you certain additional
-** rights. These rights are described in The Qt Company LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**