Commit graph

82042 commits

Author SHA1 Message Date
Robert Nystrom 3ac34f791d Change references to "dartfmt" in runtime and tools to "dart format".
In Dart 2.15, we're removing "dartfmt" in favor of "dart format", so I'm
going through and fixing all the dangling references to the old name.

TEST=Only changing tools

Change-Id: I83a5c00be925fdb536014a47dff2b488ed9f478b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215186
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-10-01 18:16:27 +00:00
Konstantin Shcheglov bc5a1138e0 Add several Flutter completion benchmarks.
When running DAS from sources, so might be not exactly as when running
from the snapshot, currently we have following numbers:

Before reverting to allow available declarations:
{das-flutter-completion-start: {micros: 15030209}, das-flutter-completion-smallFile-body: {micros: 619210}, das-flutter-completion-smallFile-body-withoutPrefix: {micros: 484791}, das-flutter-completion-smallLibraryCycle-largeFile-smallBody: {micros: 2348386}, das-flutter-completion-mediumLibraryCycle-mediumFile-smallBody: {micros: 3701027}, das-flutter-completion-mediumLibraryCycle-mediumFile-api-parameterType: {micros: 3332297}}

Current 2021-09-30 master:
{das-flutter-completion-start: {micros: 15194069}, das-flutter-completion-smallFile-body: {micros: 22721}, das-flutter-completion-smallFile-body-withoutPrefix: {micros: 7796}, das-flutter-completion-smallLibraryCycle-largeFile-smallBody: {micros: 552269}, das-flutter-completion-mediumLibraryCycle-mediumFile-smallBody: {micros: 3076925}, das-flutter-completion-mediumLibraryCycle-mediumFile-api-parameterType: {micros: 3010509}}

Current 2021-10-01 master, with snapshot:
{das-flutter-completion-start: {micros: 6657503}, das-flutter-completion-smallFile-body: {micros: 20596}, das-flutter-completion-smallFile-body-withoutPrefix: {micros: 7073}, das-flutter-completion-smallLibraryCycle-largeFile-smallBody: {micros: 556415}, das-flutter-completion-mediumLibraryCycle-mediumFile-smallBody: {micros: 85024}, das-flutter-completion-mediumLibraryCycle-mediumFile-api-parameterType: {micros: 331850}}

Change-Id: I1d76f4f15d36e316b553ffc6cfaf24551c7f9bf5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215240
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-10-01 18:01:49 +00:00
Konstantin Shcheglov 4f80522fe4 Prepare to publish analyzer 2.4.0 and _fe_analyzer_shared 27.0.0
Change-Id: I48d0f8fcd4f966c9c55542ae9d239095b81ea45c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215007
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-10-01 16:45:23 +00:00
Paul Berry 1954b914bc Add documentation to the analyzer messages.yaml file.
Change-Id: I967aba1bd189c7790df4c18c48d100839db7582a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215150
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-10-01 16:44:43 +00:00
Danny Tuppeny 98ee47a11a [dds] Export DAP classes required to build new debug adapters externally
Change-Id: I7bb05b2f467bad5e522898dfaa3d0f1e74c42b58
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215081
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-10-01 16:31:34 +00:00
Danny Tuppeny df67dc892b [dds] Add some basic test reporting for DAP test adapter
Change-Id: I39ca29ee5809fd0d6ef30ee163298f66749bed0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215080
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-10-01 16:31:34 +00:00
Robert Nystrom 1a218ca03f Remove dartfmt from SDK artifact size benchmark.
Dart 2.15 won't contain it as a separate snapshot.

Change-Id: I8f356a4b9c88fd736f755d8f85b68f8e18f6ec78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215182
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-10-01 15:45:53 +00:00
Paul Berry 67a119abe8 Update nomenclature in messages.yaml files.
Change the terms `template`/`tip` in the analyzer and front end's
`messages.yaml` files to `problemMessage`/`correctionMessage`.

Rationale: these terms were previously agreed on for unifying the
analyzer and front end, and they are currently used in the
`Diagnostic` class, which is part of the analyzer public API.
Change-Id: Ifaed92ab5176bba7b7f4c3bb915e9839520330f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215149
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-10-01 15:32:06 +00:00
Paul Berry 97255ff97e Code generate analyzer errors from the analyzer's messages.yaml file.
Change-Id: I1687acd7c777733caf93e20d703554c2a7da26cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214304
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-10-01 15:24:13 +00:00
Sigurd Meldgaard eb39128530 Tool for bumping dependencies
Aims to automate the process of bumping a single dependency.

To bump pub_semver to the newest commit invoke as:

```
> dart tool/manage_deps.dart bump pub_semver
```

Change-Id: I16a3edabfb03adbd4460fb3cd81738a792e44d50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213764
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
2021-10-01 14:15:16 +00:00
Paul Berry bdbb4baea5 Create a YAML file to hold analyzer error text.
I've included both the YAML file (`messages.yaml`) and the script I
used to create it (`extract_errors_to_yaml.dart`), so that we can keep
the YAML file up to date until we finish writing logic that code
generates the analyzer errors from the YAML file.

Change-Id: Icbdcaf63a37105b666b11f7356e3fa246a8d65cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214133
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-10-01 13:04:39 +00:00
Alexander Thomas cbe578bb17 Add a security policy for the Dart SDK
Bug: b/200122212
Change-Id: I7f7f11f24034c525cb0f3baab3120ba15b3cb9d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215061
Reviewed-by: Michael Thomsen <mit@google.com>
2021-10-01 13:01:31 +00:00
Sam Rawlins 8029600b24 analyzer: Use correct instantiated type in const function-typed assignment
This fix is pretty simple; we have the inferred type available on [node], so we just need to create a new DartObject which uses that type.

Bug: https://github.com/dart-lang/sdk/issues/46020
Change-Id: Ib53ff381b8c9c864f97eb2a4869d3798e028c30f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215003
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-10-01 12:51:59 +00:00
Sigurd Meldgaard 72f7fee598 Bump pub to 37d05928939b3100e7e55c3dff922651db1de1e1
Changes:
```
> git log --format="%C(auto) %h %s" a817863..37d0592
 37d05928 Don't ignore 'packages/' over the root-dir (#3162)
 85e11718 Add in-memory cache to store version listings (#3163)
 46f79d5b Use source.hasMultipleVersions to decide when to show version constraint. (#3159)
 0e553a07 Warn against likely bad env-var name (#3146)
 30580bee Migrate src/git to null-safety (#3158)

```

Change-Id: Ic04937ad0adbeb228770087dedb25ccfcc4f3206
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215202
Reviewed-by: Sarah Zakarias <zarah@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2021-10-01 10:49:16 +00:00
Robert Nystrom d1383452cc Change "dartfmt" to "dart format" in FFI tools.
Change-Id: I9fe047c79ec79728f26184ee2cf69c7776099568
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215185
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2021-10-01 05:56:55 +00:00
Robert Nystrom 5fbde4d850 Remove mention of "dartfmt" from analyzer README.
In Dart 2.15, we're removing "dartfmt" in favor of "dart format".

Change-Id: Id26b32872e72e97a45cfd1e28defea9adc38aa24
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215183
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-10-01 04:41:04 +00:00
Stephen Adams 09b15a583c [dart2js] Move --csp flag handling to 'features'.
Change-Id: Iae6c01c10121023a02f8c850247f41007727ea75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215009
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2021-10-01 04:23:24 +00:00
Robert Nystrom 765a6cf282 Change "dartfmt" to "dart format" in dart2js_info tool.
Change-Id: Id21c2f2ceb58f5007c55eeea6a1d57bb09f2f0c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215184
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2021-10-01 01:01:54 +00:00
Robert Nystrom 0ea8347576 Remove references to dartfmt in various comments and docs.
Change-Id: I02112ce2920d71f84ce4808c13a62e1a1765d83f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215181
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-10-01 00:56:14 +00:00
Brian Quinlan 8e6f639a7e Add some extra documentation for Platform.operatingSystem
Change-Id: I8918fd7476be72c426d6009122e7c90a2d078bc5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215144
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2021-09-30 22:58:44 +00:00
Riley Porter 1332c63a4c Revert "Add a generic return type for js_util functions"
This reverts commit 46486cf260.

Reason for revert: Causes dart analyzer and dart linter to find
issues within google3 and flutter, causing breakages and blocking
the roll.

Original change's description:
> Add a generic return type for js_util functions
>
> Allows further optimization to pass along return type
> information and remove extra AsExpression casts.
>
> Change-Id: I87aef171887e3f9af4c80003ff284eb2503d0cdb
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214460
> Reviewed-by: Srujan Gaddam <srujzs@google.com>
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Commit-Queue: Riley Porter <rileyporter@google.com>

TBR=sigmund@google.com,srujzs@google.com,rileyporter@google.com

Change-Id: I6f4ff8f51f44d3e2eb1a140c93485ebe28189984
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215160
Reviewed-by: Riley Porter <rileyporter@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
2021-09-30 22:52:12 +00:00
Mayank Patke 36a2120b73 [dart2js] Use Field.fieldReference in late lowering.
Change-Id: Iead2390ff5a9fffa611e8e4af96ab2ecfa6b93d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214440
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2021-09-30 20:54:54 +00:00
Brian Wilkerson dbbaf94d39 Add a fix for unnecessary_getters_setters
Change-Id: I8098f61dd83083a5772230cbeae4273c5d3f3d35
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215121
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-09-30 20:35:37 +00:00
Alexander Aprelev 56403a0d35 [vm/sendandexit] Introduce Isolate.exit([port, message]).
This exits current isolate immediately. If [port] is provided, then [message] is verified and sent out as isolate exits.

TEST=ci
Fixes https://github.com/dart-lang/sdk/issues/47164

Change-Id: I513f4d7ceb5d74820f4aee60f5799b7b5193f2e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214312
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-09-30 20:20:24 +00:00
Jake Macdonald ead8b7f6ac add test that repros issue #47338
This currently fails for the CFE with:

static error failures:
- Unexpected error at line 137, column 14: A value of type 'int?' can't be assigned to a variable of type 'int' because 'int?' is nullable and 'int' isn't.
- Unexpected error at line 137, column 25: Operand of null-aware operation '!' has type 'int' which excludes null.

Bug: https://github.com/dart-lang/sdk/issues/47338
Change-Id: Ia55e19a0bf296a8427f6510d6ddda5016acdecea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215101
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2021-09-30 18:14:44 +00:00
Riley Porter 46486cf260 Add a generic return type for js_util functions
Allows further optimization to pass along return type
information and remove extra AsExpression casts.

Change-Id: I87aef171887e3f9af4c80003ff284eb2503d0cdb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214460
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
2021-09-30 17:13:49 +00:00
Sam Rawlins fc7bb0db54 Correct span for dead collection-if (then and else)
Fixes https://github.com/dart-lang/sdk/issues/47305

Change-Id: I58c3bb005fa0fea73092063120f1a2aa9ad1744b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215016
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-09-30 16:59:10 +00:00
Konstantin Shcheglov 5521b19af5 Add assertHasLintFix() to help with testing g3 specific lint fixes.
Bug: https://buganizer.corp.google.com/issues/200632192
Change-Id: I5ea9d73ba440485ffeb72a189b3e77d24cb6bea0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215000
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-09-30 16:52:38 +00:00
Ryan Macnak 1e4a611ca4 [vm, service] Create edges from the root to objects on read-only pages in heap snapshots.
This prevents objects, such as InstructionSection, that have no ordinary references from being labeled as "Uncollected Garbage".

TEST=examine heap snapshot in an AOT build with bare-instructions enabled
Bug: b/200288075
Change-Id: If576d7f9eabb80afaca1b600507c3a9629beeafd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215006
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-09-30 16:50:58 +00:00
Devon Carew bafa71a8ae Add the ability to specify additional imports for doc samples.
Change-Id: I1c9592d4ce66d08aafacd5ae9722defa114c9953
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214867
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2021-09-30 16:35:59 +00:00
Konstantin Shcheglov 8c41cc9537 Issue 47302. Enable type parameters as potentially constant expressions.
Bug: https://github.com/dart-lang/sdk/issues/47302
Change-Id: I95d1b94efe5cc2877d37bc5ac615869233395189
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215014
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-30 15:42:29 +00:00
Vyacheslav Egorov 62a903fe11 [vm/aot] Prefer EqualityCompare to avoid redundant boxing
When specializing x == y comparisons where one of the operands is known
to be a Smi but the other one is *not* only emit StrictCompare
if either x or y are nullable. For non-nullable equality comparisons
prefer EqualityCompare which allows to avoid redundant boxing as
non-nullable integer values are highly likely to be unboxed.

TEST=vm/dart{,_2}/aot_prefer_equality_comparison_il_test

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-nnbd-linux-release-simarm64-try,vm-kernel-precomp-nnbd-linux-release-simarm_x64-try
Change-Id: I1153f111dcbb518d25d753dc4357c72522389951
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214962
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2021-09-30 13:37:21 +00:00
Vyacheslav Egorov 8740a4f10f [vm/infra] Nascent AOT IL tests infrastructure.
Our current unit testing infrastructure does not make it possible to
test AOT compilation pipeline end-to-end, because it does not run TFA
when generating Kernel.

This makes it challenging to write regression tests for certain issues.

Instead we extend test runner with a capability to perform IL matching
when running AOT tests.

runtime/docs/infa/il_tests.md provides details on how to write such tests.

TEST=manually

Change-Id: I6f5220b814f4a5d8c053efacd3711df495dea404
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214961
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2021-09-30 13:19:42 +00:00
Daco Harkes 7ffd140a4e [vm] Eagerly flush logs on Android
Android truncates on 1023 characters, flush more eagerly.
Flush on newlines, otherwise Android inserts newlines everywhere.

Closes: https://github.com/dart-lang/sdk/issues/47332

TEST=Manually tested in Flutter custom engine build.

Change-Id: Ie559636f49903cd6a9c4729b870674b3b12804c8
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-kernel-precomp-android-release-arm_x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215060
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-09-30 11:49:24 +00:00
Konstantin Shcheglov 8db6adad53 Remove unused ResolutionTest.enableUnusedElement/enableUnusedLocalVariable
Change-Id: Ib345a791ddbcda10116a0e40e09a03fbe22d5ef2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215015
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-30 02:19:01 +00:00
Konstantin Shcheglov e24865a79e Tweaks for benchmarks.
Change-Id: Ic297a845af1e530e7fdf22b9e910d2e725be4e99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214871
Reviewed-by: Devon Carew <devoncarew@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-30 01:29:30 +00:00
Konstantin Shcheglov 80e10e3626 Replace isNonNullableByDefault with FeatureSet in getNotPotentiallyConstants().
We need to check for more features now.

Bug: https://github.com/dart-lang/sdk/issues/47302
Change-Id: I601160aa4133e25695ead18d180f7efd2e410300
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215005
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-29 23:08:00 +00:00
Nicholas Shahan bb4e445b6e [ddc] Add expression evaluation tests
* Tests constructor tear off values and calling torn off constructors.
* Covers default, named, redirecting, and factory constructors at break
  point locations in a method, global function, and inside the default
  constructor.
* Create new test suites for legacy code (Dart language version 2.11)
  in amd and ddc module systems.
* Sound and Unsound suites now run code without a Dart language comment.

Change-Id: I9cf16c258ce6ece7c436f9deb044ed821f980d1b
Fixes: https://github.com/dart-lang/sdk/issues/47214
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214866
Reviewed-by: Anna Gringauze <annagrin@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2021-09-29 19:33:32 +00:00
Paul Berry bbbd124c59 Create tables mapping CFE/analyzer error codes and indices.
Previously, these mappings were computed on the fly during generation
of syntactic_errors.g.dart.  Moving the mappings to their own data
structure makes the logic easier to re-use.

Change-Id: I1c38649b8c4aa4a42a6aa560faf67502d1c6560f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215001
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-09-29 18:16:30 +00:00
Konstantin Shcheglov 5536a7e664 Fix O(n^2) in collectAffected().
I will try to optimize it further later, but for now O(n) even
thought with somewhat high coefficient should be good enough.

Change-Id: Ia73a34c86e1da90ea4188340aa43983d79732392
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215002
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-09-29 18:12:32 +00:00
Ahmed Ashour dae0de9755 ChangeBuilder to always write parameters' types for Function
Fixes https://github.com/dart-lang/sdk/issues/29050

Change-Id: I89c0f2dab6d8bcd5af865c6e75022100df1596c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212822
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-09-29 17:02:21 +00:00
Ahmed Ashour 65db608726 REMOVE_UNNECESSARY_CAST to be in bulk.
Fixes #47156

Change-Id: Id285c38b01124f8c404185a58c6b98bda87cefe1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212823
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-09-29 17:01:50 +00:00
Paul Berry 7b4714d355 Migration: properly handle dynamic in code declared external.
Fixes #47307.

Bug: https://github.com/dart-lang/sdk/issues/47307
Change-Id: Iad6fa8a413e81cbd8902c223fa722c7da6850aa6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214980
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-09-29 16:24:20 +00:00
Ben Konyi fc4ab33fc1 [ CLI ] Shutdown DartDev isolate properly when error condition encountered
Fixes https://github.com/dart-lang/sdk/issues/45771

TEST=CQ

Change-Id: Id0d706c9c28383fe0395eee5bbe8eeb06a8aed46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214343
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-09-29 14:41:50 +00:00
Sam Rawlins 797299909a Support explicit instantiation of implicit call method
Given an expression like `e<T>`, where the static type of `e` is a callable type, treat the expression as if it were a type instantiated tearoff of the `call` method, as in `e.call<T>`.

Bug: https://github.com/dart-lang/sdk/issues/46020
Change-Id: I62fb23677b0df04468dd48532e82ec5ad46fc685
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214869
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-09-29 14:12:30 +00:00
Clement Skau b012bf3f3e [vm/ffi/test] Fixes vmspecific_ffi_native_test.
Remove the static shared resource as it caused race conditions with
multiple instances of ClassWithNativeField.
Instead introduces allocatable resources which we have more control
over, but can otherwise be used in a similar fashion.

TEST=Updated existing test.

Bug: https://github.com/dart-lang/sdk/issues/47224
Fixes: https://github.com/dart-lang/sdk/issues/47224
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-asan-linux-release-x64-try,vm-kernel-precomp-msan-linux-release-x64-try,vm-kernel-precomp-tsan-linux-release-x64-try,vm-kernel-precomp-ubsan-linux-release-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try
Change-Id: I98dbf6ba85982392af7ce754d5b8d8fdb97f4d7e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214600
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2021-09-29 13:52:41 +00:00
Alexander Thomas b846a20e26 [testing] Detect test failures caused by test expectation changes
* Move compare_results.dart to pkg/test_runner.
* Clean up analyzer issues in compare_results.dart.
* Add a test for compare_results.dart.
* Fix compare and extend results to detect expectation changes.

Change-Id: I451ddc2d0b01a7e5fd7c9d791b000c786c2f2c93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214805
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2021-09-29 13:07:19 +00:00
Alexander Thomas 06bb7992d2 [release] Add release notes for 2.14.3
Change-Id: I23ef2861a264670023b16964d49cca3c0ee4199a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214940
Reviewed-by: Michael Thomsen <mit@google.com>
2021-09-29 10:54:42 +00:00
Stephen Adams c74dd07a4a Use interpolation in print and writeAll
Using interpolation ensures that a `null` returned from `o.toString()`
in a non-sound application is treated consistently.

The error message has been upgraded to include the receiver to make
it easier to find the method. Since this error values are reported using
`Error.safeToString`, this will be reported using the class name:

```
ArgumentError (object): toString method returned 'null': Instance of 'BadToString'
```

VM, DDC and dart2js runtimes are updated to make the handling consistent
on VM and web.

TEST=added

Change-Id: I48d8f721dfb3a431dbeacdaa39a9f3a8273e902c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214741
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-09-29 02:45:32 +00:00
Brian Wilkerson cc9c3ff325 Fix handling of prefixed identifiers in data-driven fixes
Change-Id: I1df52c567cd81539661374a0748f0658ac8f5562
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214868
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-09-29 01:05:52 +00:00