aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime
Commit message (Collapse)AuthorAgeFilesLines
* Remove now dead V4_BOOTSTRAP #if-eryUlf Hermann2019-05-136-29/+0
| | | | | | | Change-Id: I04f8f69ed8ee415ca330e2f7beeffc4ee4c38e65 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Split CompiledData::CompilationUnit in twoUlf Hermann2019-05-1616-84/+129
| | | | | | | | 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-163-10/+11
|\ | | | | | | Change-Id: I192cb06f3b92869699cb3e072f2c6c1e8dbb1ef4
| * 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>
* | Don't include qv4enginebase_p.h in qmldevtoolsUlf Hermann2019-05-104-6/+7
| | | | | | | | | | | | | | | | 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-103-49/+115
| | | | | | | | | | | | | | | | 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-105-42/+104
| | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-05-091-0/+6
|\| | | | | | | | | | | | | Conflicts: src/qml/compiler/qqmlirbuilder.cpp Change-Id: I2cfda470515e2df778ad3c89105c07344af07c6d
| * Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-05-081-0/+6
| |\ | | | | | | | | | Change-Id: I3eb5d1affe64b6ae709d1154cc37de91db3816b6
| | * Add Q_TRACE calls to QtQml for QML profiler trace pointsMilian Wolff2019-05-051-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Remove last traces of QV8EngineUlf Hermann2019-05-083-12/+344
| | | | | | | | | | | | | | | Change-Id: I59f738402d51e39188bbbca2ef1fbc8a61612372 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Move compileModule() into qv4codegen.cppUlf Hermann2019-05-087-77/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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 workerscript to its own moduleUlf Hermann2019-05-067-536/+9
| | | | | | | | | | | | | | | Change-Id: I778cfe842ddf1c600a837d8f2061a338887eed95 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Move model types into their own libraryUlf Hermann2019-05-027-37/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-022-6/+12
|\| | | | | | | | | | | Change-Id: I5d2c3da38df35922b2147c3c0bc55c6c3bae2fe5
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-05-012-6/+12
| |\| | | | | | | | | | 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 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-302-3/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-303-37/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Remove tracing JIT infrastructureUlf Hermann2019-04-299-323/+18
| | | | | | | | | | | | | | | | | | | | | | | | 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-293-16/+5
|\| | | | | | | | | | | | | | | | | | | | | | | 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-272-4/+4
| |\| | | | | | | | | | Change-Id: I552629813ea8100d04ea19e51fe7198931082e19
| | * Don't call unknown types "null"Ulf Hermann2019-04-261-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | That is rather confusing. Task-number: QTBUG-74815 Change-Id: Id683a7f9efd63c8859c5740ceab9f161cea46ee3 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| | * Fix maximum call stack depth limits for ASAN buildsSimon Hausmann2019-04-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ASAN enabled builds require more stack space and therefore our call depth limits should be lower. In my measurements with a recursion through arrow functions with the interpreter, as per the test case in the bug report, different types of builds require different amounts of stack space. On x86-64 Linux, I measured, by printing $rsp and subtracting: Debug: ~6k Debug with -Og: ~590 bytes Release with -O2: ~570 bytes Release (-O2) with ASAN: ~40k Fixes: QTBUG-75410 Change-Id: I403b261c677b1adb9f349958339b5a1294ae4d5d Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-04-251-12/+1
| |\| | | | | | | | | | Change-Id: I2fea101de38922d34088c6eca0e256ec167ad118
| | * Revert "Optimize some Lookups"Michal Klocek2019-04-241-12/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 2beb77c81a1f3585c15099a09ba8b2192c6da824. To optimize lookup in case of heapObject we cast its value to Object. This unfortunately does not work well when the value type of heap object is actually a string. Task-number: QTBUG-75335 Change-Id: I55d7c9e0d41f3be617ca7141a4121de3a56f8eef Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Transform V4_ENABLE_JIT into a featureUlf Hermann2019-04-254-50/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This way you can enable or disable the JIT when configuring Qt. The conditions for the availability of the JIT have also been cleaned up. There is no reason anymore to artificially restrict availability on x86 and x86_64. The reason for the existence of those clauses are old problems on windows that have been fixed by now. However, on arm and arm64, we need a specialization of the cacheFlush() function for each OS to be supported. Therefore, restrict to the systems for which such a specialization exists. iOS and tvOS are technically supported and you can enable the JIT via the feature flag now. Due to Apple's policy we disable it by default, though. Change-Id: I5fe2a2bf6799b2d11b7ae7c7a85962bcbf44f919 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Move creation and management of singletons to QQmlEnginePrivateRichard Weickelt2019-04-241-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Singleton object instances were previously managed by QQmlType::SingletonInstanceInfo and kept in a shared storage. This caused concurrency problems when instantiating singleton instances from different QML engines in different threads. This patch moves the singleton house-keeping infrastructure to QQmlEnginePrivate and makes SingletonInstanceInfo immutable. Singleton objects are stored in a QHash with QQmlType as the key because the qml type id might be 0 for composite singletons. The public API of QQmlType is extended to provide more information about singleton types so that access to SingletonInstanceInfo is not needed. All internal accesses of singleton objects must now take the same code path via QQmlEnginePrivate::singletonInstance<T>() which simplifies overall usage of singletons and scatters less implementation details throughout the code base. Task-number: QTBUG-75007 Change-Id: I13c5fd21cac2eb7291f2cbcf2c2b504f0f51a07c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-04-231-1/+1
|\| | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/qml/qqmlmetatype.cpp Change-Id: Ieff61c076e46eb50a059c8b0210f7f4d7ce0cbcf
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-04-191-1/+1
| |\| | | | | | | | | | Change-Id: I9ef4be23bfe35aa48d4c65d4159e72c527943845
| | * Don't crash when accessing invalid properties through QObjectWrapperUlf Hermann2019-04-181-1/+1
| | | | | | | | | | | | | | | | | | Change-Id: I613bf5dc685bb4235262b429d8f7318ea144fb9d Fixes: QTBUG-75203 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* | | Don't needlessly restrict Qt.include() in case !qml-networkUlf Hermann2019-04-181-8/+5
| | | | | | | | | | | | | | | Change-Id: I1cc23941121a5b2b16e94fc46e48bdce1f452afb Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-04-184-4/+8
|\| | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/qml/qqmlimport.cpp Change-Id: I6add6267297ea50a646d43d212027a168dca8916
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-04-173-4/+4
| |\| | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/qml/qv4assembler/tst_qv4assembler.cpp Change-Id: I9d31c982881a617099354bf8acceb76332f11496
| | * V4: Only enable the JIT on ARM on specific known OSesMartin Storsjö2019-04-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On all other architectures, the JIT is only enabled for explicitly mentioned OSes. This fixes build errors for Windows on 32 bit ARM, about the cacheFlush function being unimplemented for that target. This keeps all other OSes enabled that are mentioned in conditionals for other architectures, except for windows. Change-Id: I8c29a9399a05a57d23b4fee506c3d04859a08a76 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| | * Prevent CoW detaches from happeningErik Verbruggen2019-04-151-1/+1
| | | | | | | | | | | | | | | Change-Id: Ia42c0d732e0f6ccfa2c70b86edccd9eb471aac7c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| | * Fix string replacement with invalid capturesUlf Hermann2019-04-151-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we have a theoretically valid capture reference that just didn't capture anything in this match, we don't want to treat it as literal. Only capture references that clearly are outside the range of things we can possibly capture with this expression should be treated as literal strings. Change-Id: Iab0bf329d11a6b9e172aa662f11751d86cfc26a6 Fixes: QTBUG-75121 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * | Merge remote-tracking branch 'origin/5.12' into 5.13v5.13.0-beta3Qt Forward Merge Bot2019-04-151-0/+4
| |\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty/masm/assembler/LinkBuffer.h src/qmltest/doc/src/qtquicktest-index.qdoc tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp Change-Id: I7d83ad95cf489dda794dd7a0a33bad3ef3b05609
| | * Don't create value types for QImage and QPixmapUlf Hermann2019-04-121-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | Those are "scarce" resources which need to be kept as QVariant. Fixes: QTBUG-74751 Change-Id: I28381e2a754ed4bbf4e409dc275f6288b64416cc Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Don't use UINT_MAX as invalid array index in PropertyKeyUlf Hermann2019-04-167-70/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Technically UINT_MAX is actually a valid array index, although that is an academic problem right now. However, we do have a method isArrayIndex() and should just use that to determine if a PropertyKey is an array index. Fixes: QTBUG-73893 Change-Id: I302e7894331ed2ab4717f7d8d6cc7d8974dabb4e Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* | | Remove QQmlV4HandleUlf Hermann2019-04-101-26/+10
| | | | | | | | | | | | | | | | | | | | | | | | This is just an alias for QV4::ReturnedValue. We can as well use the latter. Change-Id: Ibd2c038a3ca726b39a8f0f05e02922adb9fccbdb Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-04-102-2/+3
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/qml/qqmlmetatype.cpp src/qml/types/qqmlmodelsmodule.cpp Change-Id: Idc63689ba98d83a455283674f4b5cf3014473605
| * | Merge remote-tracking branch 'origin/5.12' into 5.13v5.13.0-beta2Qt Forward Merge Bot2019-04-092-1/+2
| |\| | | | | | | | | | Change-Id: I68211a7d4568a1c31c6a124fe6777709c53736a5
| | * Avoid INT_MIN % -1 and INT_MIN / -1Ulf Hermann2019-04-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Those throw arithmetic exceptions as the result doesn't fit into an integer. Fixes: QTBUG-75030 Change-Id: Ibd978848f42cf1c9da1e4af2dc9d7da123ef8f5a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| | * Fix clang-cl compiler warningsKai Koehne2019-04-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | clang-cl.exe 8.0.0 warns: qv4internalclass_p.h(460,19): warning: unqualified friend declaration referring to type outside of the nearest enclosing namespace is a Microsoft extension; add a nested name specifier [-Wmicrosoft-unqualified-friend] The warning is most likely bogus (otherwise the code wouldn't compile on other platforms. But it's arguably not a bad idea to just qualify the friend declaration. Change-Id: Ia34119661c29cd8619adec70e9999cab2605ff32 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| * | Remove second evaluation of property nameRainer Keller2019-04-081-1/+1
| | | | | | | | | | | | | | | | | | | | | The name was evaluated already at the beginning of the function. Change-Id: I0bf6149c9bce83a543b1946330ec12f318620a71 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | | Remove unused includes of qv8engine_p.hUlf Hermann2019-04-094-4/+0
| | | | | | | | | | | | | | | Change-Id: Ic135a863581d29a3afb9c6c7f070d2630b3913b4 Reviewed-by: Lars Knoll <lars.knoll@qt.io>