Commit Graph

31378 Commits

Author SHA1 Message Date
asiva bb8d145616 Revert "[SDK] Adds an SDK hash to kernels and the VM."
This reverts commit edde575dcd.

Reason for revert: Breaks the Dart to Flutter roll and golem

Original change's description:
> [SDK] Adds an SDK hash to kernels and the VM.
>
> Adds a new SDK hash to kernels and the VM which is optionally checked
> to verify kernels are built for the same SDK as the VM.
> This helps catch incompatibilities that are currently causing
> subtle bugs and (not so subtle) crashes.
>
> The SDK hash is encoded in kernels as a new field in components.
> The hash is derived from the 10 byte git short hash.
>
> This new check can be disabled via:
>   tools/gn.py ... --no-verify-sdk-hash
>
> This CL bumps the min. (and max.) supported kernel format version,
> making the VM backwards incompatible from this point back.
>
> Bug: https://github.com/dart-lang/sdk/issues/41802
> Change-Id: I3cbb2d481239ee64dafdaa0e4aac36c80281931b
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150343
> Commit-Queue: Clement Skau <cskau@google.com>
> Reviewed-by: Jens Johansen <jensj@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

TBR=kustermann@google.com,jensj@google.com,cskau@google.com

Change-Id: I34cc7d378e2babdaaca4d932d19c19d0f35422fc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/41802
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152703
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-06-26 18:54:17 +00:00
Sam Rawlins a558d576b7 Use ///-style doc comments in analyzer/tool
Bug: https://github.com/dart-lang/sdk/issues/33892
Change-Id: I67094e84af2ec54ede00b248a2e67d3cebadc576
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152702
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-06-26 18:46:25 +00:00
Sam Rawlins c68fd58513 Use ///-style doc comments in analyzer/test
Bug: https://github.com/dart-lang/sdk/issues/33892
Change-Id: If61e07fda4d74b1e5171d22403b156855cd00596
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152701
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-06-26 18:45:05 +00:00
Sam Rawlins 648b5e9c68 Use ///-style doc comments in analyzer/lib
Bug: https://github.com/dart-lang/sdk/issues/33892
Change-Id: I573cb81dca6462c571bd6bf7bf309a46fd628967
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152610
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-06-26 17:58:50 +00:00
Sam Rawlins baa5717f78 Use ///-style doc comments in analyzer/lib/src/generated
Bug: https://github.com/dart-lang/sdk/issues/33892
Change-Id: I0cee47b71702a210c5ace9455ce9aaf914355d05
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152683
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-06-26 17:31:58 +00:00
Sam Rawlins a89b7a4ef7 Use ///-style doc comments in analyzer/lib/src/dart
Bug: https://github.com/dart-lang/sdk/issues/33892
Change-Id: I5c4d112228ab2ee23f59743e005a5fde1ae2fff4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152681
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-06-26 16:48:18 +00:00
Joshua Litt f4b19b8c2a [dart2js] Support package json files in modular_test_suite.
Change-Id: I6a17b9604d2a3e01d822a4872a2560f0aff0a63c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152361
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-06-26 15:08:52 +00:00
Clement Skau edde575dcd [SDK] Adds an SDK hash to kernels and the VM.
Adds a new SDK hash to kernels and the VM which is optionally checked
to verify kernels are built for the same SDK as the VM.
This helps catch incompatibilities that are currently causing
subtle bugs and (not so subtle) crashes.

The SDK hash is encoded in kernels as a new field in components.
The hash is derived from the 10 byte git short hash.

This new check can be disabled via:
  tools/gn.py ... --no-verify-sdk-hash

This CL bumps the min. (and max.) supported kernel format version,
making the VM backwards incompatible from this point back.

Bug: https://github.com/dart-lang/sdk/issues/41802
Change-Id: I3cbb2d481239ee64dafdaa0e4aac36c80281931b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150343
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-06-26 13:35:42 +00:00
Johnni Winther d5120208b4 [cfe] Update CFE message to use 'null safety' instead of 'non-nullable'
Closes #42464

Change-Id: I2865cd4ff2fac3c40d5f8b8d26d6b958919682b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152481
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-06-26 13:09:52 +00:00
Jens Johansen b4b44d6b4b Revert "[CFE] Set correct async markers in outline phase"
This reverts commit 2ad66bbffe.

Reason for revert: Seems to break some internal tests.

Original change's description:
> [CFE] Set correct async markers in outline phase
> 
> Change-Id: I4ac1fe1f4195dea2c20b8e55963b7e7dffc2d289
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152330
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Commit-Queue: Jens Johansen <jensj@google.com>

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

Change-Id: Iaa272f1bee8f99dd93e9a351a03a67f67d83e871
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152641
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-06-26 07:49:57 +00:00
Konstantin Shcheglov 13a24f4de1 Issue 42474. Add LibraryElement.languageVersion
Bug: https://github.com/dart-lang/sdk/issues/42474
Change-Id: I316f34b14f01daa517182c1cb7b7c3fb038f0be2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152601
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-06-25 23:54:03 +00:00
Sam Rawlins d022d4c9e1 Migrator: Fix if-null promotion with GLB
Fixes https://github.com/dart-lang/sdk/issues/42375

EdgeBuilder wishes to do its own GLB type-joining, as does FlowAnalysis.
When FlowAnalysis pushes a promotion in ifNullExpression_rightBegin,
and then in write, and then pops those two promotions to join them in
ifNullExpression_end, EdgeBuilder is not given a chance to make its
own GLB node. Instead promotion never happens: the DecoratedType which
is the variable's type is promoted to non-nullable, for the left side.
The DecoratedType for the right side expression is not considered
non-nullable, so the FlowAnalysis.join will always fail to promote.

TypeOperations.adjustPromotedTypes solves this. It is a no-op in all
implementations except in EdgeBuilder.

Additionally FlowAnalysis.write's promotion fails for the same reason:
the only type of interest is the declared type made non-nullable, and
no matter what, the writtenType is not a subtype of this.

TypeOperations.forcePromotion solves this. It is a no-op in all
implementations except EdgeBuilder.

Change-Id: Iba6b9a69583af8fe1aa23124c7d66047acfff495
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152104
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-06-25 21:09:12 +00:00
Konstantin Shcheglov 616ed353a2 Rename / deprecate FileResolver methods.
R=keertip@google.com

Change-Id: I684465db327f5f448a95f57a18cf65e172c09b01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152603
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-06-25 20:59:32 +00:00
pq b42dc32514 add @doNotStore entry
Change-Id: I025b3c71ce05383c93adad0989e57f69972d3304
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152602
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2020-06-25 20:12:32 +00:00
Mayank Patke 3b67681bcc [dart2js] Clean up (pre-)NNBD unit test configurations.
Change-Id: Ife85aafa90b1b0347fabb6e95f3d6c00c5307cd2
Bug: https://github.com/dart-lang/sdk/issues/42063
Fixes: https://github.com/dart-lang/sdk/issues/42063
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152440
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-06-25 18:44:32 +00:00
Paul Berry 8ed0541439 Fix typo causing a test not to be run
Change-Id: I6455621fd59603adf980dddcedb2ee4f1d455664
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152430
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-06-25 17:59:32 +00:00
pq 37ba50cd0c Add @doNotStore.
See: https://github.com/dart-lang/sdk/issues/41941

As per the conversation there, I opted not to handle the formal parameter case.

(My thinking being we could add it as a refinement.)

Change-Id: Ia91c525c8ea4ce26d9debe3f52af9a3018e50d6f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152540
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-06-25 17:27:52 +00:00
Danny Tuppeny 87d431e8de Improve flutter wrap assists when caret is at the offset of an argument list
Bug: https://github.com/Dart-Code/Dart-Code/issues/2492
Change-Id: I296f9396b3eedcbd1a63f272ed34c65f9d95d83b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152521
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <danny@tuppeny.com>
2020-06-25 17:17:12 +00:00
Brian Wilkerson 898f2cc6c7 Remove extraneous references to the virtual annotation
Change-Id: I9361d030ffa9aabeb8c4253553c04d356fc7ff45
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152580
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-06-25 17:04:42 +00:00
Danny Tuppeny d619edf7ae Avoid using a visitor to find the identifier of a completion target
Change-Id: I94a3515912b373cd201a7d110382d126420bc67e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152520
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <danny@tuppeny.com>
2020-06-25 17:02:02 +00:00
Vyacheslav Egorov 4079c373c0 [vm/snapshot_analysis] Extract treemap from snapshot
This also includes few other changes:

- Add ability to collapse leaf nodes in a treemap created from V8 snapshot
profile. This behavior is programmatically controlled by `TreemapFormat format`
parameter and from CLI via `--format` flag. The following options are available
    - `collapsed` essentially renders `ProgramInfo` as a treemap, individual
    snapshot nodes are ignored.
    - `data-and-code` collapses snapshot nodes based on whether they represent
    data or executable code.
    - `object-type` collapses snapshot nodes based on their type only.
- When computing `ProgramInfo` from a V8 snapshot profile no longer create
`ProgramInfoNode` for `Code` nodes which are owned by a function - instead
directly attribute the `Code` node itself and all retained nodes into
`ProgramInfoNode` for the function itself. For stubs (including allocation
stubs) create an artificial `functionNode` instead of using `NodeType.other`.
The only remaining use of `NodeType.other` is for fields.

Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-try,pkg-win-release-try,pkg-mac-release-try
Change-Id: I18e5437a10dd9141adaed5dfd6f0a3545740e2a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152320
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Kenzie Schmoll <kenzieschmoll@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2020-06-25 12:58:28 +00:00
Jens Johansen 2ad66bbffe [CFE] Set correct async markers in outline phase
Change-Id: I4ac1fe1f4195dea2c20b8e55963b7e7dffc2d289
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152330
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-06-25 10:29:28 +00:00
Jens Johansen 653510c06a [CFE] fasta outline respects --omit-platform
Change-Id: I75d38860112d759b2a44de2e69515d2c27f3d7e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152341
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-06-25 06:38:52 +00:00
Konstantin Shcheglov 52d16dfbba Resolve only relevant portion of the file for Cider completion.
R=brianwilkerson@google.com, keertip@google.com

Change-Id: Icf23a79f25baf309f88b737ac061a10a655d2f7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152407
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-06-25 01:02:41 +00:00
Konstantin Shcheglov 2ec47ad273 Use ElementKind.ENUM for enums.
There was a crash internally, caused by the fact that when we have
duplicate name for class and enum, during linking we put them into
different Reference bucket - @class and @enum, and also inside
the class, the reference to its name is the class.

But when we resolve, we check equality of elements using not
references, but locations. So, we need to make sure that their
kinds are also different, so go into different bucket, and so
not equal.

When they are InterfaceType and equal, we would try to match
type arguments against the wrong number of type parameters and crash.

Change-Id: Iee3f8691adac65d4b0395ceec7fc7250f96afa88
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152404
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-06-25 00:20:31 +00:00
Alexander Markov 9672b22099 [vm/aot/tfa] More accurate inference of results of field getters
When getting a value from a field of covariant type we can apply
field guard summary which would narrow field type using the actual
type arguments of the receiver.

This results in more accurate types returned from widely used
iterators and for-in loops.

Doesn't affect Flutter gallery size in release mode.

Fixes https://github.com/dart-lang/sdk/issues/42413

Change-Id: I835756fb18a1fcbf055a43e4ece8b7539f1ba938
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151889
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2020-06-25 00:09:58 +00:00
Brian Wilkerson ff83b0fec9 Add support for navigating from the URI in import and export configurations to the referenced file
Change-Id: Ic6234d9a24dcb52228067b20d69277e47ff89a0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152401
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-06-24 22:46:33 +00:00
Brian Wilkerson d0e78f8a77 Fix the edit groups created by create_missing_overrides (issue 42468)
Change-Id: I53e5f44af3583549f277f1d7acbe1f725f7a6ef5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152400
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-06-24 22:39:18 +00:00
Alexander Markov e2921461e3 [CFE] Fix static type of temporary variable in null-aware spreads
Fixes https://github.com/dart-lang/sdk/issues/42423

Change-Id: If01cefca5cd85c37fb3f886e7caf27cbfd26f367
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152422
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-06-24 21:48:33 +00:00
Mayank Patke cf62339751 [dart2js] Ensure type arguments are passed when invoking a generic
function property.

Change-Id: I387977e2f1fb7732d94331b7a97cceeec767aaae
Bug: https://github.com/dart-lang/sdk/issues/41449
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151301
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-06-24 20:12:39 +00:00
Konstantin Shcheglov a1078d23c0 Remove the return type for inferring FunctionExpression formal parameters.
Change-Id: I5d1ae6b5f563ccbebf01c224d2dec439f0d6986e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152241
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-06-24 16:15:51 +00:00
Konstantin Shcheglov 77b0817f35 Deduplicate computing getter/setter types in override inference.
Change-Id: If800970fca69d0a85d3a23fd3dc4abb5b9b6bb0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152209
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-06-24 16:15:42 +00:00
Dmitry Stefantsov 8e0b0d5fa0 [cfe] Add NNBD-aware constraint gathering and solving
Closes #41105
Closes #41106
Closes #41447

Bug: http://dartbug.com/41105
Bug: http://dartbug.com/41106
Bug: http://dartbug.com/41447
Change-Id: I041c4a861fa580a9a9da77416308300206f4774e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151393
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-06-24 14:35:01 +00:00
Johnni Winther 711da04fb4 [cfe] Associate package uris with bin/test files in packages
This CL adds a package uri to SourceLibraryBuilder based on the
package information computated by package:package_config. This uri is
used to determine whether experimental flags are enabled and thus using
allowed_experiments.json in bin/test folders as well as the lib folder.

Change-Id: I60e6e97139a4a24b8d4d27d314cfc0f7d7bfc816
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152151
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-06-24 14:33:31 +00:00
pq 43eb8790f3 Support for customized diagnostics
Rationale: internally we patch a number of diagnostic messages to add context to messages (and corrections). Introducing maps that allow for customization makes the internal patching process far easier and less prone to error.






Change-Id: I2d1e7488b451654dd24b8ae95647619c65d3974b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151664
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: David Morgan <davidmorgan@google.com>
2020-06-24 13:34:19 +00:00
Vyacheslav Egorov e148167747 [vm/snapshot_analysis] Fix a minor bug in attribution of node sizes.
Previously we given the info node and its corresponding snapshot node we
would attribute the size of snapshot node to the parent of the info node,
which is incorrect.

This CL also includes few other minor changes (all described in
CHANGELOG.md):

-  `--help` output of the command,
the method for detecting executable name was not working correctly
under `pub global activate`: it printed snapshot name, instead of
`snapshot_analysis`;
- rename `README.dart` to `README.md` because `.dart` extension
confuses `pub` analysis.
- add documentation to `ProgramInfoNode.size`.
- add documentation on passing flags to AOT compiler


Cq-Include-Trybots: luci.dart.try:pkg-linux-release-try,pkg-win-release-try,pkg-mac-release-try
Change-Id: I8e8f2e9b7b9bfb3fe688caa16c0490eb8ec60e7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152148
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2020-06-24 11:03:55 +00:00
Jens Johansen b41471670e [CFE] Use experiment flag 'alternative-invalidation-strategy'
Change-Id: Ib7358793c8413aa0a67134e3a00fe1a6c8c4bbb8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150342
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-06-24 08:35:54 +00:00
Jens Johansen 4291a81a02 Add 'alternative-invalidation-strategy' as an experiment
To be used to enable the alternative invalidation strategy for
incremental compilation.

Change-Id: Ie4b140825d90f98aed8209eb3a5da8f2fa4dc192
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150341
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-06-24 07:18:41 +00:00
Konstantin Shcheglov 05167f3b63 Clean up isUnnecessaryCast() and many of its tests.
Change-Id: I74c509aa43fa7e8850b6e2026c570606a8cb18e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152240
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-06-24 05:16:01 +00:00
Konstantin Shcheglov 59b2bc0cdd Clean up matching type parameters in FunctionExpressionResolver.
R=brianwilkerson@google.com

Change-Id: I4ad140fc76e65e7af4cd2e849e2d9e9aac68e9ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152205
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-06-23 22:42:45 +00:00
Konstantin Shcheglov 6a46af25d1 Fix UNUSED_LOCAL_VARIABLE in UnnecessaryCastTest.
R=brianwilkerson@google.com

Change-Id: Iff17cb9c3708b8dfa10c7d9911c42eeccb87b2d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152204
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-06-23 21:55:35 +00:00
Konstantin Shcheglov 16a64f0bde Check for PackageBuildPackageUriResolver in SourceFactory.packageMap
Bug: https://github.com/Dart-Code/Dart-Code/issues/2558
Change-Id: I3270918320a9a15ca3175101da0337145179f6ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152203
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-06-23 21:48:13 +00:00
Devon Carew 1d221b2d93 [dartev] address a few analysis issues in pkg/dartev
Change-Id: Ia6373183dc58f30225b8789ac9ca9816c55d1516
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152182
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2020-06-23 21:40:23 +00:00
Alexander Markov 467c98b846 [vm/aot/tfa] Re-implement protobuf-aware tree shaker inside TFA
This change introduces handling of protobufs while doing type flow
analysis. Metadata in protobuf message classes is updated dynamically
according to the set of called accessors, invalidating and rebuilding
TFA summaries as needed.

Previously, protobuf-aware tree shaker required the 2nd run of TFA
in order to do the actual tree-shaking after protobuf messages are
pruned. This significantly increases compilation time.

AOT compilation time of a large app (--from-dill): 274s -> 152s

New tree shaker is available in kernel compilers under the flag
--protobuf-tree-shaker-v2.

Issue https://github.com/dart-lang/sdk/issues/42442
Fixes https://github.com/dart-lang/sdk/issues/40785

Change-Id: I4347896737b9b0f7407b845e614dda9ba7621921
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152100
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2020-06-23 21:17:03 +00:00
Jaime Wren ccd2af6402 This new tool resolves and evaluates field declarations where the type isn't specified, but is known when the code is resolved, i.e. cases of var i = 1;.
These cases are collected sorted and printed back out to help us improve the context type algorithm, that is we may choose to in completion locations 'var i = ^', to assume that the user will be entering an int type.

Change-Id: Ia3e4663b2cf1614935ff49a4ab10299db0dc909d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151783
Commit-Queue: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-06-23 20:59:03 +00:00
Nate Bosch 14aa6cd87a Remove a debug print statement
Change-Id: Ic2b595fe4201ec83ee374e2208bed7cba1d8be67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152201
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2020-06-23 20:49:23 +00:00
Konstantin Shcheglov 7f824bb02d Check for null in VariableDeclaration context type.
R=brianwilkerson@google.com

Change-Id: Iabf7b76812cdd9480a71b3a396c9895b33e3c998
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152181
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-06-23 19:16:23 +00:00
Brian Wilkerson b95538cff1 Generate tables of keyword relevance
Change-Id: Ic0f07561bd4b4cd81a3b511bac31b0f7b4906319
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151881
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-06-23 18:57:03 +00:00
Sam Rawlins 448016e811 Migrator: add --preview-hostname option
Fixes https://github.com/dart-lang/sdk/issues/41084

Change-Id: I35068ecf2cf0cec5cac418146149d0e0705dc05d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151666
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-06-23 18:50:53 +00:00
Konstantin Shcheglov 6b630c3719 Enabled allowed experiments for the whole package, including bin/ and test/.
Change-Id: I617b80f0ea6a182d6e48eeb731c89cd5659cb567
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152180
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-06-23 18:30:23 +00:00