| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
These are equivalent to the usual namespace macros.
Change-Id: I3891397511e29694fe508414e77eb8483b877e03
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|\
| |
| |
| |
| |
| |
| | |
Conflicts:
src/qml/compiler/qv4codegen.cpp
Change-Id: I66b7db42bf208855889094ace0267326595ce03c
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We only need to check in one central location and we can allow for more
recursion. 4k recursions seem tolerable. A common default for stack
sizes is 8MB. Each recursion step takes up to 1k stack space in debug
mode. So, exhausting this would burn about half of the available stack
size. We don't report the exact source location in this case as finding
the source location may itself trigger a deep recursion.
Fixes: QTBUG-74087
Change-Id: I43e6e20b322f6035c7136a6f381230ec285c30ae
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Result objects are rather large, 96 bytes here. In a recursive algorithm
such as our parser, we should not keep too many of them on the stack.
Also, the size of Reference can be reduced by employing a bit field
rather than a number of booleans.
Also, try to convince the compiler to inline the accept() functions. The
extra stack frames those create are unnecessary.
Task-number: QTBUG-74087
Change-Id: I5c064491172366bb0abef99ffe9314080401a7d1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|\|
| |
| |
| | |
Change-Id: I69c3e6610ff590d9c18f386fc17ed2e429b58d26
|
| |
| |
| |
| |
| |
| | |
Fixes: QTBUG-72734
Change-Id: I92146ec517c6a26a67e13830618e137f2a3021c2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| | |
So now the FixedPoolArray can be re-used in other places.
Change-Id: I0e0504892944722a0c18f207dc6400d5b314f6ae
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|\|
| |
| |
| |
| |
| |
| | |
Conflicts:
tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp
Change-Id: Ic1dace832ad4b29023d24808b8617b5dcc915eb5
|
| |\
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
src/qml/jsruntime/qv4script.cpp
src/qml/parser/qqmljslexer.cpp
Change-Id: I82252a8c504a4b77c45f4f8efe849ff9acb949fd
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Fixes: QTBUG-71812
Change-Id: I93b99496a7572c0f5128c69b865bb2b4f87d29af
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
|\| |
| | |
| | |
| | | |
Change-Id: Ie977b1998eba8c9aa8582a96132bf1aa0ec55ca4
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This is to prevent extremely deeply nested expressions and statements
make the code-generator run out of (native) stack space.
Task-number: QTBUG-71087
Change-Id: I8e1a20a361bff3e49101e535754546475a63ca18
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
In the previous implementation MemoryPool wasn't able to allocate more
memory than predefined block size (8 kB). Now, if a user tries to
allocate more memory than default block size, the block size will be
increased for current block only. All remain space in a new block will
be used according to the current allocation strategy.
Increasing block size of some certain blocks doesn't lead to
reallocation of the entire memory pool. Also this situation happens very
rarely, e.g., when compiling something contains more than approx. 2500
objects.
Also fixed some warnings and used more casts in C++ style.
Fixes: QTBUG-71195
Change-Id: I65d57959849f282178cffc92285a6a32f6bb9b25
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|\| |
| | |
| | |
| | | |
Change-Id: I85be5e6ef173fa733d7febd3209164bb31762e0d
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
They are required for spec compliance of tagged
templates.
Change-Id: I8ef8e2314843f07a02d204394400f3f3894f8f91
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |/
| |
| |
| |
| |
| |
| |
| | |
This is required to properly implement support for tagged templates
and String.raw.
Change-Id: Id548f97dd8ebfb7206abb55967f979c3fa6f6eea
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
We will want to use that for things like "Don't do this if you want to
use Qt Quick Designer on the file".
Change-Id: I50fefd9dc8896fe98612519dfc8fa765abea2677
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|/
|
|
|
|
|
|
| |
We shouldn't need to include all of the QmlJS AST to deal with source
locations.
Change-Id: I09bd32656b151136fe7cc70318aad26fec3e0056
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
| |
Task-number: QTBUG-71083
Change-Id: I7a06a01871c2ae0b3162699189c4e836c36d7759
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Methods behave slightly different than normal functions as they have
a home object and define how super property access is being done. To
implement this correctly, we need to create these methods during object
initialization time.
Change-Id: Ib3f670c8790b882c6472de786938ca4f0b73f66f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
| |
Change-Id: I171e571a336a15c27881999a10ffe3c52e92d816
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The spec says in 14.4.12 that an anonymous generator declaration can
only occur as part of the export declaration. The same applies to
anonymous function declarations in 14.1.20.
It is only in the default export declaration rule that we can detect
that we have an anonymous declaration/generator, so that is where we
implement the step of setting "default" as the function name.
It is safe to use an empty string in GeneratorDeclaration_Default and
FunctionDeclaration_Default because that rule is only referenced from
HoistableDeclaration_Default, which in turn is only referenced from
ExportDeclaration.
Change-Id: Ibd341b941f67cbcc727da4df23af04af313b6251
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We correctly produce a syntax error for a const declaration that is
without an initialize, such as
const x;
but we have to make an exception if it's part of a for declaration, such
as
for (const x of [1, 2, 3])
Change-Id: Iab86d73f2edc1f3deaf62f0f43f8b04789696b65
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>
|
|
|
|
|
|
|
|
|
| |
Now that ImportDeclaration and ExportDeclaration are also statements in
the AST, we can get rid of the ModuleItemList in the AST. We keep it in
the grammar, but map it to a statement list.
Change-Id: I4cab29fe9b075e88454fe3b194126f728000856a
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>
|
|
|
|
|
|
|
|
| |
Select the correct head when finishing the linked list for ImportList
AST nodes.
Change-Id: I34ae2ccfd0e969dbd92ce2458de019bb02046aa5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
Default export declarations require a binding setup step at run-time, so
we hook it into the ESModule's statement list to make it visible to the
code gen visitor.
We also reserve local slot zero for the default export.
Change-Id: Ie064caad0422b92cfdadbd7d94db72a05e95c0cc
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The entry point from the parsing perspective into modules is not
QV4::Script but QV4::ExecutionEngine::compileModule.
For convenience, the ESModule AST node gets a body, which is the
statement list connected between the ModuleItemList items that are not
import/export declarations.
The QV4::Module allocates a call context where the exported variables
are stored as named locals. This will also become the module namespace
object.
The imports in turn is an array of value pointers that point into the
locals array of the context of the imported modules.
The default module loading in ExecutionEngine assumes the accessibility
of module urls via QFile (so local file system or resource). This is
what qmljs also uses and QJSEngine as well via public API in the future.
The test runner compiles the modules manually and injects them, because
they need to be compiled together with the test harness code.
The QML type loader will the mechanism for injection in the future for
module imports from .qml files.
Change-Id: I93be9cfe54c651fdbd08c5e1d22d58f47284e54f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Always parse 'import' as a keyword, as it is now one in Qml and ES.
* Always parse 'as' as keyword but allow it as identifier using the same
trick as for the other keywords.
This fixes basic import statements such as import "foo.mjs" as bar but
still allows funny variations such as import "foo.mjs" as as.
Change-Id: I76a600aab90c1b5c07d079bf11b0a78742d44c53
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
| |
Change-Id: Iad064b97010548304e37ad6592712d585d2885a3
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
| |
Change-Id: Ic0b70e9b2c6f656a8abdf408013201625045ac65
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
| |
We only support 'pragma Singleton' currently, so there is no need
to parse the right hand side of pragma as a member expression.
Change-Id: Ic0dcbedb52cb58db2fd1cc099f14fd399b7162e3
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This introduces the structures in the AST that allow for the extraction
of imports, exports as well as location of tokens.
The ModuleItemList as entry point is special with regards to the
statements (so not import/export declarations) in the sense that the
statement list contained in ModuleItemList::item is not linked yet
between different ModuleItemList instances.
Change-Id: If553a6ebaf53d5f3cf755c8327d3fe0ea7db68c2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|\
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
src/quick/items/qquickloader.cpp
tests/auto/quick/qquickanimations/tst_qquickanimations.cpp
Change-Id: I0cb9f637d24ccd0ecfb50c455cc210119f744b02
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
After commit 91f3687ee51db83d9018bd61c3fbc736c6e9912e in qtbase,
QString::number includes a zero padding in the exponent that breaks
compliance with the ECMAScript tests. Instead of QString::number, we
have to use a QLocale instance that turns off the padding of the
exponent.
Change-Id: Ib8c63bc501cadca026c52359006628f6c271ba6d
Task-number: QTBUG-69432
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
As with function expressions, class expressions also get an implicitly
defined name if they are directly assigned to a named variable.
Change-Id: I5fda9d74c1c299107f15b82245333b54ca6d8917
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Introduce both types in the AST, and handle them properly
in the code generator.
Change-Id: I754ac0976de69009bdb8b203d890e4ec0ad03b30
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Commit 02252ae08d introduced a QString member in a JS memory pool class,
which leaks unfortunately as the pool is not designed to call
destructors of allocated types. Typically strings in the AST are derived
from input and therefore a QStringRef is fine. The bindingIdentifier in
the PatterElement however is sometimes synthesized, so a separate
storage for dynamically allocated strings in the memory pool allows for
using QStringRef again.
Change-Id: I94d090df653d784c554452722b3b759031e4735b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Don't throw a syntax error when encountering a destructuring
pattern.
Change-Id: I93250a2963d2d50ff61d725229e1b51be17689e9
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: I3a8c15fe221bff04a3b9b21ed8c0b06c04770a3d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fix destructuring targets that are complex lhs expressions.
There are still some failures remaining, but this fixes
another larger chunk of test cases.
Change-Id: Icf08f42d7c70d4e81be5d5d2e27ebe6249d25467
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
We need to iterator over elisions at the end, as those could
trigger side effects by calling iterator.next()
Change-Id: Ieb5fa3562b6e60fdf179fa228510b2eeaaf9da30
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Fix parsing of
var { x = function(){} } = ...
Change-Id: I524e39c7a556c392a5359eafc445b59020ccadf2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
If the anonymous function is bound to an identifier, set the
name to the identifier.
Change-Id: Idbb3170210e6f91cca3c9bd36b2b6ddcb3a50c7b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
This got changed in ES8, but let's already take this in now,
as there are quite a few tests checking this behavior.
Change-Id: I73f86b8fd8a681881bcc9cc3132bef1589d5194f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| | |
Fix the grammar to be compliant with the spec in this case.
Change-Id: I5740c9427db6f5c6c2551d4e23f1f14070e497fb
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
|
| |
| |
| |
| |
| |
| | |
Task-number: QTBUG-67476
Change-Id: Ia8c6863ad35c8a92298e5dffd750d17628200573
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: I70ca83b0ce933d64dad4984a236e48592e989742
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|