Before a import of, say "hello.dart" was printed as
"import './hello.dart'".
Now instead it is printed as "import 'hello.dart'".
At the same time we get rid of a dependency.
Change-Id: I352f0f507168fde75358704ec9bf0e248bb8179d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98480
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Fasta can generate synthetic libraries.
Previously we didn't include them when serializing, but that leaves
references in the binary to libraries that doesn't exist which isn't
ideal.
This change includes them, and adds a flag to kernel Libraries such that
we know they are synthetic.
Change-Id: Ied25a21cd1f384d318347021bc7ec18dae3a4e05
Reviewed-on: https://dart-review.googlesource.com/c/91722
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Before this change we allowed to serialize some references as null,
and would only complain when trying to read the dill back in.
This CL changes that so it complains up front.
It is unknown if any of this would ever occur in practise.
Change-Id: Id5e1af89abfb88a2d4249bd439b53b062d7aeffa
Reviewed-on: https://dart-review.googlesource.com/c/85392
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
The length is redundant if the list is delimited. Serializing the
length had the slight advantage of preallocating a list of the correct
size and the disadvantages of being harder to maintain by hand and
ugly to read.
Instead, delimit lists. The empty list is naturally ().
Change-Id: I17c14f4e0ca4934cfd3dcdf2a0047f87df80bb79
Reviewed-on: https://dart-review.googlesource.com/c/88320
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Serializing Let requires us to serialize variable declarations which are
complicated. They require us to support optional values because they
have an optional initializer. This is done by using a _ for none.
Having support for Let will allow us to support variable get and set.
Change-Id: I207183730389de70409ae6ca5017510420e36830
Reviewed-on: https://dart-review.googlesource.com/c/88182
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Support the rest of the expressions that do not require serializing
DartType, Name, Arguments, or references to other parts of the AST.
Change-Id: Icef3c2824354add1b13fa8c34fa7ff7c48bd2148
Reviewed-on: https://dart-review.googlesource.com/c/87963
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Use the operator string as the tag. This requires us to be able to
serialize a sequence of (two) things. Homogeneous lists don't give us
static typing so we introduce a pair class.
This requires allocating a pair (serializing a list would require
allocating a list anyway). When we start generating and optimizing
the combinator applications we expect to eliminate the pair allocation
overhead.
Change-Id: I5a00c6973b9065ac8a91f1a69b52d97554f1e823
Reviewed-on: https://dart-review.googlesource.com/c/87840
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Begin serializing expressions. Fairly quickly you encounter the cyclic
dependency between class Expression and any subclass that contains
nested expressions. It isn't possible to implement this with immutable
values in Dart.
A quick solution is to break the cycle somewhere. Here, the cycle is
broken by late initialization of the serializer for Expression.
Serializers are still immutable (either const or with all final fields)
and still singleton instances (by virtue of being static fields).
Change-Id: I9886bcd57041744e0ef9e95f7b901fcb94b5e042
Reviewed-on: https://dart-review.googlesource.com/c/87801
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Use json.encode/json.decode. This gets some strings wrong but it
should be enough to make more progress.
Testing with hardcoded strings is already getting awkward.
Change-Id: Ie0b168bec611ed93da13fff90f86232bb56c713f
Reviewed-on: https://dart-review.googlesource.com/c/87663
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
The code in class_hierarchy.dart that looped over override pairs
included implementations inherited from its superclass as potential
overriders, presumably in a broken attempt to include some interface
checks into the mix.
With this problem fixed, the special case in kernel_class_builder.dart
that excluded overriders not declared in the current class (i.e.
declared in a mixin) could be removed without incurring false
positives.
These override checks performed on members from a mixin produce an
extra context message indicating the class where the two members meet,
giving rise to the override relation (similarly to interface checks).
Since the same member can now override more than one member (or even
the same member more than once), the diagnostics message duplication
check has been extended to also include the context in the comparison.
Fixes https://github.com/dart-lang/sdk/issues/34235
Fixes https://github.com/dart-lang/sdk/issues/34285
Change-Id: I990e5719ae1749fd1aad1ad478aaa6e173cb170b
Reviewed-on: https://dart-review.googlesource.com/c/76900
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>