Commit graph

103275 commits

Author SHA1 Message Date
Konstantin Shcheglov fae76f4672 Elements. Migrate AddTypeAnnotation.
Change-Id: Ic613ceb4dc84be4136faf926100563da444d8ac7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386735
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2024-09-28 20:47:34 +00:00
Konstantin Shcheglov 2da09ed154 Elements. Migrate AddSuperParameter.
Change-Id: I9519a8919712bf04949c67c26d674163c31466d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387340
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2024-09-28 17:26:43 +00:00
Konstantin Shcheglov 2d0c5b50a7 Elements. Migrate AddReturnType.
Change-Id: I8910362713383ea5622dd4f8e40291b1e5dcd503
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386734
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2024-09-28 16:56:45 +00:00
Konstantin Shcheglov 4f1161e1d9 Elements. Migrate AddRequiredKeyword.
Change-Id: I82165c4afbade8430e97ef00c1b89181f6de3f6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386979
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2024-09-28 16:32:41 +00:00
Konstantin Shcheglov 5a38795859 Elements. Migrate AddNullCheck.
Change-Id: I10a4b424926ecc39c14108e1b591a40bed83584a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386733
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-09-28 16:10:06 +00:00
Konstantin Shcheglov 0a699f4f11 Elements. Triage already migrated / not necessary files in analysis_server/.
Change-Id: Ie267c30c976a9b25fb5e3576e58317853c5f36e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386977
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-09-28 15:43:20 +00:00
Konstantin Shcheglov 27479d62be Elements. Migrate AddMissingRequiredArgument.
Change-Id: I155f1be9d36ed45c3a814326864e76b713559881
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387131
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-09-27 23:06:36 +00:00
Konstantin Shcheglov f956c0f005 Elements. Migrate AddMissingParameterNamed.
Adds a couple tweaks to improve the lint reporting.

Change-Id: I6e85e323cc2f34f1236d46046b033c9bc72999c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387130
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-09-27 22:44:01 +00:00
pq 645a6193da [element model] migrate avoid_slow_async_io
Bug: https://github.com/dart-lang/linter/issues/5099
Change-Id: I4f67ae413031d5bd8a848fa28aee634e481ab4be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387132
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-09-27 22:17:25 +00:00
pq c69898ab1b [element model] migrate discarded_futures
Bug: https://github.com/dart-lang/linter/issues/5099
Change-Id: I1034c5daf88a33f2d8a18fa8dc01d9e2de10e942
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387321
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-09-27 22:09:50 +00:00
pq 01cc3856ef [element model] migrate unnecessary_statements
Bug: https://github.com/dart-lang/linter/issues/5099
Change-Id: Ia91e1dc12038414b62c4975de3c2ee4769017b5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387129
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-09-27 22:09:22 +00:00
Konstantin Shcheglov ae182d2ca6 Elements. Migrate AddMissingEnumLikeCaseClauses.
Change-Id: I6199929a0ad0c715c3705d396f94e5851c5f3ef0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387323
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-09-27 21:33:56 +00:00
Konstantin Shcheglov 4ed8a6a657 Elements. Disable AnalyzerUseNewElementsTest for Windows.
We will never use it on Windows, only on Mac / Linux.

Change-Id: I01c54ddabefa7269c50432978cd5e609da448b1b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387128
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-09-27 21:17:01 +00:00
Konstantin Shcheglov 482329e5e6 Elements. Migrate AddLate.
Change-Id: I26035d05790b0115f8233a3901bc9cbd31db220b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386976
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-09-27 20:59:29 +00:00
Konstantin Shcheglov d1702f40be Elements. Migrate AddEnumConstant.
Change-Id: Ie4a1010a5c6cb5515bb8946795516fea7af79fbc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386731
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-09-27 20:33:16 +00:00
Konstantin Shcheglov dadc46dd4d Elements. Migrate AddKeyToConstructors.
Change-Id: I498becb67634a05507b009a32a96c2d1b699d47e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386975
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-09-27 20:27:32 +00:00
Konstantin Shcheglov 44e121e38e Elements. Migrate AddFieldFormalParameters.
Change-Id: Ie15ded7793303f2395ce7f1d82357e8d2c3ab41a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386732
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-09-27 20:20:29 +00:00
Keerti Parthasarathy 9e5cf34721 [Element model] Migrate convert_to_field_parameter correction producer
Change-Id: I99bfdd1c2d46b0fa0fe204bcaac4e8548a9ebb2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386973
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2024-09-27 20:09:06 +00:00
Brian Wilkerson 2c701526a6 Remove a broken test and rename a test file in linter
Change-Id: I880fd89a2447c02bded3dbb0196b519dd0542e31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386730
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-09-27 20:08:23 +00:00
Konstantin Shcheglov 47d030cc38 Elements. Add new lint rule to flag using old element model.
The lint must be enabled for a Pub package.

The lint rule reads once the file `analyzer_use_new_elements.txt`
from the root of the package (next to `pubspec.yaml`). The it uses
the read file until DAS is restarted.

The file should have path prefixes from the root of the package.
See the included example for DAS.
It could be also the whole directory, e.g. `lib/src/services/correction/dart/`.
These are just path prefixes, not regular expressions.

Change-Id: Ia3e5ed5f1366302a7d82189cb158f78024fa3a17
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387122
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-09-27 20:01:03 +00:00
Keerti Parthasarathy 01298121c4 [Element model] Migrate convert_to_package_import and convert_to_relative_import correction producers
Change-Id: I692340aefc1778821d1071fbf01d1e1c851ca09a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387126
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2024-09-27 19:58:37 +00:00
Sam Rawlins 84a87f47c2 analyzer: Report when type variables are used in constant collection literals
Fixes https://github.com/dart-lang/sdk/issues/52244

Change-Id: I2189dc3ef149c51bbf9aaacd22cf4aecfec8f321
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387125
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-09-27 19:52:59 +00:00
Konstantin Shcheglov efd44480bc Elements. Add getters to TypeProvider.
Change-Id: I905a6b9b439e40dc52d3d7378aafb3492167a03b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387127
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-09-27 19:50:33 +00:00
Brian Wilkerson 5fee5a8277 Fix bug in writeElement2
Change-Id: I666449e780c8545c4bc6e247920fefcdab80c4cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387322
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-09-27 19:03:13 +00:00
Konstantin Shcheglov 7d6d5448dc Elements. Migrate AddExplicitCall.
Change-Id: Idccff2640ec19806cfd3231c5c618c5b84950ad8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386972
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-09-27 18:59:58 +00:00
pq dfe15b19ac [element model] migrate avoid_double_and_int_checks
Bug: https://github.com/dart-lang/linter/issues/5099
Change-Id: I36f41cc74a2050fd3a87d33ff6103741e7d40deb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386726
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-09-27 18:27:59 +00:00
Sigurd Meldgaard 63a9148c3d Bump pub to 9adca58e4fa8e1d94924e64a184532231826496c
Changes:
```
> git log --format="%C(auto) %h %s" 23e3d4f..9adca58
 https://dart.googlesource.com/pub.git/+/9adca58e Fix add package with offline flag (4395)
 https://dart.googlesource.com/pub.git/+/3a92e03c Fix `pub deps` behavior (4397)

```

Diff: https://dart.googlesource.com/pub.git/+/23e3d4f4a761867b1e3eded9a92a4290a01daadb..9adca58e4fa8e1d94924e64a184532231826496c/
Change-Id: I3fe7f063d6c8609f05305c188b52770e42c39271
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387260
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Auto-Submit: Sigurd Meldgaard <sigurdm@google.com>
2024-09-27 18:18:23 +00:00
Konstantin Shcheglov 0dd18c67fb Elements. Add VariableDeclaration.declaredElement2
Although saying that VariableDeclaration is _FragmentDeclaration, is
not quite correct. Maybe we should have separate LocalVariableDeclaration.

Change-Id: I81d606258b2c1a639b2df4a11b8da13ef56e98e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386902
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-09-27 18:18:12 +00:00
Sigmund Cherem 00b11411d6 [ddc] support library cycles in the new module format.
We'd like to properly support cases like:

```
a.dart:
  import 'b.dart';
  class A extends B {}
  class C {}

b.dart:
  import 'a.dart'
  class B extends C {}
```

Here both A and B will request a reference to the other during
linking.

We break the cycle by storing libraries in the map after they are
initialized, but before we recursively link them. Now an access to a
library proxy has different guarantees:
* during linking, it guarantees to return an intialized library.
* during program execution, it guarantees to return a linked
  library.

Aside from this change, this CL does a minor change to the logic on
`hotReloadEnd` to not change the state of the `libraries` array on a
hot-reload. This change is technically not necessary, but may help us
more clearly track the invariants of the library map: the new logic
keeps updates to the map monotonic over time.

Change-Id: Id2aafa3d94c6bff32b7ddb326f883f978bff6bf0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/385324
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2024-09-27 18:07:48 +00:00
pq 9db958049b [element model] migrate unnecessary_parenthesis
Bug: https://github.com/dart-lang/linter/issues/5099
Change-Id: Ic0e42a86bcab608ff47f7e7911b8909b7d93c8f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387124
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-09-27 18:05:27 +00:00
Konstantin Shcheglov c58d9319be Completion. Issue 56783. Suggest non-assignable members when not in LHS of assignment.
Bug: https://github.com/dart-lang/sdk/issues/56783
Change-Id: I5e190bd0ebf59e5771d394eb5a72600d40a02a90
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386683
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-09-27 17:55:31 +00:00
pq ae6b4b6d65 [element model] migrate tighten_type_of_initializing_formals
Bug: https://github.com/dart-lang/linter/issues/5099
Change-Id: I8e540237743629b314d1439270b9fc0a33437f48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386970
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-09-27 17:55:05 +00:00
Brian Wilkerson fdcb76d8bf Replace "type variable" with "type parameter" in docs
Change-Id: I98087fcc104ed972c1ca291c7c05cadb08d6d593
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387123
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2024-09-27 17:32:31 +00:00
Konstantin Shcheglov 18b1c92498 Elements. Migrate AddDiagnosticPropertyReference.
Change-Id: Icb2d198e8a45e640914bbbaf54e4abc92df0e5b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387121
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-09-27 16:45:11 +00:00
Konstantin Shcheglov 08fb555d87 Elements. Migrate AddCallSuper.
Change-Id: Iebdaf1036317e958c9678b8a003b3ce8893720b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387200
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-09-27 16:42:22 +00:00
pq 118897cf35 [element model] migrate unnecessary_null_aware_assignments
Bug: https://github.com/dart-lang/linter/issues/5099
Change-Id: I43f854025a1bd73d5df7558e6e195ab68d229eea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387300
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-09-27 16:33:45 +00:00
pq f390204c4f [element model] migrate avoid_shadowing_type_parameters
Bug: https://github.com/dart-lang/linter/issues/5099
Change-Id: I803413fb03956c89d6183c8cb4bf9872c8b60590
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386968
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-09-27 16:24:12 +00:00
Nicholas Shahan 32d2b5373f [ddc] Delete defineLazy with legacy semantics
This is no longer used since support for legacy code < 2.12
has been dropped.

Change-Id: Id0e67445407c9b110218625d8e3a7ad5230d75cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386966
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2024-09-27 16:16:21 +00:00
FMorschel 30a57b2b47 Fix convert to cascade
Closes https://github.com/dart-lang/sdk/pull/56788

GitOrigin-RevId: 7e35273490
Change-Id: I49af5c39267d6b91cfca40b4feb42e1d921a4eeb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386860
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2024-09-27 16:16:09 +00:00
pq 2015686bf6 [element model] migrate avoid_catches_without_on_clauses
See: https://github.com/dart-lang/linter/issues/5099

Change-Id: I32c758c76df7e80c465efb13dacf3ebd4854e9a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387141
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-09-27 15:53:14 +00:00
pq 84486285f8 [element model] migrate library_prefixes
Bug: https://github.com/dart-lang/linter/issues/5099
Change-Id: I951d4d9152e0854ee316a301e693603c51c2162d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386727
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-09-27 15:46:48 +00:00
pq 5ca26de4cc [element model] migrate prefer_collection_literals
Bug: https://github.com/dart-lang/linter/issues/5099
Change-Id: I0fea39fc55c60b0a388979ffb5b0b00a507fc500
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386967
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-09-27 15:45:11 +00:00
pq dcb771c1fb [element model] migrate no_leading_underscores_for_library_prefixes
Bug: https://github.com/dart-lang/linter/issues/5099
Change-Id: I03bef84eca282359a3f776870c78cad22ff9aa24
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386728
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-09-27 15:38:44 +00:00
Ben Konyi 873d709c46 [ VM ] Disable DDS for gen_snapshot_include_resolved_urls_test
This test is already slow on SIMARM configurations, spawning DDS in
SIMARM is also slow and can cause the test to timeout (e.g. on vm-aot-linux-debug-simarm_x64).

Related to https://dart-review.googlesource.com/c/sdk/+/385121

Change-Id: Icfa31d8d56efe3480d8223ef4c852322e0d652da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387201
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
2024-09-27 15:37:08 +00:00
Erik Ernst fc7b4dda66 Adjust tests and spec_parser to updated grammar
This CL changes the specification parser grammar to support a switch
expression that has zero cases (this is a missing update, the feature
specification already has it). It also changes several language tests
such that they expect a 'syntax error' rather than a 'compile-time
error'. This makes no difference for any tool except the specification
parser, for which it is needed (in general, a test that is expected
to have a compile-time error will parse just fine, so we need a
separate test outcome expectation for syntax errors).

Change-Id: Ifa00c11ce6c57053bd490e11a41d6e8d7b82a2d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384600
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2024-09-27 15:29:03 +00:00
Nate Biggs 68552a56bc [dart2wasm] Fix module stress tests.
After these changes the tests pass 100% of the time on all expected configurations.

- Emit 'unittest-suite-wait-for-done' at the start of tests to allow for async code loading. Tests must therefore emit 'unittest-suite-done' when they complete. Calling `asyncStart` and `asyncEnd` helpers will achieve this.
- Fix test_runner runtime.
- Add file deps on necessary files (dart2js platform dill & flute) to dart2wasm_hostasserts config.
- Mark dart2js compilation test as slow.

Change-Id: Iee993deb3905ccd50068325a5c5fd0bf0512a513
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386980
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-09-27 15:03:01 +00:00
Alexander Markov d84b374683 [vm] Improve bounds check elimination in range analysis
* Infer range for CheckArrayBound and GenericCheckBound instructions.
* Extend Constraint instruction to non-Smi values bounded by list
  length.
* Unwrap UnboxInt64 during canonicalization of range boundaries.
* Use symbolic range for UnboxInt64 of list length.

As a result, bounds check can be eliminated in a loop over a growable
list:
```
  for (int i = 0; i < a.length; ++i) {
    final value = a[i];
    ...
  }
```

TEST=runtime/tests/vm/dart/regress_56726_il_test.dart
Fixes https://github.com/dart-lang/sdk/issues/56726

Change-Id: Ic56df18f6fbf26abf91d6ecbff24d68678dccb60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386522
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-09-27 13:28:59 +00:00
Erik Ernst 986626a532 Enable augmentation of additional kinds of declaration
This CL adds support in the grammar for augmenting external top-level
declarations (getter, setter, function, variable). It also adds this
support to several kinds of declarations, and then factors out the
`AUGMENT?` part of each alternative of `declaration` (because we are
now allowing `augment` on every alternative).

This CL is a continuation of
https://dart-review.googlesource.com/c/sdk/+/387160
where the first batch of changes in this area were made.

Change-Id: I7f02709f29d0f13010ac44c4428f90250a38948c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387221
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-09-27 12:29:38 +00:00
Erik Ernst ec891471f5 Add support in Dart.g for separators in numeric literals
Change-Id: I2b0ba97b9b89803b28358b94959e31276eda3af2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387222
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-09-27 12:24:40 +00:00
Erik Ernst 582abe2bbb Add support for omission of implementation as per #4015
This CL adds support in the specification parser (Dart.g) for omitting
the implementation from several kinds of declarations. This is needed
because it must be possible to omit the implementation and provide it
in an augmentation.

The implementation is the initializing expression of a variable, the
function body of a top-lovel or static getter, setter, or method, or
the function body of a factory constructor.

Change-Id: If305dae376ba1c5aabcdd698824aca5d5b0fb97a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/387160
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2024-09-27 07:47:29 +00:00