aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4vme_moth.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QtQml: Call lookups based on enums rather than via function pointersUlf Hermann2024-10-241-6/+6
| | | | | | | | | | | | | | | | | While the C++ standard says that different functions need to have unique addresses, some compilers have take substantial liberties with that rule. This means we can't actually rely on the addresses of our different lookup functions to differ and therefore we cannot use them as discriminator. Introduce an enumeration for all the different lookups and use that instead. Now we can also drop all the purely redirecting methods we've introduced just to have different addresses. Change-Id: Ifa68c27c0d2fef4084893a19227dab21bd948dfd Reviewed-by: Fabian Kosmale <[email protected]>
* Bytecode: Fix macro and remove unused definesOlivier De Cannière2024-08-011-1/+1
| | | | | | | | | | | | The code that handles the GetException instruction uses GetException in the BEGIN macro and HasException in the END macro. Use GetException for both so that they match. Also remove two defines from the instruction generation macros which aren't used anywhere. Change-Id: If5c88e94de831cd3d60d6316026fbf7335fb89e0 Reviewed-by: Fabian Kosmale <[email protected]>
* QtQml: Properly enforce signatures of AOT-compiled functionsUlf Hermann2024-04-261-8/+8
| | | | | | | | | | | | | Pass the metatypes of the contained types rather than the stored types. [ChangeLog][QtQml][Important Behavior Changes] The AOT compiled code for type-annotated JavaScript functions does not let you pass or return values of the wrong type anymore. Fixes: QTBUG-119885 Change-Id: I685d398c0745d32a999a3abd76c622a2c0d6651f Reviewed-by: Olivier De Cannière <[email protected]> Reviewed-by: Fabian Kosmale <[email protected]>
* QmlCompiler: Perform return value assignment inside generated codeUlf Hermann2024-04-241-1/+1
| | | | | | | | | | | | This is in preparation for using exact types and actually enforcing them. We shouldn't wrap the return value into a QVariant in order to then painstakingly unwrap it again. The generated code can already do the right thing. Task-number: QTBUG-119885 Change-Id: I13e517967ee982be717024a9abb74d5e02a185d6 Reviewed-by: Olivier De Cannière <[email protected]> Reviewed-by: Fabian Kosmale <[email protected]>
* QtQml: Re-allow manual calling of signal handlersUlf Hermann2024-02-131-4/+8
| | | | | | | | | | | | | | | The fact that you could do this was due to a mistake in the implementation of QQmlPropertyCache. The cache entry for the signal handler looked like the signal itself. Make it possible to call QmlSignalHandler objects, and output a categorized warning when doing so. Also, align the call code between the interpreter and the JIT. Pick-to: 6.7 Fixes: QTBUG-120573 Change-Id: Ic76d37f587d21b68c55d77a08ac2d30950bec133 Reviewed-by: Fabian Kosmale <[email protected]> Reviewed-by: Yifan Zhu <[email protected]> Reviewed-by: Qt CI Bot <[email protected]>
* Engine: Group 'bad' case handling for optional chainsOlivier De Cannière2023-11-201-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes the way optional chains are dealt with in the bytecode. Instead of dealing with the 'bad' case (where the base of the lookup is null or undefined) of each instruction separately, all optional operations point to the same piece of code at the end of the optional chain to deal with bad accesses. In practice, for the lookup `root?.foo.bar?.baz` the following bytecode instructions are generated. LoadQmlContextPropertyLookup // root GetOptionalLookup --v // ?.foo GetLookup | // .bar GetOptionalLookup --v // ?.baz Jump done ------------v undefined: <----< | LoadUndefined | done: <------< In this way, the 'bad' case is handled in one place at the undefined label. If, on the other hand, the chain evaluation reaches the bottom, one jump takes the resulting value to the rest of the program. In this way, the 'bad' case has a constant size relative to the length of the chain. If no optional operation is performed at all. The 'bad' case handler is not generated at all. For this to work, GetOptionalLookup now jumps to the undefined label when its base is null of undefined. Other operations such as function calls `f?.()`, array access `a?.[0]` and delete expressions `delete foo?.bar` have also been adapted to point to the undefined label. Change-Id: I07158efc8767d84a7588299cae9fb763b0f6e253 Reviewed-by: Ulf Hermann <[email protected]> Reviewed-by: Fabian Kosmale <[email protected]>
* QML: Implement QObjectMethod::virtualCallWithMetaTypesUlf Hermann2023-09-281-128/+31
| | | | | | | | | | | | We can use the same mechanism we have in place when calling typed JavaScript functions. The type coercion is generalized and moved to qv4jscall_p.h. We also use the correct JavaScript coercion in the rare fallback case where the types are actually different. Fixes: QTBUG-113258 Change-Id: I30404ee0122433b47227b2fc0dc4b0e3862a99c7 Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Fabian Kosmale <[email protected]>
* V4: Eliminate "done" from iteratorsUlf Hermann2023-09-081-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of dragging another stack value around to mark if the iterator was done, rather pass it an offset it should jump to if so. It can then jump over any IteratorClose instruction while the ExceptionHandler can still point to the IteratorClose instruction. For this to work, we also have to refrain from checking for exceptions as part of IteratorNext or IteratorClose. If IteratorNext generates an exception, it also jumps to the "done" label, after which we dispatch the exception. We don't want to jump to the exception handler for other instructions in between as that would close the iterator. The iterator should _not_ be closed if it has just thrown an exception, though. The same holds for IteratorClose: If it throws an exception, we don't want to jump back to the beginning of the loop's exception handler, since that would produce an infinite loop. We also don't want to reset the exception handler before IteratorClose because it needs to also be reset if the iterator does not need to be closed. This saves quite a few instructions and stack variables on actual iteration. For destructuring, we have to change the execution flow a bit. We need to first perform the iteration for non-rest parameters, saving the results in separate stack slots. This way we can apply our new "jump if done" behavior if the iterator runs out or produces an exception itself. We then save the "done" state in a separate stack slot, as before. During the assignment of the iteration results to the actual variables, we install an exception handler, so that we can still close the iterator if one of the initializers throws an exception. This produces a few more instructions than before: 1. We need to set and read the "needsClose" variable explicitly rather than having IteratorNext and IteratorDone do it implicitly. 2. We need an additional CheckException after the iteration. 3. We need an additional conditional Jump over the IteratorDone. Everything considered, the savings we get for regular iteration and the more consistent semantics of the instructions involved are well worth the few extra instructions on destructuring, especially since everything those extra instructions do was done implicitly by the iterator instructions before. For consistency, the IteratorNextForYieldStar instruction is refactored to work the same way as IteratorNext: In case of either an exception or "done" it jumps to an offset, and we refrain from individually exception-checking each IteratorNextForYieldStart instruction. Task-number: QTBUG-116725 Change-Id: I9e2ad4319495aecabafdbbd3dd0cbf3c6191f942 Reviewed-by: Olivier De Cannière <[email protected]> Reviewed-by: Sami Shalayel <[email protected]>
* Undeprecate AOTCompiledFunctionUlf Hermann2023-05-231-6/+6
| | | | | | | We're going to call the JavaScript-typed functions a different name. Change-Id: If92c3fb1b16b1b0bd7d009e7dd712ae6405e1232 Reviewed-by: Fabian Kosmale <[email protected]>
* QML: Fix call frame conversion for QVariant return typesUlf Hermann2023-05-041-0/+11
| | | | | | | | | | | The function may return a QVariant in place of the actual type because it cannot express the actual type as-is. This case needs special care because QMetaType::convert() doesn't know what to do with it. Pick-to: 6.5 Fixes: QTBUG-112837 Change-Id: Ibf93a28aa6a60d49c5ab63fa7eed5f5a8e58e163 Reviewed-by: Fabian Kosmale <[email protected]>
* QmlCompiler: Relax shadowing checkUlf Hermann2023-05-021-10/+39
| | | | | | | | | | | | | | | | | If we detect a property or method as potentially shadowed, we don't have to abandon all hope. We can still retrieve it as untyped var. Since there are a number of things we can do with untyped var, this may still be useful. In the same sense, we need to treat function calls as untyped when the function in question can be shadowed. Calling functions with var arguments and return types leads to some more interesting situations in the call frame setup, so we fix that, too. Task-number: QTBUG-112480 Change-Id: I238d1cf04951f390c73e14ed9e299f2aa72b68cb Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Fabian Kosmale <[email protected]>
* Trace: Convert qtdeclarative to use new tracepoint generationAntti Määttä2023-04-261-0/+3
| | | | | | | Pick-to: 6.5 Change-Id: Ieacfa716b657ac221a75cd5a0dd75d5099962e91 Reviewed-by: Ulf Hermann <[email protected]> Reviewed-by: Janne Koskinen <[email protected]>
* Change value encoding scheme to make space for larger pointersUlf Hermann2023-01-121-8/+6
| | | | | | | | | | | | | | | | | | On android and on some other platforms, the upper bits of a pointer are significant. We need to store them in our JS value encoding. Shift the bits around to make this happen. We now can store pointers of up to 57 bits. That's enough for everything we've seen so far. Fixes: QTBUG-101686 Fixes: QTBUG-91150 Pick-to: 6.5 Change-Id: I72e0fe63b27fca94840f82963e4d3936b3581b28 Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Fabian Kosmale <[email protected]> Reviewed-by: Sami Shalayel <[email protected]> Reviewed-by: Ville Voutilainen <[email protected]>
* Replace CallElement with separate instructionsUlf Hermann2022-11-071-6/+0
| | | | | | | | | | We need to do the subscript lookup before generating the arguments since the arguments may change the array. Fixes: QTBUG-106708 Change-Id: Ia3a0dd34c6ed8d39e86ad20911a632d691826322 Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Fabian Kosmale <[email protected]>
* V4: Use an enum to categorize functions and rename aotFunctionUlf Hermann2022-09-291-7/+7
| | | | | | | | We want to use the aotFunction member also for typed JavaScript functions. Change-Id: Iad6d12ebed3ad3069832484137ed8e4d9e7a7cf4 Reviewed-by: Fabian Kosmale <[email protected]>
* QtQml: Remove unused includes in qml, final partSemih Yavuz2022-09-141-0/+1
| | | | | | | | | | | | | | Drop unnecessary includes detected by clangd-iwyu. Add new includes due to the transitive includes. Also, some of the includes were detected as unused even if they were actually in use. In those cases, use angular brackets instead of "" which deceives the tool not to complain. Affected subfolders: JsRuntime, Qml Fixes: QTBUG-106473 Change-Id: I483da15d42a8e3ce6cd3b654909665fff3075d6b Reviewed-by: Fabian Kosmale <[email protected]>
* V4: Fix exponentiation operatorUlf Hermann2022-08-031-4/+1
| | | | | | | | | | We need to use the same algorithm as for Math.pow(...). Since we have jsExponentiate() now, we can use it in all those places. The strange AIX special case is definitely not useful anymore. Task-number: QTBUG-105188 Change-Id: I43a251c71f1b547ad36855ac197080bfea8c94e3 Reviewed-by: Fabian Kosmale <[email protected]>
* QmlCompiler: Really fix writing into argument valuesUlf Hermann2022-07-051-3/+15
| | | | | | | | | | | | | | | | | | | | | | Arguments are now treated as registers "written" at the beginning of the first basic block. By modeling them this way, we can avoid all the complicated logic on whether to use a local or the arguments array when accessing any particular one of them. Furthermore, we can detect whether they are overwritten or not. If they are not overwritten, we can initialize them as a const reference into the arguments array. This way we save a copy. Treating the arguments as generic registers causes the basic blocks pass to aggressively adjust their types, pushing some conversions back into the QML engine. This is good. Unused arguments become void, for example, and don't have to be passed at all. However, we also need a special case for QJSPrimitiveValue arguments now. Pick-to: 6.4 Fixes: QTBUG-104462 Change-Id: I994bea0929bd508aa41db58dee4a7f12cd20f053 Reviewed-by: Fabian Kosmale <[email protected]> Reviewed-by: Sami Shalayel <[email protected]>
* Use SPDX license identifiersLucie Gérard2022-06-111-38/+2
| | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: I63563bbeb6f60f89d2c99660400dca7fab78a294 Reviewed-by: Shawn Rutledge <[email protected]>
* Fix the build with tracing enabledShawn Rutledge2022-06-101-4/+4
| | | | | | | | | line() and column() are functions to be called, not variables. Pick-to: 6.2 6.3 6.4 Task-number: QTBUG-102862 Change-Id: I0d447f1b3723efbcac7180c5253fd1ac2bd295ad Reviewed-by: Fabian Kosmale <[email protected]>
* QJSEngine: optimize isInterrupted handlingMarc Mutz2022-06-041-2/+2
| | | | | | | | | | | The isInterrupted flag is just that: a flag, so it doesn't require acquire/release semantics when loading/storing. Use relaxed loads and stores instead. Change-Id: I6d733a6bebcfc7f2b786265fc28f9ba7e25bb1c7 Reviewed-by: Fabian Kosmale <[email protected]> Reviewed-by: Ulf Hermann <[email protected]>
* Replace synthetic AOT functions with property-to-property bindingsUlf Hermann2022-05-241-4/+1
| | | | | | | | | Those should be more efficient and make your feet attract fewer projectiles. Fixes: QTBUG-103588 Change-Id: I8b25b9edb1edf5e112dbcba5bba898646d29ae2b Reviewed-by: Fabian Kosmale <[email protected]>
* DelegateModel: Use actual bindings for required propertiesUlf Hermann2022-04-111-1/+5
| | | | | | | | | | | | | Tracking the change signals is brittle and error prone. We have bindings for this case. Let's use them. We can construct a synthetic QV4::Function that contains its own QQmlJSAotFunction. In order to pass the property index to the function we generalize the "index" property of QQmlJSAotFunction to contain any extra data the function may want to use. If there is no compilation unit, we pass that instead. Fixes: QTBUG-91649 Change-Id: I0758bcc4964a48c6818d18bfb0972e67dbc16a1f Reviewed-by: Fabian Kosmale <[email protected]>
* QML: Take care of QVariant when converting function argumentsUlf Hermann2022-02-231-3/+11
| | | | | | | | | | | | | We cannot convert to QVariant using QMetaType::convert(). But we can just construct a QVariant with the desired type and data. This will become an issue once we automatically convert argument types to match the desired type inside the function. As a side effect, also allow declaring "var" arguments to functions. Change-Id: Idc14021d8d85d3d09ee7b7f286de91b56ea02bfd Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Fabian Kosmale <[email protected]>
* QmlCompiler: Fix return type calculationUlf Hermann2021-12-061-2/+4
| | | | | | | | | | We can return void from a function, explicitly or implicitly, and we need to be able to wrap that into a QVariant. In order to explicitly return void, we need the void type to be exposed and understood. Pick-to: 6.2 Change-Id: I513cabb25469b89a85b5d212a6825a037400729d Reviewed-by: Fabian Kosmale <[email protected]>
* Allow AOT functions to signal an undefined result via the contextUlf Hermann2021-06-151-1/+3
| | | | | | | | | | | | undefined as value returned from bindings has the special meaning of resetting the binding. As AOT-compiled functions return the actual type of the binding rather than a QV4::Value, we cannot always encode undefined. Therefore, add a flag that tells us whether the result was supposed to be undefined. Pick-to: 6.2 Change-Id: Iac2298869dde80f6d889240dd8200b2ad83e5dc5 Reviewed-by: Fabian Kosmale <[email protected]>
* Eliminate JS call frame from metatypes callsUlf Hermann2021-06-101-1/+1
| | | | | | | | If we call an AOT-compiled function we never need the JavaScript call frame. We can just skip its setup and save some overhead. Change-Id: I39dc2ca6eea5b5a66f3b87b642a310534cecf6cd Reviewed-by: Fabian Kosmale <[email protected]>
* Fix type to be correct in calling Q_ALLOCA_DECLAREJanne Koskinen2021-05-271-1/+1
| | | | | | | | | Fixes compilation issue with Qt_AllocaWrapper version of the macro that tries to use name part as part of variable name. Change-Id: I388ed01caf85e268c758c0ba2474c88fc8da5530 Reviewed-by: Kimmo Ollila <[email protected]> Reviewed-by: Fabian Kosmale <[email protected]>
* Evaluate type assertions in QMLUlf Hermann2021-05-261-0/+6
| | | | | | | | | | | | | | | | | | Type assertions actually check whether the expression matches the type, and return null if it doesn't. [ChangeLog][QtQml] You can use TypeScript-like type assertions using "as" now. In contrast to TypeScript, QML's type assertions are enforced at runtime. If the type doesn't match, null is returned for object types. Also, type assertions can only cast to object types. There is no way to create a value type or primitive type reference. As value types and primitives cannot be polymorphic, this doesn't matter, though. There are other ways of converting those. Task-number: QTBUG-93662 Change-Id: I00fce3d4ea7a8c6b4631c580eaf6c113ac485813 Reviewed-by: Cristian Maureira-Fredes <[email protected]> Reviewed-by: Paul Wicking <[email protected]>
* Optimize the case of AOT functions returning QObject*Ulf Hermann2021-04-191-6/+17
| | | | | | | | | | We don't need to go through all the metatype construction, conversion, and destruction if we know that both the expected and the actual return types are QObject pointers. We can just check if they're compatible and assign if they are. Change-Id: Ic5ab13536cf2e0e2a982ed9a9be81eb5927e85c2 Reviewed-by: Fabian Kosmale <[email protected]>
* Don't pre-resolve the QQmlContext for AOT functionsUlf Hermann2021-04-191-1/+1
| | | | | | | | We only ever need it to retrieve the QQmlEngine. However, resolving the context can involve an allocation. Change-Id: I064fd528fa7ab9bd37043c5dd1c62d17ea9380e3 Reviewed-by: Fabian Kosmale <[email protected]>
* Implement optional chainingMaximilian Goldstein2021-04-131-0/+27
| | | | | | | | | | | | | | | | | This change implements optional chaining (https://github.com/tc39/proposal-optional-chaining) by adding a new type of optional lookup with an offset to the end of a chain. If `undefined` or `null` is encountered during an access marked as optional, we jump to that end offset. Features: - Full support for all kinds of optional chain - With some codegen overhead but zero overhead during normal non-optional FieldMemberExpression resolution - Properly retains this contexts and does not need to resolve anything twice (this has been an issue previously) - No extra AST structures, just flags for existing ones [ChangeLog][QtQml] Added support for optional chaining (https://github.com/tc39/proposal-optional-chaining) Fixes: QTBUG-77926 Change-Id: I9a41cdc4ca272066c79c72b9b22206498a546843 Reviewed-by: Fabian Kosmale <[email protected]>
* Avoid needless construction and destruction of return valuesUlf Hermann2021-03-291-7/+5
| | | | | | | | | | In most cases the AOT compiled function will successfully placement-new the return value. Therefore, we can provide uninitialized space. Only do the construct/destruct dance in the cases when it's already slow. Change-Id: Ia339774fde03e459f290f167ddadd1c47a644b8e Reviewed-by: Fabian Kosmale <[email protected]> Reviewed-by: Andrei Golubev <[email protected]>
* Inline retrieval of QML contextsUlf Hermann2021-03-251-2/+2
| | | | | | | | In the good case this is just reading a few members of the relevant classes. No need to call functions for this. Change-Id: I9908cd6437cf9a1ca840f9aa0e524d3976272d67 Reviewed-by: Fabian Kosmale <[email protected]>
* qv4vme_moth: Assert that sizeOf cannot be 0Fabian Kosmale2021-03-241-2/+5
| | | | | | | | | This fixes CodeChecker warnings about alloca calls with 0; we know however that at this point the metatypes are valid, and thus necessarily have sizeof > 0. Change-Id: I2744374249d7b49459938389695a116484a292fc Reviewed-by: Ulf Hermann <[email protected]>
* Optimize stack frame setup for AOT compiled functionsUlf Hermann2021-03-231-52/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When called via the metaobject system, parameters and return values are passed as void*, with accompanying type information in the form of QMetaType. The same format is expected when calling an AOT compiled function. Previously, we would first convert all the parameters to QV4::Value, just to convert them back the moment we notice that there is an AOT compiled function. This is wasteful. This change provides a second call infrastructure that accepts void* and QMetaType as parameter and return value format, and passes them as-is all the way to any AOT compiled functions. If there is no AOT compiled function, the conversion is done when detecting this, rather than when initiating the call. This also passes the information "ignore return value" all the way down to the actual function call. If the caller is not interested in the return value, we don't have to marshal it back at all. For now, we only add the extra "callWithMetaTypes" vtable entry to ArrowFunction. However, other callables could also receive variants optimized for calling with void*/int rather than V4 values. This required changing the way how function arguments are stored in the property cache. We squeeze the return type into QQmlPropertyCacheMethodArguments now, and we use QMetaType instead of integers. In turn, we remove some unused bits. Change-Id: I946e603e623d9d985c54d3a15f6f4b7c7b7d8c60 Reviewed-by: Fabian Kosmale <[email protected]>
* Optimize QML context retrieval for AOT functionsUlf Hermann2021-03-131-4/+5
| | | | | | | | | | We can cache the QQmlContextWrapper rather than retrieving it twice. Inline some things, and do not unnecessarily create and destroy ref pointers. Change-Id: Ife0980f83b7efe1ea9dc56aacbfbccd029ce77c8 Reviewed-by: Fabian Kosmale <[email protected]>
* metaTypeToJS: use QMetaType instead of idFabian Kosmale2021-02-191-1/+1
| | | | | | Task-number: QTBUG-82931 Change-Id: I7b663c5f774ef3edbb19d5f2ef53cfe623a8e4cf Reviewed-by: Ulf Hermann <[email protected]>
* V4: Store instruction pointer before CmpInUlf Hermann2021-01-271-0/+1
| | | | | | | | The "in" operator may throw an exception. Change-Id: I7d0b6e2212ac6ec237fbf14719349f8e23810028 Reviewed-by: Andrei Golubev <[email protected]> Reviewed-by: Fabian Kosmale <[email protected]>
* masm: Add error handling for failed mprotect()Ulf Hermann2021-01-121-1/+4
| | | | | | | | | | | | If we cannot mprotect() we have to abort the JIT compilation. Delete RepatchBuffer.h as it is unfixable in that regard. Luckily we don't use it. Task-number: QTBUG-89659 Pick-to: 5.15 Change-Id: Ic5ddbdf51b471db4ddeaa75aab48b24c1f7ced56 Reviewed-by: Lars Knoll <[email protected]> Reviewed-by: Andrei Golubev <[email protected]>
* Pass a more comprehensive context to AOT-compiled functionsUlf Hermann2021-01-111-3/+6
| | | | | | | | | | We need the compilation unit, and a way to retrieve JavaScript metatypes from it. Also, prepare for cases where we only have a QJSEngine, not a QQmlEngine, and pass the scope object as part of the AOT context. Change-Id: Ica81e92c99f3c9b6baffd04db1e0e91603fd2ac7 Reviewed-by: Andrei Golubev <[email protected]> Reviewed-by: Fabian Kosmale <[email protected]>
* Allow JavaScript primitive type transformations inline in C++Ulf Hermann2020-12-181-1/+1
| | | | | | | | | | We don't want to call into the engine just for adding two numbers. This implements the most common operators on primitive JavaScript values. More are to follow in the future. Change-Id: Id51a5af59a3af9fec78a2d8f293e59e6567e9204 Reviewed-by: Fabian Kosmale <[email protected]>
* Let AOT-compiled functions modify their argumentsUlf Hermann2020-12-021-1/+1
| | | | | | | | It allows for more natural looking generated code and there is no downside. The arguments are specially prepared for the call anyway. Change-Id: I8437e93adb1c67db1b53fbdb29cbea10f6ef278f Reviewed-by: Fabian Kosmale <[email protected]>
* Construct arguments for AOT-compiled functions before metaTypeFromJSUlf Hermann2020-12-021-2/+1
| | | | | | | | metaTypeFromJS expects to assign the value using regular operator=. That destructs the old value and therefore the old value has to exist. Change-Id: Ife443b184c30d658f42b65c6717e80685f6635d5 Reviewed-by: Fabian Kosmale <[email protected]>
* Don't call alloca(0)Ulf Hermann2020-11-231-13/+28
| | | | | | | | Apparently that's not a good idea. Change-Id: Ic49f6d40135f65e39725acd7a745d17917b64be3 Reviewed-by: Maximilian Goldstein <[email protected]> Reviewed-by: Fabian Kosmale <[email protected]>
* V4: Allow passing arguments to AOT-compiled functionsUlf Hermann2020-11-201-12/+25
| | | | | Change-Id: I2340f4413ae9a44c71000e840a79e904b6a0fec9 Reviewed-by: Fabian Kosmale <[email protected]>
* V4: Deal with AOT-compiled functions returning QVariantUlf Hermann2020-11-171-2/+11
| | | | | | | | In this case we need to pass a pointer to the return variant itself, not to its data. Change-Id: I86e468f106f29e1f1be8adee9882d465fd6da533 Reviewed-by: Fabian Kosmale <[email protected]>
* Adapt to qtbase changesFabian Kosmale2020-08-231-1/+1
| | | | | | | | | | | The internal QVariant constructor taking a QMetaTypeId has been removed. Thus, construct QMetaTypes where necessary from the id, or avoid a QMetaType -> ID -> QMetaType roundtrip where we already have a metatype. Also fix a few missing includse that were previously transitively included. Change-Id: I56ce92281d616108a4ff80fe5052b919d1282357 Reviewed-by: Fawzi Mohamed <[email protected]>
* Add support for binding ahead-of-time compiled bindings to QPropertiesSimon Hausmann2020-04-221-0/+8
| | | | | | | | | | When the ahead-of-time built binding returns the same type as the QProperty, then we can connect them directly with a small shim and pass through the context and scope objects. Change-Id: I9cb49d1fa35490a4ccb06965397674d5534c067d Reviewed-by: Fabian Kosmale <[email protected]> Reviewed-by: Ulf Hermann <[email protected]>
* Add more trace points to Qt QMLMilian Wolff2019-12-131-1/+1
| | | | | | | | | | | | This patch aligns the trace points more with the existing coverage from the Qt QML profiler. The following things can now be traced: - file compilation time - binding execution - signal handling Change-Id: I5b7f1a495f0556482ccd5c07474391b291742ef1 Reviewed-by: Ulf Hermann <[email protected]>