| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
This way we get a header-only representation usable for the QmlCommon
module.
Change-Id: Ia75e445ffbee0c3b2d473a2a3a6309b2f12e8eea
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The compiler never links anything and therefore it doesn't need to
unlink, either.
Change-Id: I9ccdc012f9333abc5f4b60174b794e490772e1fd
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Only the compiler ever has to do this, and we want the structure
definition for the compiled data as a common header.
Change-Id: Ie5c6d6c9dcd180dea79f54d0f7d10f3fc50fa20e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
| |
This way we can keep the flag mutilation closely local to the place
where we write the data. Also, SaveableUnitPointer doesn't need a full
CompilationUnit this way.
Change-Id: I01872e4c406cb2ccbaa1fa35325cc063b1e8a7df
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
| |
We don't need to verify the header unless we want to execute the code.
Change-Id: Ieac51c47faafcd7047228b4264aa7750ba3d8889
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
That's the only place where we use it and this way we can remove the AST
dependency from the compiled data.
Change-Id: I530a0f18a08672acd7031a552885b819e6fe2b84
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
| |
The static part can be used for compilation and won't resolve managed
objects. This allows us to remove all the remaining V4_BOOTSTRAP.
Change-Id: Id2f6feb64c48beb2a407697881aea8c0d791a532
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
It's unclear why that was needed.
Change-Id: I0b4d4ebe1992cd2252cfc3eb10baa7f1b3ae1a5a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|\
| |
| |
| |
| |
| |
| | |
Conflicts:
src/qml/qml/qqmlimport.cpp
Change-Id: I6add6267297ea50a646d43d212027a168dca8916
|
| |\
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
tests/auto/qml/qv4assembler/tst_qv4assembler.cpp
Change-Id: I9d31c982881a617099354bf8acceb76332f11496
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
When an error occurred while creating a compilation unit, the pointer
might be set to null. Subsequent use in hashing should check for this,
and not use a nullptr.
Change-Id: I62650917a740c9c1be29608285670153bed8703c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| |\|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
src/3rdparty/masm/assembler/LinkBuffer.h
src/qmltest/doc/src/qtquicktest-index.qdoc
tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
Change-Id: I7d83ad95cf489dda794dd7a0a33bad3ef3b05609
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Since it is possible that CompilationUnit::instantiate() might be called
more than once when the importCount is 0 then it should only create the
imports array when it is greater than 0. This prevents a memory leak due
to the recreation of this array each time it is called even though there
is no imports to assign.
Change-Id: I5d84b01de10bff2ca25248251e8337839e434bd5
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|\| |
| | |
| | |
| | | |
Change-Id: Iaaf9749a812c21c065ded0374ce0aa07de7752cf
|
| |\|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
.qmake.conf
src/qmltest/quicktest.cpp
tests/auto/qml/qmlcachegen/qmlcachegen.pro
Change-Id: I70e96e8817d59647f876b8b77b30cdeede8f0662
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The CompilationUnit class owns the unit data. An exception was made in
bootstrap builds, where it was up to the caller to free the memory. This
lead to cases in qmlcachegen where we didn't free the memory. This is
best fixed by unifying the behavior.
This fixes the build when using an ASAN enabled build, as the runtime
aborts after calling qmlcachegen due to "leaks".
Change-Id: I8b55b4e302a9569a1d4e09eeb488c479368b50f0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|\| |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
src/qml/compiler/qv4compileddata_p.h
src/qml/jit/qv4baselinejit.cpp
src/qml/jit/qv4jithelpers.cpp
src/qml/jsruntime/qv4lookup.cpp
src/qml/jsruntime/qv4runtime.cpp
src/qml/jsruntime/qv4runtimeapi_p.h
src/qml/jsruntime/qv4vme_moth.cpp
src/qml/qml/qqmltypemodule_p.h
Change-Id: If28793e9e08418457a11fc2c5832f03cab2fcc76
|
| |\|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
src/qml/compiler/qqmltypecompiler.cpp
src/qml/compiler/qv4bytecodehandler.cpp
src/qml/compiler/qv4codegen.cpp
src/qml/compiler/qv4compileddata_p.h
src/qml/compiler/qv4compiler.cpp
src/qml/compiler/qv4instr_moth.cpp
src/qml/compiler/qv4instr_moth_p.h
src/qml/jit/qv4baselinejit.cpp
src/qml/jit/qv4baselinejit_p.h
src/qml/jsruntime/qv4function.cpp
src/qml/jsruntime/qv4vme_moth.cpp
Change-Id: I8fb4d6f19677bcec0a4593b250f2eda5ae85e3d2
|
| | |
| | |
| | |
| | |
| | |
| | | |
Task-number: QTBUG-69898
Change-Id: I94bf1aa85c9b2302894f3224e41de81a456211f9
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
When resolving names in the context of QML bindings, we now direct
runtime access to QQmlContextWrapper::resolveQmlPropertyLookupGetter. At the
moment this does basically the same as Runtime::method_loadName, which
we called earlier. However this now provides the opportunity to optimize
lookups in the QML context in a central place.
When performing a call on a scope or context object property, we also
did not use a CallName() instruction - which would have gotten the
thisObject wrong - but instead we use a dedicated
CallScopeObjectProperty and CallContextObjectProperty instruction. These
rely on identifying these properties at compile time, which goes away
with lookups (and also doesn't work when using ahead-of-time
compilation). Therefore the qml context property lookup is using a
getPropertyAndBase style signature and
Runtime::method_callQmlContextPropertyLookup uses that.
For the tests to pass, some error expectations need adjusting. In
particular the compile-time detection of write attempts to id objects is
now delayed to the run-time.
The old code path is still there and will be removed separately in the
next commit (as it is massive).
Task-number: QTBUG-69898
Change-Id: Iad1ff93d3758c4db984a7c2d003beee21ed2275c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The main feature that needs to be implemented in order to enable lookups
in QML files is to respect that the QObject wrapper has its own storage
layer (meta-object properties). Lookups need to be able to index those
when the base is a QObject. This is done by caching the property data
and guarding the validity by comparing property cache pointers.
The same lookup logic is also implemented for value type wrappers.
OVerall there's more that can be done with lookups in meta-objects, for
constant properties for example.
For "global" lookups we have a safeguard in place that generates a
LoadName instruction for property access that should end up in the qml
context wrapper. So no changes are needed here at first, but the lookup
in the QML context can be optimized in the future.
The way of storing the property cache in the lookup itself trades
ugliness on destruction against the creation of less internal classes.
Another option would be to store the property cache in the internal
class and let QObjectWrapper always transition via the property cache.
Task-number: QTBUG-69898
Change-Id: I9c378c071acc6d7d4a34a2a76616f9594119d515
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|\| |
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
src/qml/qml/qqmlmetatype.cpp
Change-Id: I517c001ea4eb0fdd8e469f9fffe5b7559a5b0795
|
| |\|
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
tests/auto/quick/qquicktableview/tst_qquicktableview.cpp
Change-Id: If3bf1abc23a59c458be0bb862d92f2edcb16b79f
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Depending on the type minor version recursive properties should be
available or not. Check for that when resolving grouped properties.
Fixes: QTBUG-33179
Change-Id: Id8f62befdc4a29d879710499e19d3d289bd18775
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|/ /
| |
| |
| |
| |
| |
| | |
I want to be able to read the code.
Change-Id: I063143ff63b0a476d783c892e1d328e7f5133fab
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Collect type information about values used in a function. These include
all parameters, and the results of many bytecode instructions. For array
loads/stores, it also tracks if the access is in-bounds of a
SimpleArrayData.
Collection is only enabled when the qml-tracing feature is turned on
while configuring.
In subsequent patches this is used to generated optimized JITted code.
Change-Id: I63985c334c3fdc55fca7fb4addfe3e535989aac5
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|\|
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
.qmake.conf
tests/auto/quick/qquickpathview/tst_qquickpathview.cpp
Change-Id: Ic1f5e219a255d0613f7654368a5ce3eccb8f0ee9
|
| |
| |
| |
| |
| |
| | |
Change-Id: Ie97ae901283cf431fc38d238ddbc88a18bd630c8
Fixes: QTBUG-72352
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|/
|
|
|
|
|
|
|
|
|
|
| |
This gives us the opportunity to map the JavaScript null to QVariant's
concept of isNull().
[ChangeLog][QML] Assigning JavaScript null to incompatibly typed
properties generates a compile error now, rather than a runtime error.
Fixes: QTBUG-72098
Change-Id: I72fd1c30d84128c774230eaaea10455b2a0e064c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
It's only been 20 years that the new style is the rule...
qv4compileddata.cpp(206): error #823: reference is to variable "i" (declared at line 198)
-- under old for-init scoping rules it would have been variable "i" (declared at line 204)
Change-Id: I4ac1156702324f0fb814fffd156f80ecb6849ee8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|\
| |
| |
| | |
Change-Id: I7623438dde316ae1e97802f91991f2e7ccc205a5
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
It turns out that the context information is lost when using the
compiler. The unit->unitData()->sourceFileIndex is wrong (always 0),
which should probably be fixed. This change only works around that by
using unit->fileName(); instead.
Make sure that the test actually verifies translations happen and have a
context.
Done-with: Jan Arve Sæther
Fixes: QTBUG-71553
Change-Id: Ib5926bd4b9a6267644f5c9328a84c23d61ca5466
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This patch allows QML to access let/const variables defined in JS files.
Detailed changes:
- The recently added ContextType::ScriptImportedByQML is changed to avoid
creating Push/PopScriptContext instructions, similar to
ContextType::ESModule.
- QV4::Module is changed to also work with CompilationUnits which are not
ESModules. In this case QV4::Module will behave as if all lexically scoped
variables were exported.
- CompilationUnit is changed to support instantiating and evaluating
QV4::Modules for non-ESModules as well.
- QQmlTypeLoader is changed to always create QV4::Modules for evaluating
scripts. For the non-ESModule case, the QV4::Module is evaluated inside a
QV4::QmlContext, as before.
- A pointer to the QV4::Module is added to QV4::QQmlContextWrapper, and used
in virtualGet to access the let/const variables in the CallContext. Access
is read-only.
Fixes: QTBUG-69408
Change-Id: I6f299363fdf5e1c5a4a0f1d9e655b4dc5112dd00
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|/
|
|
|
|
|
|
| |
If a tagged template gets evaluated multiple times, the
underlying template object is shared.
Change-Id: Ie2f476fbc93d5991322ce1087c42719a8d8333ae
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
| |
Collect the location of the import/export statement and include it in
the exception thrown.
Change-Id: I7966dfd53ed67d2d7087acde2dd8ff67c64cb044
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
| |
Specialize find() into several methods for different purposes.
Prepares for further cleanups and being able to split up
getter and setter for accessor properties.
Change-Id: Id4ec5509ac1a1361e2170bbfc2347b89b520c782
Reviewed-by: Erik Verbruggen <erik.verbruggen@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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is also pretty straight-forward by adding .mjs as supported
extension in the qmake and cmake support.
This also tweaks qv4engine.cpp to share the same module compilation
function across all code paths.
Change-Id: Ia0e23c78a794f2330ecf8f991ee6ea948f4ac89d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
| |
They must be sorted, no duplicates and only one default entry at most.
Change-Id: Ia9c0e54a761ce7cbfebb837330bf3769d505eb3b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
Move properties from RegExpObject to getters in RegExp.prototype
to be compliant with the JS spec.
Implement support for the sticky flags ('y') and correctly parse
the flags in the RegExp constructor.
Change-Id: I5cf05d14e8139cf30d46235b8d466fb96084fcb7
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of using a re-export, it's also possible to write
import { foo } from "./bar.js"
and then export it again
export { foo }
Typically exported variables are referenced from the locals, but since
we don't add imports to the locals, we need another way of locating
them. This patch uses the index space after the locals in the internal
class for imports, so that after we've identifier the export in the
local export entry table, we can use the local name to search in the
internal class and find imports past the locals.
Change-Id: I58ab79ad3df1bbc1b972f0a2771d9ca1268de27b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The evaluation of a module can have side-effects by modifying the global
object or objects in it. Therefore even a seemingly empty import such as
import "./foo.js"
needs to be listed in the module requests. It's also important that they
are evaluated in the order of declaration. Therefore we collect all
module requests separately - even those that don't have import variables
to process. This patch also ensures that the export and import
declarations are visited in the correct order, by unifying both AST
nodes to be hooked into the statement list.
The fact that we connect the module list items into a statement list is
solely an artifact of re-using defineFunction() which takes a
StatementList as body.
Change-Id: I75dc357b2aecfc324d9a9fe66952eff1ec1dfd8a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
An export such as
export * from "./foo.js"
allows re-directing imports.
Change-Id: I359ce7d4516ed4a7b95e6fcefb4725d854f9c2ce
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The import via
import * as foo from "./bar.js"
allows accessing all exports via the special namespace object. This is
conceptually quite similar to the existing import of .js files in
QtQuick.
Change-Id: Ia6d79342f0884a89dfe4dc07316570ca7789cac0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
| |
This allows exports in the style of
export { foo as bar } from "./baz.js"
Change-Id: I2f723c3d9c5fbc530a30ac5bcb12a02f21918648
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
| |
Add support for the 'u' flag for regular expressions.
Change-Id: I409054eaa9c50183619752d14f2638f5a38c0ea7
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|