aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
Commit message (Collapse)AuthorAgeFilesLines
* Remove null pointer checks for "this" from QQmlContextData::resolvedUrl()Pavel Tumakaev2019-05-231-15/+12
| | | | | | | | | | | | | | | | | | | According to ISO/IEC 14882 §5.2.5/3 "If E1 has the type “pointer to class X,” then the expression E1->E2 is converted to the equivalent form (*(E1)).E2;". Thus, as QQmlContextData::resolvedUrl() is non-static method, it cannot be called on a null pointer because it leads to undefined behavior, and “this“ in QQmlContextData::resolvedUrl() cannot be a null pointer. According to this document: https://gcc.gnu.org/gcc-6/porting_to.html , starting from version 6, GCC optimizations remove null pointer checks for "this", since "the this pointer can never be null, which is guaranteed by the language rules." Thus, on the one hand the “if (ctxt)“ check in QQmlContextData::resolvedUrl() does nothing, on the other “if (engine“ check leads to undefined behavior if ctxt/this == nullptr. Task-number: QTBUG-75983 Change-Id: Idfb1e26758d83223bb0845139d63e2e8e80dc714 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Remove now dead V4_BOOTSTRAP #if-eryUlf Hermann2019-05-136-29/+0
| | | | | | | Change-Id: I04f8f69ed8ee415ca330e2f7beeffc4ee4c38e65 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Remove V4_BOOTSTRAP condition around header verificationUlf Hermann2019-05-091-6/+0
| | | | | | | | | | | It's unclear why that was needed. Change-Id: I0b4d4ebe1992cd2252cfc3eb10baa7f1b3ae1a5a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Move valueAsNumber into ExecutableCompilationUnitUlf Hermann2019-05-136-22/+19
| | | | | | | | | | | This reduces our dependence on QV4::Value in the devtools. Change-Id: I4b3f937bc08c16f7e2543fdc5cc34c0cfb121f8f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Remove QUrl-related special casing in the compilerUlf Hermann2019-05-102-10/+1
| | | | | | | QUrl is being added to the bootstrap set. Change-Id: Ia96bbcf6e0ef808435ecddfa114fdcd213361bbf Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Restore value bindings when disabling a Binding elementErik Verbruggen2019-05-173-5/+156
| | | | | | | | | | | | | | We previously only restored script bindings that were replaced by a Binding. Now we handle both. [ChangeLog] QML Binding elements now support restoring previous values of the bound property when the binding is disabled. This will be the default behavior in Qt 5.15. Reliance on the old behavior of only restoring binding, not literal values results in a warning now. Fixes: QTBUG-33444 Change-Id: I833403b0645c08eee486fbd4acf5d3c7de2ef73a Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Inline dumpConstantTable() into the only place where it's usedUlf Hermann2019-05-173-34/+27
| | | | | | | | ... and don't copy byte arrays around for each character of padding prepended to a number. Change-Id: I6963d4c9d42aedd780bec9517b4b7a2a83f10185 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add abstraction for temporarily setting StaticData when savingUlf Hermann2019-05-173-19/+46
| | | | | | | | | The StaticData flag needs to be saved to disk, but removed again afterwards so that we can free() the malloc'd data. This also allows us to avoid copying all the data into a byte array before saving. Change-Id: I96513f8d98acf0ea0b4514d96376b487e8444917 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Split CompiledData::CompilationUnit in twoUlf Hermann2019-05-1659-1221/+1489
| | | | | | | | We need a CompilationUnit that only holds the data needed for compilation and another one that is executable by the runtime. Change-Id: I704d859ba028576a18460f5e3a59f210f64535d3 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-05-165-15/+18
|\ | | | | | | Change-Id: I192cb06f3b92869699cb3e072f2c6c1e8dbb1ef4
| * Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-05-161-0/+4
| |\ | | | | | | | | | Change-Id: Ia93dc734ce25b3134b0f905f473a0c30777ceaf1
| | * Elaborate on the meaning of values held by basic typesSimon Hausmann2019-05-131-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Explicitly mention the copying semantics as well as how they are called in the JavaScript language. Task-number: QTBUG-75308 Change-Id: I82b8c6324133d3265b66325c6f67b19b344e0470 Reviewed-by: Kavindra Palaraja <kpalaraja@luxoft.com> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
| * | Compile fixJarek Kobus2019-05-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | It fixes the following issue: error: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Werror=sign-compare] Change-Id: I4b896f49ff753a5cf79cd1e40e76815f712eec89 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| * | Do not take a reference of nullptrAllan Sandfeld Jensen2019-05-142-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | References are not allowed to be null, but we pass a nullptr as receiver in QQmlContextWrapper::resolveQmlContextPropertyLookupGetter. Detected with UBSAN. Change-Id: Iaa7945fb17e4b0e549e541e47589b2f47d32ea4e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| * | Fix illegal downcast on QQmlEngine destructionAllan Sandfeld Jensen2019-05-141-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | Make QQmlEnginePrivate::isEngineThread() legal to call during QQmlEngine destruction. Change-Id: I2bae9d70883cf8013f39f2046ebe83bb8dbcd46b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Don't include qv4enginebase_p.h in qmldevtoolsUlf Hermann2019-05-106-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | We don't need it and we don't need to check for V4_BOOTSTRAP in there. Shuffle some includes around to provide everything we do need. Change-Id: I3e75f1c6f9dc518006aabc9dcee21e5153899ac5 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Make sure we don't include qv4stackframe_p.h in qmldevtoolsUlf Hermann2019-05-105-51/+117
| | | | | | | | | | | | | | | | | | | | | | | | The only thing we need is CallData, which is now provided as separate file. Change-Id: Iccbab67ac30d09077075b200f18d1d694f3ecb2a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Move qv4string{_p.h|.cpp} out of the devtoolsUlf Hermann2019-05-108-47/+107
| | | | | | | | | | | | | | | | | | | | | | | | The only thing we actually need is toArrayIndex() and that is a static method. We provide it in a separate file. Change-Id: I86b11e3d81a319202a0babacd17d87e7816ac88a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Generate the compilation unit checksum whenever we have MD5Ulf Hermann2019-05-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This is actually not dependent on V4_BOOTSTRAP. There are various conditions that might influence QCryptographicHash. Change-Id: Iad0384a2cf8360e6db8ef398bd45f63161c0b70f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-05-096-29/+54
|\| | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qqmlirbuilder.cpp Change-Id: I2cfda470515e2df778ad3c89105c07344af07c6d
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-05-086-29/+54
| |\| | | | | | | | | | Change-Id: I3eb5d1affe64b6ae709d1154cc37de91db3816b6
| | * Avoid std::function in qqmlirbuilder.cppUlf Hermann2019-05-072-22/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some compilers seem to miscompile this construction. Furthermore, it doesn't really add to the readability of the code. Inline the code in question at the only place it's used and avoid most of the const_cast by adding a non-const accessor to CompiledData::Unit. Fixes: QTBUG-75392 Change-Id: I015317f28a92817d08d616cc35956745758d7847 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| | * Add Q_TRACE calls to QtQml for QML profiler trace pointsMilian Wolff2019-05-054-7/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds tracepoints for LTTng/ETW at the positions that are also used by the QML profiler within QtQml. I.e. with the tracepoints here, you'll see which QML function is being executed which is already quite helpful. This will allow us to bridge the gap between C++ and QML when tracing with LTTng/ETW. Additionally, you'll also be able to see kernel tracepoints which bridges another gap. Combined, this approach can give much deeper insights into what the (embedded) system is doing compared to just looking at the QML profiler alone. Change-Id: Ia8f71bf6d44b7f51c3c5aaa38f032675604aeca6 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Rafael Roquetto <rafael@roquetto.com>
* | | Drop some dead bootstrap codeUlf Hermann2019-05-084-35/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The dependencies are only hashed if a dependencyHasher is given. This is generally not the case when compiling ahead of time. There is also no need to hide the declaration of DependentTypesHasher from the bootstrap code. Change-Id: I0ea74c3079656ce1fe353956999820916c8ff626 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Register QObject along with QQmlComponent as basic type of the languageUlf Hermann2019-05-081-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apparently we need it somewhere. Before the restructuring of imports all QtQml types were automatically registered on QQmlEnginePrivate::init(). We don't do this anymore, so we need to register the basic building blocks of the language separately now. Fixes: QTBUG-75645 Change-Id: I77fe23f709304586cd16986650b0056ea87bcd45 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Remove last traces of QV8EngineUlf Hermann2019-05-0819-615/+367
| | | | | | | | | | | | | | | Change-Id: I59f738402d51e39188bbbca2ef1fbc8a61612372 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Move compileModule() into qv4codegen.cppUlf Hermann2019-05-0810-78/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is a better fit for the method. In turn, remove all the V4_BOOTSTRAP conditions from qv4engine_p.h and make sure we don't include or compile it in bootstrap mode. Change-Id: I5933b0724e561313ca20c420b83e4d70e63bddf5 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Filter out duplicate entries in Object.keysErik Verbruggen2019-05-081-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | This can happen due to overloaded methods on the C++ side. Fixes: QTBUG-73786 Change-Id: I757cfda65a773687cea451ab83eb41b976a9fb60 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | | Move dynamicStrings into the bootstrapped part of QV4::CompiledDataUlf Hermann2019-05-072-13/+9
| | | | | | | | | | | | | | | | | | | | | | | | We don't really need the dynamic strings at compile time, but having them defined simplifies some code. Change-Id: Ibcfaae7834f8aa63918da6787d222fe71657c4ee Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Move the check for SSE2 into the configure systemUlf Hermann2019-05-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The JIT requires SSE2. Without it we can still use the interpreter. If you compile with SSE2 enabled and then run on a machine without SSE2 you will get a more interesting crash now. However, in this day and age we don't have to expect random pre-Pentium4 CPUs out in the wild anymore. If you want to use such a thing, you will probably build a special version of Qt for it. Change-Id: I14a71cb83876d2ce7fdad012c385d0d4389e7ddf Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Remove the bootstrap code from assembler and JITUlf Hermann2019-05-071-1/+1
| | | | | | | | | | | | | | | | | | | | | We don't build the assembler or the JIT in bootstrap mode. Change-Id: Idc3a56cc1e9cfba415bef9cba221c8a60ee75010 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Move QQmlIR::IRLoader out of qqmlirbuilder*Ulf Hermann2019-05-066-183/+292
| | | | | | | | | | | | | | | | | | | | | | | | We don't need it to build the IR and we can drop a few checks for V4_BOOTSTRAP this way. Change-Id: I9464e65528c70c42ebc8ddad576eaab001dc9d2f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Move PropertyResolver out of qqmlirbuilder*Ulf Hermann2019-05-069-85/+199
| | | | | | | | | | | | | | | | | | | | | | | | The "early" compilation doesn't use it and we can get rid of a few V4_BOOTSTRAP checks this way. Change-Id: I1c4845aba445b105ddace0b6810e0e5c28a25b29 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Move workerscript to its own moduleUlf Hermann2019-05-0612-1354/+10
| | | | | | | | | | | | | | | Change-Id: I778cfe842ddf1c600a837d8f2061a338887eed95 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-05-021-4/+1
|\| | | | | | | | | | | Change-Id: I662790341c4b1ee816b0639067fe3f0e38a002b4
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-05-021-4/+1
| |\| | | | | | | | | | Change-Id: Ic10f47e4763d67d989df77f2dc11d9705ec7fb6b
| | * Don't wrap the attachedProperties function into a templateUlf Hermann2019-05-021-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise it gets a separate address for each CU in which the template is instantiated. We want to use the address as key to the attached properties, though. Fixes: QTBUG-75385 Change-Id: Iaec82db116a032f7cb1d40670bb47fdf610664a2 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Move model types into their own libraryUlf Hermann2019-05-0246-17265/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The model types are not part of the core QML runtime and should only be loaded if you explicitly import them. We cannot enforce that in Qt5 as some of them are available from the QtQml import, but we can change it in Qt6. Change-Id: I1e49e84d748e352537ec2d4af901c034c91d038f Reviewed-by: Erik Verbruggen <erik.verbruggen@me.com>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-05-023-8/+15
|\| | | | | | | | | | | Change-Id: I5d2c3da38df35922b2147c3c0bc55c6c3bae2fe5
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-05-013-8/+15
| |\| | | | | | | | | | Change-Id: Ic008bf9223a9ac293c925044355ff218f7ed7f78
| | * Skip block context within call contexts when searching for parametersUlf Hermann2019-04-291-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only the call context contains the signal parameters. However, there can be any number of nested block contexts in a function. This manifests itself when the function needs an execution context. The simplest way to trigger this is attaching a debugger. Fixes: QTBUG-75393 Change-Id: Iabdc06a9fe7bf88204525d6940b626575fee1579 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| | * Fix coverity warningSimon Hausmann2019-04-291-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit bc00353cffbfe0f74b602a16452f2e7bcd588152 accidentally removed the assert that expressed how objectForId will always succeed with the alias target. That caused coverity to complain that objectAt() may be called with a negative (then array) index. Change-Id: I8651e0826c92e41ab00bf8a44f1abfd1cbfb0e06 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| | * Fix maximum call stack depth for clang ASAN buildsSimon Hausmann2019-04-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | For clang we need to use has_feature to detect the presence of an ASAN build. Amends commit eb363c3a0b7f96015d7b8f2551dbeaa86f5acf16 Task-number: QTBUG-75410 Change-Id: I2adb69deb07f8c6b77be8c2f23751fd0a2bbdb95 Reviewed-by: Erik Verbruggen <erik.verbruggen@me.com>
* | | Make JavaScript execution interruptibleUlf Hermann2019-04-3012-4/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an atomic isInterrupted flag to BaseEngine and check that in addition to the hasException flag on checkException(). Add some more exception checks to cover all possible infinite loops. Also, remove the writeBarrierActive member from QV4::EngineBase. It isn't used. Fixes: QTBUG-49080 Change-Id: I86b3114e3e61aff3e5eb9b020749a908ed801c2b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Clean up QStringHashUlf Hermann2019-04-308-217/+203
| | | | | | | | | | | | | | | | | | | | | | | | | | | Make it completely inline, move the (4 times duplicated) primeForNumBits function into its own file, address some warnings, move QHashedString::compare into qhashedstring.cpp. Change-Id: I778bb3d3e176cfec45eda9be9d7e5982585e6474 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Mark functions involving attached property IDs as deprecatedUlf Hermann2019-04-306-6/+20
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-75176 Change-Id: I969e7987ebf8b98aed9ba9e17388a0e168ef5e09 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Remove tracing JIT infrastructureUlf Hermann2019-04-2947-9812/+176
| | | | | | | | | | | | | | | | | | | | | | | | The tracing JIT won't be finished. Therefore, remove the parts that have already been integrated. Change-Id: If72036be904bd7fc17ba9bcba0a317f8ed6cb30d Reviewed-by: Erik Verbruggen <erik.verbruggen@me.com>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-04-295-18/+12
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4compilercontext.cpp src/qml/qml/qqmlmetatype.cpp Change-Id: I02e0216961b92ff68a3f91a70edc33fe9e8db147
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-04-274-6/+9
| |\| | | | | | | | | | Change-Id: I552629813ea8100d04ea19e51fe7198931082e19
| | * Allow creation of variants from non-singleton QQmlTypeWrappersUlf Hermann2019-04-261-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | I don't see any reason why this should be prohibited. Change-Id: I4a54c55eff4b9151691d0587627efad4a06485f1 Fixes: QTBUG-74815 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>