Commit Graph

1507 Commits

Author SHA1 Message Date
Johnni Winther 4e1c79d86b [cfe] Don't clone synthetic members into mixin applications
Change-Id: I8e92b95ae29f8cec16f69f59cc52c203bba5ea6f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186140
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-02-22 16:17:29 +00:00
Johnni Winther 8f0d5ef076 [kernel] Change InstanceInvocation.interfaceTarget to Procedure
Change-Id: Id45bc682dfcd48f8b40192bfc519272ea0c440f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186141
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-02-22 15:21:19 +00:00
Johnni Winther 79de274398 Revert "[cfe] Encode field references as @getters and @setters"
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>
2021-02-22 12:56:43 +00:00
Jens Johansen 460df98213 [kernel] Use const lists for empty lists when not using growable lists anyway
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>
2021-02-22 10:36:38 +00:00
Johnni Winther 9a74bcef97 [dart2js] Support new method invocation encoding in static type visitor
This is the first part of using the new encodings of MethodInvocation,
PropertyGet and PropertySet in dart2js. In this CL the new visitors
are implemented in static_type.dart. This change is done by refactoring
the existing implementation into helpers and new registration methods
that can be used by both the old and the new encoding but lends itself
to take advance of the new encoding. The new encoding is not enabled
until all of dart2js has been migrated to the new encoding. The
refactoring is intentionally not changing the outcome of the
static_type.dart to make it easier to detect accidental regressions
introduced by the migration.

Change-Id: I93d2033969c33d4c7a5957ad7a6c0b1cdf47fe6f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184220
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2021-02-22 10:12:08 +00:00
Johnni Winther 3892e95547 [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>
2021-02-22 09:46:18 +00:00
Jens Johansen 433d59b917 [kernel] Add option to dill loader for not using growable lists; use in dart2js
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>
2021-02-22 09:31:08 +00:00
Johnni Winther a8297fd7ed [kernel] Make InterfaceType.className final
TEST=pkg/vm/lib/transformations/mixin_deduplication.dart

Change-Id: I95adf2fbe31e3cabd9b1a52a0f4545b5281e6775
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185546
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-02-21 09:55:17 +00:00
Johnni Winther c6e068aff0 [kernel,front_end] Part 1 of migration wave 2
Change-Id: I4c6413c2011da55ad1d82739130be750cc2b8b37
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185380
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-02-18 20:04:40 +00:00
Johnni Winther cea1e14c68 [kernel] Make various AST fields non-nullable
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>
2021-02-18 17:52:27 +00:00
Johnni Winther 8467186ca0 [kernel] Initial migration of package kernel wave 1
This CL completes the migration of the first wave of
interdependent libraries in package:kernel, including ast.dart.

In order to ensure non-nullability on AST properties, the Transformer
has been split in 2 variants: Transformer which doesn't support
removal of nodes and RemovingTransformer which supports removal where
allowed by the context using 'removal sentinels'.

Start reviewing Transformer and RemovingTransformer in visitors.dart
since many of the changes are caused by the changes here.

Included in the migration are the mixin_deduplication.dart and
unreachable_code_elimination.dart since these needed porting to
the RemovingTransformer which was aided by opting in the libraries
which only depended on ast.dart.

TEST=existing

Change-Id: I9e63b985bd24896c25edd4ee51e37770187bcc17
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184786
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-02-18 16:01:17 +00:00
Johnni Winther 07ddd00e1b [cfe] Remove unneeded hide combinators
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>
2021-02-18 14:23:10 +00:00
Johnni Winther 02f0f53ddf [cfe] Don't block nnbd top merge on typedef types
The MergeVisitor was trying to merge FunctionType.typedefType in order
to merge function types, thus preventing nnbd top merge of two
compatible types that were just introduced through different typedefs
or function type syntax.

Change-Id: Icea75598168c86ed33314db22ebeec3e666c3675
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184785
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-02-16 11:30:21 +00:00
Johnni Winther 78db953aa3 [kernel] Don't use increasing .length = in class_hierarchy.dart
Closes #45013

Change-Id: I1b51818f447faea50fdc34ed7504cba02d65bc34
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184789
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-02-16 10:15:11 +00:00
Johnni Winther 0578c66a98 [kernel] Remove TreeNode.remove
+ restrict replaceWith and replaceChild to only support replacement and
not removal.

TEST=existing

Change-Id: I5381b4907725dd0ea7cf544e133bdb296df48ee0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184469
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-02-16 08:18:51 +00:00
Johnni Winther af0c951d9f [kernel] Partial migration of package:kernel wave 1 (part 3)
Change-Id: Ib4dcc0bc32cba392352adbc3f73861353333e37c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184420
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-02-12 13:52:20 +00:00
Johnni Winther 6c1e985e76 [kernel] Partial migration of package:kernel wave 1 (part 2)
Change-Id: Ib1093ab9414a80f97f51d54589653f62ec34e30a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184267
Reviewed-by: Jens Johansen <jensj@google.com>
2021-02-12 13:52:20 +00:00
Johnni Winther b38c72bc1f [kernel] Partial migration of package:kernel wave 1
Change-Id: Icb42c4cd870bf1830c7399d0f38501348c128028
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184240
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-02-10 15:55:53 +00:00
Johnni Winther ee0c0bcd57 Reland "[kernel] Ensure that visitors don't implicitly returns null"
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>
2021-02-10 07:51:52 +00:00
Johnni Winther 9bd9b3ccd6 [kernel] Use List.generate instead of List.filled in ast_from_binary.dart
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>
2021-02-09 13:58:03 +00:00
Johnni Winther b60e0aa5a1 Revert "[kernel] Ensure that visitors don't implicitly returns null"
This reverts commit ce81216885.

Reason for revert: Flutter dependency

Original change's description:
> [kernel] Ensure that visitors don't implicitly returns `null`
>
> 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>

TBR=jensj@google.com,johnniwinther@google.com

Change-Id: I61b838d3371e6b1de2427716d056324c120be499
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183689
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-02-09 12:41:12 +00:00
Johnni Winther ce81216885 [kernel] Ensure that visitors don't implicitly returns null
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>
2021-02-09 09:46:46 +00:00
Dmitry Stefantsov c6bd2afc10 [cfe] Remove a side effect from computeConstCanonicalType
Closes #44857.

Bug: https://github.com/dart-lang/sdk/issues/44857
Change-Id: I1082fded9a0b06cbcf30c484975b0cf464db75a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182781
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2021-02-08 13:22:13 +00:00
Dmitry Stefantsov 63737581f8 [cfe] Encourage the use of the const NeverType objects
TEST=Covered by existing test base.
Change-Id: Ie858bd5a765d71fa4095eab3373a6ecdb063b260
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183006
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-02-08 10:36:40 +00:00
Johnni Winther 6ce8d74761 [cfe] Add Function.futureValueType and serialize Let.fileOffset
Serializing Let.fileOffset supports positions in stacktraces resulting
from null aware expressions, like `if (o?.foo) ...` when `o` is `null`.

Adding Function.futureValueType supports the proper backend
implementation for the fix in
https://dart-review.googlesource.com/c/sdk/+/181303

Closes #44654

TEST=existing

Change-Id: Ie5939a248d3d8bf41388e8f435e4ba4195afeabd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182269
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-02-04 14:06:47 +00:00
Alexander Thomas c88171c8af [sdk] Bump version to 2.13
TEST=Presubmit tests and local builds
Change-Id: I1b15d60eced0cf3f422548eda75706609f6640cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182624
Commit-Queue: Alexander Thomas <athom@google.com>
Auto-Submit: Alexander Thomas <athom@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-02-04 12:10:17 +00:00
Dmitry Stefantsov 425e4dbe09 [cfe] Sort type variables topologically before building the bounds
Closes #44455.
Closes #34803.
Closes #42434.

Bug: https://github.com/dart-lang/sdk/issues/44455
Bug: https://github.com/dart-lang/sdk/issues/34803
Bug: https://github.com/dart-lang/sdk/issues/42434
Change-Id: I3be93b0d4a251de79c3bfe9829143f0fbec201ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181402
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-02-01 18:46:29 +00:00
Johnni Winther 019ce33409 [cfe] Don't handle synthesized as if they are declared in mixins
Members declared in mixins are treated as if these were declared in
the class where they are mixed in. This means that use their types as
declared types, instead of including them in a combined member signature.

This failed in the case where a member was synthetically added to the
mixin class, because the types of these we wrongfully be handled as
declared types.

We now skip all synthetic members when reasoning about mixed in members
as declared members.

Change-Id: I9c2311b4472fe16162fcdc4c56fce8db2d946f4d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181201
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-01-28 09:39:50 +00:00
Johnni Winther 2761782d60 [kernel] Move switch cases to helpers in ast_from_binary
Change-Id: If3e2854cd6f7118179766e179348fb02227f9798
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181384
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-01-27 18:56:59 +00:00
Dmitry Stefantsov 03e22f5fe4 Reland "[cfe] Pass variance through in ReplacementVisitor"
This is a reland of a212650da6

Original change's description:
> [cfe] Pass variance through in ReplacementVisitor
>
> Change-Id: I8dc9c1a77c5dfe70ad186bbd6254aaf5353aa0ca
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180900
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>

Change-Id: I8e7a6b8acb615c2793062751906830e870b8c513
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181203
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2021-01-26 17:50:09 +00:00
Dmitry Stefantsov cc1cc0bb57 Revert "[cfe] Pass variance through in ReplacementVisitor"
This reverts commit a212650da6.

Reason for revert: Regressions detected by the Dart CI bot.

Original change's description:
> [cfe] Pass variance through in ReplacementVisitor
>
> Change-Id: I8dc9c1a77c5dfe70ad186bbd6254aaf5353aa0ca
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180900
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>

TBR=dmitryas@google.com,johnniwinther@google.com

Change-Id: I678c9f013b1df9c7fe4da043fc1e1b19d3f24168
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181202
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2021-01-26 16:12:01 +00:00
Dmitry Stefantsov a212650da6 [cfe] Pass variance through in ReplacementVisitor
Change-Id: I8dc9c1a77c5dfe70ad186bbd6254aaf5353aa0ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180900
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2021-01-26 14:21:29 +00:00
Dmitry Stefantsov 090b17fe99 [cfe] Don't run findTypeArgumentIssues twice
From the times where some of the type arguments should have been
reported as warnings, the procedure was run twice in two different
modes, in order to report some issues as errors and some as warnings.
This CL is a cleanup that invokes the procedure once.  Additionally, a
refactoring of the return value discipline is made: it always returns
a list and never returns null.  An empty list is returned if there are
no issues.

Change-Id: Id497216bf51f49c86517cf16a52f03da5b65b1fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180570
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2021-01-25 09:53:27 +00:00
Dmitry Stefantsov 2c2cff3a5a [cfe] Fix nullability miscalculations in UP in the CFE
Closes #43479.

Bug: https://github.com/dart-lang/sdk/issues/43479
Change-Id: I95782f4936e13ee2dab238dca158fd2f367aecaf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180564
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-01-22 15:31:48 +00:00
Dmitry Stefantsov c1a401c5da [cfe] Implement weak mode constant canonicalization update
Closes #44641.
Closes #44246.

Bug: https://github.com/dart-lang/sdk/issues/44641
Bug: https://github.com/dart-lang/sdk/issues/44246
Change-Id: I78cb0514a57ab3adafb3639b09ea8930791da030
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179340
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-01-22 12:06:49 +00:00
Johnni Winther af283dedc2 [cfe] Handle Extension.fileUri in getLocationInEnclosingFile
Closes #44719

Change-Id: I5c277e869bf7d24c9db0f3f4b76640aae8a65b22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180181
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-01-21 08:01:23 +00:00
Jens Johansen 6971cddaed [CFE] Fix crash with experimental invalidation and factory with same name as procedure
A factory is saved as a procedure in kernel, and was thus also indexed
as a procedure for the purpose of experimental invalidation.
This caused trouble when having a "real" procedure and a factory with
the same name.
That is fixed by this CL by indexing factories ad constructors.

Fixes https://github.com/flutter/flutter/issues/74180

Change-Id: Ieef0421c29a61e26f2a7ee4bb4f196672afd8445
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180148
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-01-20 13:56:05 +00:00
Johnni Winther fabf3efda4 [cfe] Refactor ClassHierarchyBuilder to use Tuple for computation
Change-Id: I8055552313786814bde6f66214a013a8bedb2078
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177500
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-01-19 19:52:13 +00:00
Johnni Winther 34fb48bb8a [kernel,front_end] Migrate first wave of pkg/kernel and pkg/front_end
Migrates libraries dependent only on already migrated libraries.

Change-Id: I0e85ee8dbc2afce031b92e0009e71c206a55af28
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179502
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-01-18 15:40:21 +00:00
Dmitry Stefantsov 0de9b16e7a [cfe] Give a hint on erroneous super-bounded types
Change-Id: Ifb4caaf8995f9f139fd24b4ae6e9c071a83459ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178240
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-01-14 16:25:23 +00:00
Jens Johansen 4ea0bae02a [kernel] Tools and fixes wrt lazy loading and reachability
Change-Id: I191d338097b09ff2211d6d14c6013632190de629
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178980
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-01-13 14:20:28 +00:00
Dmitry Stefantsov cf8887bd7e [cfe] Update the conversion algorithm for checking super-bounded types
The update is specified in the following:
https://github.com/dart-lang/language/pull/1133

Change-Id: I2850b1acf7c94b8174c21cf899c9b926a03d9cc8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175726
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2021-01-08 11:58:32 +00:00
Jens Johansen 5fac8d3d71 [CFE] Reproduction and fix of duplicate string-named 'abstract member-signature'
Before this CL, the map we use to "reuse" references when doing
experimental invalidation mapped from String to Reference.
In bug #44523 two abstract member-signatures have the same textual
(String) name meaning that via the lookup one would get the correct
one, one would get the wrong one, they would get the same one
which eventually causes a crash when trying to serialize.

This CL fixes the issue by mapping via the Name instead, which
basically - for private names - wraps the name and the library
which disambiguates it.

This CL also includes the reproduction of #44523.

Fixes #44523.

TEST=Mostly relying on existing test coverage.

Change-Id: Ib62ebca0b7f5092f0b8410d3c458663c3032eca1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177704
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-01-07 13:11:18 +00:00
Johnni Winther b4d4316de0 [cfe] Rename stub kinds
ForwardingStub -> AbstractForwardingStub
ForwardingSuperStub -> ConcreteForwardingStub
MixinStub -> AbstractMixinStub
MixinSuperStub -> ConcreteMixinStub

TEST=refactoring

Change-Id: Ice76a41ce8e1071f553ed8fd3ecbb29c97377161
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177129
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-12-29 16:54:55 +00:00
Johnni Winther 42f09a71ba [vm] Re-resolve stub targets on mixin deduplication
This ensures that stub targets are re-resolved when performing
mixin deduplication. In particular member signatures, whose stub
target point the member signature origin, need to be re-resolved
since the origin is serialized together with the interface target
in PropertyGet, PropertySet and MethodInvocation, and if not
re-resolved, might point to removed members.

TEST=pkg/vm/test/modular_kernel_plus_ast_test.dart

Closes #44560

Change-Id: Ib2dd923fbf736a9defe2df38bbc71d442f80b7bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177127
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-12-29 15:01:35 +00:00
Johnni Winther 5ed4e5becd [cfe] Pass references instead of fields/procedures
TEST=refactoring

Change-Id: I6e2d46af9bd58673bda847ea5cf981616e1118b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176667
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-12-29 11:46:15 +00:00
Dmitry Stefantsov 0642e7a245 [cfe] Deem all intersection types syntactically not nullable
Closes #44362.

Bug: https://github.com/dart-lang/sdk/issues/44362
Change-Id: Id54de1848e6af1108956476e241bab5c0ed96a4b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177124
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2020-12-29 09:58:35 +00:00
Johnni Winther 60702d4158 [cfe] Make field assignability immutable
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>
2020-12-28 16:11:14 +00:00
Johnni Winther 52db62dd65 [cfe] Use MixinSuperStub
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>
2020-12-25 23:32:17 +00:00
Sigmund Cherem f376642572 [cfe]: include path to .dill file on version mismatch error messages
Change-Id: I8862abd55c111de2c81c5000539fb69268dcac06
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176921
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2020-12-23 16:31:51 +00:00