The future non-basic version is to include the following:
* adding missing annotations on nodes
* adding URIs and file offsets to the nodes
* adding nullability markers to types
* stylistic changes
* optimizations
* better surface syntax
* better error messages
Change-Id: If2fc51e4932d9043dd1719b766bd23ff4e0fc1ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154001
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Supplementary changes for handling Classes done in this CL are the
following:
* handling Supertypes
* handling Constructors
* handling remaining kinds of Procedure
* serializing AsyncMarker the same way as flags
* eliminating the need to wrap flags into IntLiteral
Change-Id: Id69c6e37f093cf80206f4657b649f79c75484775
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154000
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
The flags on the fields are serialized as lists of flag names,
allowing for any combination of the flags in any order. Similar
technique is used in this CL to serialize the flags on Procedures and
VariableDeclarations. This is in the contrast with the previous
approach for those nodes, when the flags were the part of the
serialized name of the node (such as "static-method" for static
Procedures or "final" for final VariableDeclarations).
Change-Id: I02eb5ac92f6273542f08f269aee8e6519d3085e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153766
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
In addition to supporting the nodes, the notion of Binder is
reworked. It doesn't store the computed local distinct name on the
node itself now, as it's not always possible (which is the case of
LabeledStatement), but keep it in a map.
Change-Id: I04c08875cbcac3a547d62afbe5b17f023e6f1035
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153342
Reviewed-by: Johnni Winther <johnniwinther@google.com>
The utility class DartTypeComparator allows to compare two dart types
under various assumptions, such as ignoring nullability at the
top-level type node or equating all top types.
Change-Id: I998e4a0a3ac236077cd1bcd12a5ad146ff10bb1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149427
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
The dill file has an index at the end. The last 4 bytes of that index is
a size that indicates how big the file is. This is done to support
concatenated dill files. If the dill is invalid and the size is read as 0
both the VM and the dart kernel reader will go into an infinite loop where
it allocates another list entry on every loop iteration (making the whole
loop not infinate because we will run out of ram soon enough).
This CL fixes the issue by checking the size to be possitive.
Change-Id: I42da0557c6d4a274fdbe1a729fdaf5b8f149b187
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148538
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Metadata repository might be populated lazily as we are traversing the
component, so it is incorrect to skip empty metadata repositories early
in the serialization process.
Instead we filter empty repositories at the very end - after all nodes
were written out.
Change-Id: I159e0c0213a034388855944af03e72786d9e951b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148065
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
The support is added for the follwing statements:
* YieldStatement
* Block
* VariableDeclaration (as a statement)
* IfStatement
* EmptyStatement
+ improve diagnostics in related unit tests
Change-Id: Ib738227c6e8c1963aeaee52630953e07cef4b093
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146800
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Removes the Closure.clone() in sync* by adding an additional closure
around the rewritten sync* function body.
This is a re-worked version of the now reverted:
- https://dart-review.googlesource.com/c/sdk/+/136190
- https://dart-review.googlesource.com/c/sdk/+/144948
This CL includes changes from both the above CLs, in addition to:
- A new 'ShadowRewriter' transformer to do deep rewriting of
shadowed parameters.
Previous versions only rewrote the immediate sync* function, missing
references in nested rewritten functions.
Note: This CL is re-landing largely unchanged since the roll-blocking
issues suspected to be caused by this was later attributed to a
different set of changes.
I have independently re-run all failing external tests to verify
them passing for this CL.
Bug: https://github.com/dart-lang/sdk/issues/37753
Change-Id: Id1670a93961180e8558d7c7eca65fe7e9115f07b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145402
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
* Throw a specific error on mixed compilation mode; let the incremental
compiler ignore that error when trying to initialize (i.e. it doesn't
initialize from it, but it doesn't show any warning either).
* Allow some mixed mode stuff: Eventually the SDK should be in agnostic
mode, so we should allow mixing agnostic with non-agnostic.
Fixes#41493.
Change-Id: Idb33fb31afe6bbba6d74134cb722ca825751898b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143583
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Including the library name/uri in types and member names makes these
unreadable in most cases. This changes that default toStringInternal
to omit the library name/uri but supports a verbose mode that includes
the library name/uri for debugging the rare occasions where they matter.
Change-Id: I783e8bd0ac5d2f19c3051e8e7f226b240c8d1bc8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141546
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This is a bare-bones implementation (and test) for having an explicit
toString on all `Node`s.
This can then be extended as-needed to better suit our debugging
purposes. It's not allowed to leak, though.
Change-Id: I8d3f5a9cd13b292ed7a6bf33762e507286f3fa7d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139805
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
It was literally only used by one test, and only used a single function
not already defined in minitest. That function was only used in one
place and wasn't very useful, so just refactored to not use it.
Change-Id: Ib51ac255233aa29bcaf19aaba16bc99d7eff724d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135965
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Add a flag to the verifier that tells it to assume that full constant
evaluation has been performed. It will then complain about anything
that should not be there after constant evaluation.
Also fix two bugs exposed by the new checks:
- The constant transformer did not visit annotations on type parameters
in function nodes.
- The InstanceCreation constructor did not set the parent pointers of
its children.
Change-Id: Ieef865a51892918e524da973b0cbaf52ed467181
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123400
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
This CL adds a test for what was fixed in
79cc54e519, namely that when loading a
concatenated component, the uriToSource map shouldn't have its values
overwritten with objects with no source in them.
Change-Id: Ief899295d0b4ab97cbfe598a39bb47441d38c3ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119542
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
The Kernel package has its own internal tests for substitution on
DartTypes. This CL updates the parser for the types in the tests, so
that the nullability attributes are recognized and used.
Change-Id: Icef50259b587817407037c23a0bc3bbc0812d638
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113994
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>