| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
Since Qt 6 requires at least C++17, we can finally make use of some of
its goodness.
Change-Id: I56a318bc0b1b60d1e2b0186f335f8feda7622df4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The declarations and usage of runtime functions have seen a number of
changes:
- we don't use the array of method pointers anymore because we don't use
cross-platform AOT JITting
- the check if a method can throw a JS exception was invalid, and was
not used anymore
- value-pointer vs. const-value-ref was inconsistent
This patch cleans that up. By fixing the exception checking, we can now
use it in the baseline JIT to automatically insert those checks. To make
that work correctly, all runtime methods are in a struct, which gets
annotated to indicate if that method throws. (The old way of checking
which type of engine was used is fragile: some non-throwing methods
do not take an engine parameter at all, and those got flagged as
throwing). By using a struct, we can also get rid of a bunch of
interesting macros.
The flags in the struct (as mentioned above) can later be extended to
capture more information, e.g. if a method will change the context.
Change-Id: I1e0b9ba62a0bf538eb728b4378e2678136e29a64
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Get rid of Primitive and move the corresponding methods
directly into Value. Mark many methods in Value as
constexpr and turn Value into a POD type again.
Keep Primitive as a pure alias to Value for source
compatibility of other modules that might be using it.
Change-Id: Icb47458947dd3482c8852e95782123ea4346f5ec
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With const and let it is possible to access the declared member before
initialization. This is expected to throw a type reference error at
run-time.
We initialize such variables with the empty value when entering their
scope and check upon access for that. For locals we place the lexically
scoped variables at the end. For register allocated lexical variables we
group them into one batch and remember the index/size.
Change-Id: Icb493ee0de0525bb682e1bc58981a4dfd33f750e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
| |
Change-Id: I86e89e07197aec6071809c2d32bd5c98cb7ac6f6
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
| |
Support the new.target meta property in the codegen, and
add support for passing the newtarget into the constructor
vtable methods and the execution context.
Change-Id: I62ea58e5e92d894035a76e35776203e9837c383b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
| |
Turns out that the overloading of vtable methods and regular
ones is problematic in some cases. So let's rather make it explicit
which methods are part of the vtable, and which aren't.
Change-Id: Ifee32a26104d30f3c82bca8b5a9cdea2d4f4f526
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Allow for nullptr entries in the vtable. To nevertheless
get some decent error checking if one of the methods is
reimplemented, use a base class for Managed that contains
a full set of the vtable entries all being nullptr's.
Change-Id: Ibc53973b539f87331e8e465a6c44436a30acbefd
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
| |
Regular for loops also have a per iteration context for lexically
declared variables as well.
Change-Id: I35cb58bfb198c7dc32d70f41ea0ced7ddefcc37e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove the need for a specialized catch context, instead
use a regular block context, that also captures the
catched variable.
This also removes the need to do lookups by name inside
a catch expression.
Change-Id: I8b037add7f423922e2a76b4c0da646ca7e25813a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is still to some extend work in progress as
lexically scoped for loops won't yet do the right
thing.
let and const variables are still accessible before
they are declared, and the global scope doesn't yet
have a proper context for lexically declared variables.
Change-Id: Ie39f74a8fccdaead437fbf07f9fc228a444c26ed
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
| |
This is required to be able to turn the internal class into
something that lives on the GC heap.
Change-Id: Ie4318588d420743b1e1ab1cd596a1c9d153eb793
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
| |
We can manage without calls to changeVTable() here, as the
set of classes allocated with this is rather limited.
Change-Id: I804e4850b91c61ebbca8a04edbe51deac911928d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
From now on we prefer nullptr instead of 0 to clarify cases where
we are assigning or testing a pointer rather than a numeric zero.
Also, replaced cases where 0 was passed as Qt::KeyboardModifiers
with Qt::NoModifier (clang-tidy replaced them with nullptr, which
waas wrong, so it was just as well to make the tests more readable
rather than to revert those lines).
Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove code for older versions and streamline #ifdefs.
Remove the helpers macros Q_STATIC_ASSERT_FOR_SANE_COMPILERS
and V4_ASSERT_IS_TRIVIAL.
Task-number: QTBUG-40658
Task-number: QTBUG-51673
Change-Id: Ifa4fab653b10ce7858739adef08364cddc6507cf
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
| |
These can only be referenced through the arguments
objects, and have so far messed up initialization
of local variables.
Change-Id: I3100520ed55c93204dd7953da8cc3d2b7d200d11
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
|
|
|
|
|
|
|
| |
Doing the marking of objects in a function instead of
using the table seems to be somewhat faster.
Change-Id: I9ec00cc0264f9a15c69b285db493bee31d99bf96
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
|
|
|
|
| |
Change-Id: Iad6018f67faa956d385087865fca9d73419e363e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of mimicking a Value. This makes sure that argc now stays
correct even when anything on Value changes.
Most of the change is mechanical: replace callData->argc by
callData->argc().
Change-Id: I521831ae1ffb3966bad6589c18d7a373e13439d7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
| |
Change-Id: I4494dae8166026074c9efc74bac62de9d3fa2342
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
| |
Store the current context in the context member instead of
passing it along as arguments.
Change-Id: If3dd0d32eddb2a02bcbf65fe6e8d15142403170e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
| |
Change-Id: I5b833d1f76899a5b8fceb0f4fc109b77b1b431fc
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
| |
Like this we can avoid creating Scope's when calling
functions.
Change-Id: I59b82c85eafd3a5437c233aba5f2e8330d5ce104
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
| |
Switch to a more efficient encoding of Values. This makes
the type() determination easier and faster than before, and
should allow us to optimize comparison operations better.
Change-Id: I22106262cea052ae1887f42a957860ee00b450e6
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
|
|
|
|
|
|
|
| |
The code is doing the right thing, but was hitting an assertion
meant for other use cases.
Change-Id: I4b175fda32f99fa4f09a19d70a9de33d8eacc6b7
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix the compiler to already deal with duplicated argument names.
Doing this at runtime was not ideal.
Remove the callData member from the context. Instead use the fact that
the arguments already followed the locals in the context. Don't copy the
thisObject over into the CallContext anymore, it's never used from there
anyway.
Fix the ordering of names in the internalclass, so that arguments don't
require special handling anymore when looking them up by name.
Adjust all places that used callData, and related methods.
Change-Id: I0bc45e1be3f1fcd38dc3b4f04e91edaf7b9ed103
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
|
|
|
|
|
|
|
| |
Part 1, where the callData member is moved to CallContext. We'll
get rid of it there in a subsequent commit.
Change-Id: I6218992802133913f7766ebb3d2f47bd29f33907
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
|
|
|
|
| |
Change-Id: I7d8b2e16d2eacf5e0eafb8b8574de51527fd0ac2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
| |
This will allow removing a few more special cases and to simplify
the code further.
Change-Id: I3a958e9f68e3c103ea4f2ee6825f893e5931b11d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
| |
And adjust the name of the corresponding runtime functions.
Change-Id: I4adf7b0e069d9b0dff9162cd1271dafc60be854b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
| |
Those are not being used anymore.
Change-Id: Ia33dd7c3c7ea7828caef0fbf397253249580a4e1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
| |
After the recent changes this can easily be unified with
the call method without loss of performance.
Change-Id: I0385b47b6a86e890f97dcbada3a1be1129ae0b84
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
| |
This should be done by generating different byte code for
the strict/non strict cases. For now the VME has a workaround
checking the isStrict() flag of QV4::Function.
Change-Id: I2faa9e9184ffc5274491067e67f665d6989b54c2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
| |
Instead do it in the VME, where we can then easily separate
into throwing and non throwing versions by bytecode.
Change-Id: Ie63bd5b3610bb85f26fb8979179b2e239876cd97
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
| |
Change-Id: I1fe2ff987e79cf590ad5ad3fc520b17925f8b616
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
| |
Allow for faster calling of builtins, and completely avoid
scope creation in many cases.
Change-Id: I0f1681e19e9908db10def85a74e134a87fc2e44c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
| |
Instead modify our StackFrame struct to hold the
QV4::Function and have a linked list of those for
the frames.
Change-Id: I8676e16bc51a5ba6cf25a5b3423576d44e8a926a
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
And change the signature for VME::exec to take the QV4::Function
that should be executed. This is in preparation to being able
to run functions that will not need to allocate an execution
context on their own.
Change-Id: I34538a8723006f4ec24583805e88a66e750100c3
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
This check now also fails on Win8/msvc2013. It's questionable if it's
useful at all, because the ValueArray at the end of the
CallContextMembers is meant to be of variable-length at runtime.
Task-number: QTBUG-61874
Change-Id: I6f3be8f60e6a2f3e1d134edb68a205222067f68d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
| |
MSVC2013 doesn't like constexpr.
Change-Id: I01d2ec318812cb06872e55d993850cc9c528a826
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The ARM eabi states that 64bit integers are 8-byte aligned (note: iOS
explicitly makes an exception to this). The size of the ExecutionContext
is 9 "pointers" in size, the CallData is 4 "pointers" in size, so on
64bit architectures CallContext is a nice 13 "pointers" sized structure.
However, on ARM the last element of CallData (ValueArray) has a
QV4::Value as its last element, and this needs to be 8-byte aligned. So,
padding will be inserted, and that will grow it from 15 "pointers" to
16.
Task-number: QTBUG-61874
Change-Id: Iba4bc805ef6b459928ef09d604504e896732a8f2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
| |
Plan is to completely remove the need for the simple call context.
Change-Id: Ie5e4673a6746dc110adbf526e45188f218fd7bfc
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
|
|
|
|
|
|
| |
They are just ExecutionContext's.
Change-Id: Id543934740b0e54172e469935513847224b19e79
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
All ExecutionContexts (except for CatchContext) have or can have
some sort of activation object. Unify them in one pointer in
the ExecutionContext class, and unify it's handling where it's
actually the same.
Change-Id: I6750999ddbd5d1d74235ef4b34dcd7546c432541
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Differences:
- push parameters on the stack, including space for CallData members
- call instructions calculate the argument start
- use temp space above the calldata to evaluate arguments
- fewer temporaries are needed when a call is done while generating the
arguments of another call
- when calling the function, the js stack space above the callData is
not used, allowing for optimizations in the future
- Array and ObjectLiteral use the same mechanism
Change-Id: Id100fa06f12cc9d941b0f90b0b81b8270a8e4f5d
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
.qmake.conf
src/qml/jsruntime/qv4argumentsobject.cpp
src/qml/jsruntime/qv4arraydata.cpp
src/qml/jsruntime/qv4context.cpp
src/qml/jsruntime/qv4context_p.h
src/qml/jsruntime/qv4errorobject.cpp
src/qml/jsruntime/qv4functionobject.cpp
src/qml/jsruntime/qv4internalclass.cpp
src/qml/jsruntime/qv4lookup.cpp
src/qml/jsruntime/qv4managed.cpp
src/qml/jsruntime/qv4managed_p.h
src/qml/jsruntime/qv4object.cpp
src/qml/jsruntime/qv4object_p.h
src/qml/jsruntime/qv4qmlcontext.cpp
src/qml/jsruntime/qv4runtime.cpp
src/qml/jsruntime/qv4vme_moth.cpp
src/qml/memory/qv4heap_p.h
src/qml/memory/qv4mm.cpp
src/qml/memory/qv4mm_p.h
src/qml/memory/qv4mmdefs_p.h
src/quick/scenegraph/util/qsgdistancefieldutil.cpp
src/quick/scenegraph/util/qsgdistancefieldutil_p.h
tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
Change-Id: I7ed925d4f5d308f872a58ddf51fdce0c8494ec9c
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We can easily do this now that Managed has a pointer to an
internal class (which always has a back pointer to the
ExecutionEngine).
Remove the extra engine pointer from ExecutionContext, and clean
up tow methods in String.
Change-Id: I98d750b1afbdeadf42e66ae0c92c48db1a7adc31
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This saves another pointer on all Objects.
Currently introduces a slight performance regression
on some of the v8 benchmarks, that needs addressing.
Change-Id: I87de8e1d198d2683f4e903c467ce2a60ba542243
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
And do not store the vtable in Heap::Base anymore. This change
makes the internal class the main distinguishing feature
of all garbage collected objects.
It also saves one pointer on all Objects. No measurable
impact on runtime performance.
Change-Id: I040a28b7581b993f1886b5219e279173dfa567e8
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|