Commit Graph

45759 Commits

Author SHA1 Message Date
Konstantin Shcheglov b5b4cf872f Move more AnalysisDriver tests to DriverEventCollector.
Change-Id: I52715322580c36090104f295276cd071733d6e6a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344945
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-01-08 17:38:39 +00:00
Ben Konyi 3c42222b7e [ CLI ] Add tooling-daemon command to support launching the Dart Tooling Daemon (DTD)
This change includes the following:
 - A new `tooling-daemon` CLI command to launch DTD
 - Minor refactoring of package:dtd_impl to better match expected
   Dart package structure
 - Updated build rules to create dart_tooling_daemon.dart.snapshot

Change-Id: Idd91bc4ce64ce790db5bad323a50d9cf65523dc2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344800
Reviewed-by: Dan Chevalier <danchevalier@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-01-08 17:07:55 +00:00
Jens Johansen b52dc18ff8 [CFE] Textual outline suite doesn't format pre-nnbd sources
Fixes https://github.com/dart-lang/sdk/issues/54328

Change-Id: I6d52d9241f245865d3aba775ea6fe19da4ba7f30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345220
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-01-08 15:01:26 +00:00
Johnni Winther fa8e34e835 [cfe] Handle erroneous enum constant values in exhaustiveness
Closes #54267

Change-Id: Ic8e86a352725bd35985fbd4685b1c4d446875949
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345063
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-01-08 13:20:01 +00:00
Jens Johansen 01a27372e2 [CFE] Textual outline suite doesn't remove empty lines before formatting
Change-Id: I8b7d9fdb5e2562914b66ccd748a8f417895658a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344705
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2024-01-08 13:11:52 +00:00
Ömer Sinan Ağacan f23abcd593 [dart2wasm] Implement wrapping awaited values with Future.value
Fixes tests:

- language/async/await_flatten_test
- language/async/await_type_check_test
- language/await_type_test

Change-Id: I42344073864c4927d07b951048a6425fd116a4b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344720
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-01-08 12:19:30 +00:00
Chloe Stefantsova 04e8677d59 [cfe] Infer mixins by directly solving for equality
The direct algorithm for solving for equality replaces the more
general constraint solving algorithm. It reduces complexity and
removes the requirement on the constraint gathering and solving engine
to be applicable at the earlier stages of compilation.

Change-Id: I73dfa39bb1534803c6985578708ecab198c26e25
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/343920
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2024-01-08 11:42:39 +00:00
Chloe Stefantsova 8f0729aa57 [cfe] Canonicalize bool const results of |, &, ^ to the cached value
Closes https://github.com/dart-lang/sdk/issues/54489

Change-Id: I8eceb0316383e98027f8531c50de1a3079985913
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344721
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-01-08 11:36:45 +00:00
Parker Lougheed 5592a0fd5f [dartdev] Roll pub to a3689f03168c896dd1cb0db8a60c568b38ee16bf
It's been a few months since pub was updated and there are some good enhancements that would benefit from larger testing. Happy to close this if pub hasn't been updated in a while on purpose though!

Diff: https://github.com/dart-lang/pub/compare/1779628b386819675130f14326f1e8812901c48f...a3689f03168c896dd1cb0db8a60c568b38ee16bf/
Change-Id: I69ee1fcf8df8ed61fffa7729c36a214cb1871230
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345101
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Sarah Zakarias <zarah@google.com>
2024-01-08 10:40:37 +00:00
Ömer Sinan Ağacan 611a092a5f [dart2wasm] Simplify _AsyncCompleter type parameter computation
Similar to 4d3895a and 72fd1e0, use `FunctionNode.emittedValueType` to
get the yielded element type.

Change-Id: Ib7b3d37e8c84c1b40c38fc8b4143fd0e2b77a463
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344704
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-01-08 10:14:16 +00:00
Ömer Sinan Ağacan 9ebe37f55c [dart2wasm] Remove rednudant ref.as_non_nulls
With 3c4d4ad we use non-nullable Wasm field types for non-nullable Dart
fields, so the `ref.as_non_null`s for getting async completer from a
async suspend state can be dropped.

Change-Id: I7857d9996f3415c42b83e4b8961f629e0dd070a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345180
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Auto-Submit: Ömer Ağacan <omersa@google.com>
2024-01-08 09:37:09 +00:00
Samuel Rawlins aa6b6470e3 Revert "analyzer: Do not overwrite an original exception when a plugin crashes"
This reverts commit 7784cf3f94.

Reason for revert: broke windows bot

Original change's description:
> analyzer: Do not overwrite an original exception when a plugin crashes
>
> Maybe related to https://github.com/dart-lang/sdk/issues/38629. These tests have been skipped for so long, enabling them took some work, to migrate them from '.packages' files to package config files.
>
> Some other tidying in the test file:
>
> * inline `byteStorePath`, only used once.
> * simplify `_packagesFileContent` and `_getPackagesFileContent`
>   into a static getter.
> * simplify `_defaultPluginContent` into a const String, so it can
>   be used as a function parameter default value
>
> The diff is way bigger than the functional changes, because we sort
> elements.
>
> Change-Id: I193316316750e80268b684fdc1abe558a77994fe
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344601
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Samuel Rawlins <srawlins@google.com>

Change-Id: Ibeb761afebad4fb4166cec756743dbb35d323e7d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345143
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-05 23:49:57 +00:00
Eli Geller e6d1333f93 Fix typo unawaited_futures.dart
Closes https://github.com/dart-lang/sdk/pull/54533

GitOrigin-RevId: c7b652b265f0e2723dd9f23c9107754f2c44405f
Change-Id: I99a7effa1f4bba921642a390590bc947d6c0a78e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345142
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-05 22:48:09 +00:00
Brian Wilkerson e5cbde13b9 Add documentation for core lints
Change-Id: I3aa040df18982447ec1e3da074547d28838acae9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344280
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Marya Belanger <mbelanger@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-01-05 21:36:10 +00:00
Srujan Gaddam 121d54f1e0 [pkg:js] Update changelog to better comment breaking change in 0.7.0
Change-Id: Ib949f1b08a4e147258364d7ab9660a8dc6a88f23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345140
Commit-Queue: Jake Macdonald <jakemac@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Auto-Submit: Srujan Gaddam <srujzs@google.com>
2024-01-05 21:16:11 +00:00
Stephen Adams 7933cd741d [dart2js] Prevent type expressions being hoisted above guards
Use a pinned HTypeKnown on the receiver of the HInstanceEnvironment to
pin the type expression. When the the receiver has a wider type that
is legal for the type expression, this keeps the type expression at a
location where it is valid. Type expressions can still be hoisted if
the HTypeKnown is redundant and optimized away.

Bug: #54329
Change-Id: Iae378f9d517e3e22deca198195cad9811cf37772
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344841
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2024-01-05 19:03:29 +00:00
Konstantin Shcheglov 3e53f3e141 Issue 54485. Report error when external constructor has a field formal parameter, optional.
Finishes https://dart-review.googlesource.com/c/sdk/+/344180

Bug: https://github.com/dart-lang/sdk/issues/54485
Change-Id: Ib743495b4b5a03c017ccca22f8efd1055fd919aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345081
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-01-05 18:24:50 +00:00
Konstantin Shcheglov 421a4dca1f Add File based methods to AnalysisDriver, and use them in new tests.
Change-Id: I12ccf1d18cdd3161d08adeeb441b214c164b3d74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344943
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-01-05 17:58:38 +00:00
Konstantin Shcheglov e5df638539 Use DriverEventCollector for assertDriverEventsText()
So, we can move `pumpEventQueue()` into shared code.
And don't repeat `take()` in test methods.

And use the shared `IdProvider` of the collector.
This let us see as new instances of results are created at different
execution points of a single method, with multiple asserts.

Change-Id: I14a871adceae8c8bd8ee6dcbce8893e1daa62a13
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344941
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-01-05 16:51:49 +00:00
Martin Kustermann cbe0e6443d [dart2wasm] Use [WasmArray]s for type arguments in dynamic calls
This avoids allocating lists in dynamic calls for type
arguments.

So far the closure shape checking functionality also
- as a side-effect of shape checking - added default type arguments
to a growable list. We now cleanly separate the logic to use
default type arguments vs shape checking.

=> Doing so allows removing the remaining usages of [List] in the RTT.
=> Probably also results in smaller & faster dynamic calls.

The list allocation is now pushed to the slow path where we
create [Invocation] object that is then used for NoSuchMethod
handling.

Change-Id: I4823cda0aa9b5f1f137813bc5848c365665da5fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344822
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-01-05 15:40:40 +00:00
Martin Kustermann 3343b7a841 [dart2wasm] Use [WasmArray]s for positional/named arguments in dynamic calls
This avoids allocating lists in dynamic calls for positional/named
arguments.

=> Doing so allows removing more usages of [List] in the RTT.
=> Also results in up to 50% faster dynamic calls.
=> Probably also results in smaller code.

The list allocation is now pushed to the slow path where we
create [Invocation] object that is then used for NoSuchMethod
handling.

Change-Id: If578fb044a6cf7f31bd409c177b361181ba68a01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344821
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-01-05 15:00:19 +00:00
Ömer Sinan Ağacan 5a4b438ddb [dart2wasm] Implement null checking when calling super ==
Fixes tests:

- co19/Language/Expressions/Equality/evaluation_super_t02
- language/nnbd/static_errors/super_equals_allows_null_test

Change-Id: Icbbbede51bc1ade5d5039cdcc91fda279e6898f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345020
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-01-05 14:58:28 +00:00
Parker Lougheed 6e8b466d95 [pkg/vm] Use correct method to relativize URIs in resource files
The previous method I used didn't account for Windows drive letters or host names, and ended up using a bunch of '..' to go back to the root unnecessarily.


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

TEST=pkg/vm/test/transformations/resource_identifier_test

Cq-Include-Trybots: luci.dart.try:pkg-win-release-arm64-try,pkg-win-release-try,pkg-linux-release-try
Change-Id: Ida627148c178137cb3684eb23d0b30c16791308b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344762
Reviewed-by: Moritz Sümmermann <mosum@google.com>
Commit-Queue: Moritz Sümmermann <mosum@google.com>
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2024-01-05 13:56:58 +00:00
Daco Harkes ce1af47fa9 [vm/ffi] Check Array<T extends AbiSpecificInt> bounds [] and []=
TEST=tests/ffi/inline_array_test.dart

Closes: https://github.com/dart-lang/sdk/issues/54379
Change-Id: I89a637dce0af9520d29d18ec595d868cd0b1604c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345061
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-01-05 12:35:49 +00:00
Daco Harkes cd9eaef675 [vm/ffi] Check Array<T extends Struct> bounds on []
TEST=tests/ffi/inline_array_test.dart

Bug: https://github.com/dart-lang/sdk/issues/54379
Change-Id: I2799056ce48fa8cfa590512b241fe72f61a07dbf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345060
Reviewed-by: Tess Strickland <sstrickl@google.com>
2024-01-05 12:35:49 +00:00
Daco Harkes d4f8f24dc8 [vm/ffi] Array fixes
`_checkIndex` was returning dynamic.

And it was missing for `PointerArray`.
Bug: https://github.com/dart-lang/sdk/issues/54379

TEST=tests/ffi/inline_array_test.dart

Change-Id: I148545e50463e89fb3a884757ef92444addefc61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345000
Reviewed-by: Tess Strickland <sstrickl@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2024-01-05 12:35:49 +00:00
Phil Quitslund 3e319ba752 Revert "options map support scaffolding in driver"
This reverts commit 717ce7a69c.

Reason for revert: breaking Google3

Original change's description:
> options map support scaffolding in driver
>
> Konstantin and I chatted a bit about this so at least some of it shouldn't be too surprising to him but please do feel free to grab me to chat.
>
> That said a few pointers would be handy. Notably, this change:
>
> * introduces a new `SharedOptionsOptionsMap` for use in SDK drivers (and preserve current semantics)
>   * this is currently public but will be private once driver is more evolved to accommodate multiple options files
> * removes the shared `_analysisOptions` from the analysis driver with a baby step to using the one shared in SharedOptionsOptionsMap
> * removes context_builder and collection v2 experiments (and tests)
>   * I'll harvest some more functionality from these in future changes but for now they're distracting and hard to maintain
>
> This work is all to setup moving analysis options awareness into file state objects which will allow us to remove `sdkVersionConstraint` info from options (finally) and a host of other good stuff (see https://github.com/dart-lang/sdk/issues/54124).
>
>
>
> Change-Id: Ic4278184016d1018b4b5b1c6ac5ba9e2546927a5
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344860
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Commit-Queue: Phil Quitslund <pquitslund@google.com>

Change-Id: Ia988c5c9cd328d0adce3d8e6ff019e389819a957
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344960
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-01-05 05:07:10 +00:00
Konstantin Shcheglov 437767f4ae Move more AnalysisDriver tests to DriverEventCollector.
Change-Id: If54cf494313fb21a2cb6e6b985f816581333cccf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344843
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-01-05 01:41:29 +00:00
Konstantin Shcheglov fafa97a9a4 Remove AnalysisDriverGeneric.
The Angular plugin does not exist anymore.
I don't see any use of this class in google3.
So, probably we can remove it.

Change-Id: Ied6b81d4d467e21be22c11fc53ecedd7f1c5b6a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344901
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-05 00:51:07 +00:00
Sam Rawlins 7784cf3f94 analyzer: Do not overwrite an original exception when a plugin crashes
Maybe related to https://github.com/dart-lang/sdk/issues/38629. These tests have been skipped for so long, enabling them took some work, to migrate them from '.packages' files to package config files.

Some other tidying in the test file:

* inline `byteStorePath`, only used once.
* simplify `_packagesFileContent` and `_getPackagesFileContent`
  into a static getter.
* simplify `_defaultPluginContent` into a const String, so it can
  be used as a function parameter default value

The diff is way bigger than the functional changes, because we sort
elements.

Change-Id: I193316316750e80268b684fdc1abe558a77994fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344601
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-01-05 00:27:30 +00:00
Srujan Gaddam c89939ffea [pkg:js] Prep for 0.7.0 publish
Change-Id: Ie220a6baa247464d38c3429fe003d3f4db828273
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344842
Auto-Submit: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2024-01-04 23:53:45 +00:00
pq ea758386d7 deprecate resolve2
Change-Id: Ifd21f5852ecea03837469da0e0bdd2bfa95e154c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344780
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-04 23:46:25 +00:00
pq 717ce7a69c options map support scaffolding in driver
Konstantin and I chatted a bit about this so at least some of it shouldn't be too surprising to him but please do feel free to grab me to chat.

That said a few pointers would be handy. Notably, this change:

* introduces a new `SharedOptionsOptionsMap` for use in SDK drivers (and preserve current semantics)
  * this is currently public but will be private once driver is more evolved to accommodate multiple options files
* removes the shared `_analysisOptions` from the analysis driver with a baby step to using the one shared in SharedOptionsOptionsMap
* removes context_builder and collection v2 experiments (and tests)
  * I'll harvest some more functionality from these in future changes but for now they're distracting and hard to maintain

This work is all to setup moving analysis options awareness into file state objects which will allow us to remove `sdkVersionConstraint` info from options (finally) and a host of other good stuff (see https://github.com/dart-lang/sdk/issues/54124).



Change-Id: Ic4278184016d1018b4b5b1c6ac5ba9e2546927a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344860
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-01-04 23:45:42 +00:00
Konstantin Shcheglov a84e40b9e7 Move more AnalysisDriver tests to DriverEventCollector.
Change-Id: Ib9af15c217ca454da17b435b20a6fb6eeee1d8d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344840
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-01-04 22:11:39 +00:00
Konstantin Shcheglov e50adef282 Extension type. Test for ImplicitCallReference.
Bug: https://github.com/dart-lang/sdk/issues/54340
Change-Id: Iff4ca8b10d4cafc57ce327a628eb57c6944ecd24
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344900
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-01-04 21:15:54 +00:00
Ömer Sinan Ağacan f713a7d844 [dart2wasm] Remove special case for const list access
When a const list access does not have a const argument, fall back to
normal compilation. TFA optimizes const list accesses to direct calls to
`_ListBase.[]`, so the code generated by the intrinsic handler is not
any better, and the generated code in the intrinsic handler does not do
bounds check.

Fixes test standalone/array_bounds_check_generalization_test.

Change-Id: I6455826815c22a731bb830aec08b8bdd701e0d52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344820
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-01-04 20:38:38 +00:00
Ben Konyi 527cc7df50 [ DDS ] Reland 3.1.2 pubspec and CHANGELOG after 3.1.0+1 hotfix release
Change-Id: I2e451d3300c0c6a67f5559de4f361ffe54ea8f9d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344761
Commit-Queue: Christopher Fujino <fujino@google.com>
Reviewed-by: Christopher Fujino <fujino@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
2024-01-04 19:31:04 +00:00
Ben Konyi 5362a20f27 [ DDS ] Create 3.1.0+1 patch release
Reverts vm_service major version bump (13 -> 14) from 3.1.1, but is
otherwise identical to 3.1.2.

Change-Id: I9e6595a4a4565586284d7ab4601fd9e49711d87d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344760
Reviewed-by: Christopher Fujino <fujino@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-01-04 18:39:29 +00:00
Sam Rawlins 5ddb91860b analyzer: Close the ReceiverPort in PluginIsolateChannel.close
Change-Id: I7442da58ba9e6810bacc6380999097a3d9674658
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344623
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-01-04 18:38:36 +00:00
Danny Tuppeny 9e1dbb8be2 [analysis_server] Remove duplicate declaration tracking from LSP server
This code appears redundant. It was adding contexts to the declarations tracker as contexts changed, but this was also being done once at the end (in the method "addContextsToDeclarationsTracker" mentioned in the comment).

Apparently at some point I added a TODO suspecting this was unnecessary but didn't realise the performance implications of it on a large project.

There are existing tests that ensure the declarations are tracked correctly (although we don't use them for completions, they're still used to resolve macros in dartdocs).

See https://github.com/dart-lang/sdk/issues/54513

Change-Id: Ibdb7d00c288e78fc44c48a4f9febff688e2db323
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344702
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-01-04 17:51:58 +00:00
Danny Tuppeny 8212fbeedb [analyzer] Combine adding files + packages in declarations tracker to avoid enumerating analyzedFiles twice
Prior to this change, both `_scheduleContextFiles` and `_findPackages()`  would enumerate `_analysisContext.contextRoot.analyzedFiles()`. This is an Iterable that calls `getResource()` for every item so on large folders showed up on the profile:

https://github.com/dart-lang/sdk/issues/54513#issuecomment-1877065904

This change combines them into a single method so we iterate only once.

It does slightly change the order of things (SDK files were previously scheduled before packages), but the only alternative I have is to add `toList()` but that will need to allocate (and repeatedly grow) a list which I suspect is overall worse.

Other than the order, there should be no functional changes here - I moved the body of `_scheduleContextFiles` into `_findPackages()` and renamed it (which unfortunately doesn't diff nicely because it moved in the file).

See https://github.com/dart-lang/sdk/issues/54513

Change-Id: I2a5539a93ee8ca2cdbad031efcfc9bbaf23e9ab9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344703
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-01-04 17:27:43 +00:00
Konstantin Shcheglov 278f386c12 Rename AnalysisDriver.getResult() to getResolvedUnit()
Change-Id: I3262713dbc9736b7c4c6af9fbbc0b57d7f53d4d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344660
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-01-04 17:07:58 +00:00
Jonas Termansen 8158275a94 Bump version to 3.4.
Do not revert: The main channel version must be upgraded now that the
version 3.3 beta has been cut and reverting this change puts the
release infrastructure into an unsupported state. Please fix forward
any potential problems that occur downstream and loop me into the
discussions so we can improve the release procedures in the future.

Change-Id: I8706c3d74fe0474d34a99c5cbbb8e9a88b586cdd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/329902
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Kevin Chisholm <kevinjchisholm@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-01-04 16:15:09 +00:00
Tess Strickland 57a1168875 [pkg/vm] Create @pragma("vm:platform-const-if", <cond>) annotation
If a static field or getter is annotated with
@pragma("vm:platform-const-if", <cond>) and <cond> const evaluates
to true, then uses of the static field or getter are const evaluated
when a target operating system is available. If <cond> const evaluates
to any other value, then the annotation is ignored.

For example, when runtime-only code is guarded like the following,
using Flutter's kDebugMode constant, then debug mode Flutter programs
can alter the defaultTargetPlatform for testing, but in release mode,
the defaultTargetPlatform getter is const evaluated and code guarded
with defaultTargetPlatform checks can be eliminated if unreachable:

  @pragma("vm:platform-const-if", !kDebugMode)
  TargetPlatform get defaultTargetPlatform {
   ...
   assert(() {
     if (Platform.environment.containsKey('FLUTTER_TEST')) {
       result = TestPlatform.android;
     }
     return true;
   }());
   if (kDebugMode &&
       platform.debugDefaultTargetPlatformOverride != null) {
     result = platform.debugDefaultTargetPlatformOverride;
   }
   ...
  }

TEST=pkg/vm/test/transformations/vm_constant_evaluator

Change-Id: I55b88502a908c56cf42a761dd06741f15c8a23d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/333220
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2024-01-04 14:44:29 +00:00
Ömer Sinan Ağacan 91d16af92b [kernel] Document how to compute Procedure type
Change-Id: I9772c3124a7c19e8754ba99edf355a6b76aaf1a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344520
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2024-01-04 12:04:12 +00:00
Konstantin Shcheglov 70783e5eb0 Macro. Prepare for reporting resolved macro generated files. Step #1.
Change-Id: Ib84e1aeef508cbfdd5b02d5c4c13420c5aa4daff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344421
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-03 23:07:29 +00:00
Konstantin Shcheglov d2b5f5f8d9 Macro. Introspection for EnumElement, tests.
Change-Id: I0029abd3f0dbbfb68aaec7cc8a0f9197a45df218
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344622
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-03 22:35:58 +00:00
Michael Thomsen 58209f70fd Update web tempate to use package:web
Change-Id: Ibe0e63abfd2390b92885110a4b22370c7425e231
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344640
Commit-Queue: Michael Thomsen <mit@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2024-01-03 22:29:09 +00:00
pq a43ebbffd0 rename resolve2 to resolve
Not sure if there's a good reason to keep this as `resolve2` since there's no simpler `resolve` to be found. If there is, please let me know and I can revert this and add a doc to `resolve2` for clarification.


Change-Id: I67c3825e9db95ec3f3c618f08664ed655394c041
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344460
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-01-03 22:03:47 +00:00
Sam Rawlins cc8cc05819 analyzer: Improve text in diag pages: word-breaking, title-case, table
When looking at the Plugins page, I noticed it was not as friendly as the others.

"not running" text before: https://screenshot.googleplex.com/9Z2eMFSvVjKBjRv.png

Poor text wrapping before: https://screenshot.googleplex.com/BUaTxYxJ5W5yQti.png

Improved "Not running" text with better wrapping: https://screenshot.googleplex.com/69zoPfbGjYkeHD2.png

Improved path text, aligned as a table: https://screenshot.googleplex.com/6yKfbQo8BE7LHmp.png

Change-Id: I4a4cee23a93bf3c2f16d504a7b11cb9f29c7333c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344602
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-03 21:59:49 +00:00