This reverts commit 3892e95547.
Reason for revert: Breaks Flutter web
Original change's description:
> [cfe] Encode field references as @getters and @setters
>
> This removes the @fields and @=fields canonical name
> encodings that allowed for encoding of conflicting members
> and didn't support field<->getter/setter conversion
> between dills or between outline and full dill.
>
> TEST=existing tests
>
> Change-Id: Id15e58ad4d1847d2c98a688705e5945196146c6d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184783
> Commit-Queue: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Jens Johansen <jensj@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
Change-Id: I744e284b16e097fa0833c5bdf1bc7653f13bdf63
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186147
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
When running dart2js in its "linker scenario" on a large internal app
this saves something along the lines of 140MB of memory.
Change-Id: I348f5c46ec430c5a486591897557bfef95d3b435
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185827
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
This removes the @fields and @=fields canonical name
encodings that allowed for encoding of conflicting members
and didn't support field<->getter/setter conversion
between dills or between outline and full dill.
TEST=existing tests
Change-Id: Id15e58ad4d1847d2c98a688705e5945196146c6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184783
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Most lists created when loading a dill file are growable.
That's not always needed, though, and a non-growable list is more compact than
a growable one.
When running dart2js in its "linker scenario" on a large internal app
this saves something along the lines of 90MB of memory.
Change-Id: I113a73ed150efb56a5172ac7e1daf1d28f4bc188
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185825
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Make Extension.name non-nullable
Make Class.name non-nullable
Make Extension.onType late non-nullable
Make LabeledStatement.body late non-nullable
Make SwitchCase.body late non-nullable
Change-Id: Iccf21fc800faa620c5d4b7bea68f74eec8bf62e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185083
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
The front end previously enforced a stricter-than-spec requirement on
conflicting imports on its own code. The check was included of the
kernel snapshot and therefore always enforced, even in published sdks.
The extra check was removed a month ago and now tools/sdks/ have been
updated to use a later version of the sdk, so the unneeded hide
combinators can now be removed from the source code.
Closes#44667
TEST=existing
Change-Id: I1d1053b1ef9a40b6a918eef515a02d7b404906c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185084
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
This is in preparation to migrate package:kernel to null safety.
For the visitor interfaces to support non-nullable return types, the
implementations must avoid using `null` as return value in its base case.
TEST=Refactoring
Change-Id: Ie8fa5d41b99850d9e4abb59634c72920c64128d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183691
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
In preparation for null safety migration, List.filled is replaced
with List.generate in ast_from_binary.dart where the element can be
created by a simple function expression.
Change-Id: I17bc68edebb8dc7d8918d87e9cdc38a9a8711682
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179761
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This is in preparation to migrate package:kernel to null safety.
For the visitor interfaces to support non-nullable return types, the
implementations must avoid using `null` as return value in its base case.
TEST=Refactoring
Change-Id: Ie5e4153f8d3779d94957bb13b3d2d2a942040ff2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179760
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Changes fields to be either mutable or immutable by construction.
This ensure that we don't create setter references for fields that
cannot be assigned to and is a prerequisite for replacing @fields/
@fields= canonical names with @getters/@setters.
TEST=existing expectation tests and verification
Change-Id: I70b9a504ee6f221b7c334ac02620feb0d5f7ae01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176665
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
This CL adds stub for each concrete mixed in member into mixin
applications. The body of the stub calls the original member via
a super call.
This addition means that resolution of super access now use the
stub and not the original declaration as the target, which means
that it will be correct even when mixed in members are cloned. For
this reason, dart2js no longer needs to perform its own super
member resolution.
When a super call targets a mixin super stub (after cloning) it
can be optimized away by redirecting the call to the `stubTarget`
of the call. This optimization is performed in dart2js.
Since dart2js now uses the correct super target, its runtime
mixin application needs to avoid overriding members already
declared in the mixin application. These members are the
forwarding super stubs which ensure that correct runtime types
when members with covariant parameters are implemented.
Change-Id: Iab71ffcc400aa6a683987bc20b9553a263ebc8e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176526
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Emphasize that the operation is going away,
and mark constructor as deprecated.
TEST= Refactoring+deprecation only, covered by existing tests.
Change-Id: I82aa044cd2cf7bf347b624371399f44bda8f4a07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173261
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
The enum `ProcedureStubKind` together with the flag `isSynthetic`
replaces the flags `isForwardingStub`, `isForwardingSemiStub`,
`isNoSuchMethodForwarder` and `isMemberSignature`.
The semantics of the existing properties on `Procedure` is unchanged.
The new MixinStub and MixinSuperStub stub kinds are not used yet and
the stub target for NoSuchMethodForwarder is not set yet.
TEST=refactoring
Change-Id: I6e81970dbb4baf0229f43c2a0bf0d5e575e65043
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174462
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
This adds the recorded constant coverage to the dill file.
runtimes for constant evaluation:
dart2js: No difference proven at 95.0% confidence
flutter gallery: No difference proven at 95.0% confidence
big internal app: No difference proven at 95.0% confidence
sdk sizes:
vm: ~0.0182%
dart2js: ~0.0137%
flutter: ~0.0197%
compile sizes:
dart2js: ~0.0179%
flutter gallery: ~0.0162%
big internal app: ~0.0414%
TEST=test was fixed.
Change-Id: I347751e4d96d4d62140d26ebe37960f46a0dfbfa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171948
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
This is in preparation to migrate package:kernel to null safety.
For the visitor interfaces to support non-nullable return types, the
implementations must avoid using `null` as return value in its base case.
TEST=Refactoring
Change-Id: I9f9b318982148d844be9826a5f8c88374a9fc402
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172180
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
ClassLevel and Class.level have been unused for (at least) years.
This CL removes them.
Library.flags furthermore had the first bit unused after the 'external'
flag was removed (last year I think).
This CL shifts it down so the actual flags doesn't start at bit 1.
Change-Id: Ie0afd150cad331ea694bc5fe2a20aafed22916cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169202
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
* When initializing from a dill in the incremental compiler check that
the nnbd mode matches what we're asked to compile.
If they don't, silently do not initialize from the file.
* When serializing and deserializing, assert that the individual
libraries match the component compilation mode.
* When appending dill libraries in the CFE, assert that they match
what we're asked to compile.
* Remove NonNullableByDefaultCompiledMode.Disabled -- it's not a thing
anyway.
https://github.com/flutter/flutter/issues/68901
Change-Id: I2e68f17cb3a065c4352e4db7c8aee3c13747f23a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169080
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
- make sure nested blocks scopes are visited
- make sure variable definitions do not leak beyond block scopes
- properly collect scopes for loops, if statements, constructors
- add calculation of fileEndOffsets for blocks
- save block file offsets to dill
- update binary format version
- change kernel readers and writers to read and write block offsets
- change vm readers to read and block offsets for new version
- add missing fileOffsets and fileEndOffsets on functions for
late fields
- add missing fileOffsets and fileEndOffsets on functions for
extensions
- add errors on failures to find scope
- find libraries for private fields correctly
- add more expression compilation tests
- add test to verify fileOffsets and fileEndOffsets are set for
SDK summary (will add full dill tests later)
Closes: https://github.com/dart-lang/sdk/issues/40278
Related: https://github.com/dart-lang/sdk/issues/34942
Change-Id: I5bc1bb645543045b689d8d61069ee77dc4ee9025
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167541
Commit-Queue: Anna Gringauze <annagrin@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>