Commit Graph

48472 Commits

Author SHA1 Message Date
Alexander Markov 71efc19cc7 [vm/aot,tfa] Remove support for legacy types from TFA
In addition, with sound null safety there is no difference in subtyping
semantic between 'is' and 'as' type checks, so SubtypeTestKind is also
removed.

TEST=ci

Change-Id: Id75ef6a93b115c44b844ef0a32dc8dca5cc61861
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382900
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-08-30 13:55:34 +00:00
Martin Kustermann 98cf417f4d [dart2wasm] Align -O4 flag in dart2wasm with dart2js behavior
Change-Id: I3a122639258570d7abbbd4f727760533f658b090
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382564
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-08-30 13:25:39 +00:00
Martin Kustermann d769a9105b [dart2wasm] Adjustments to inliner
* Inline small `get iterator` & `get current` iterator methods
* Inline bodies that are small compared to arguments
* Make AST node counter more precise
* Manually mark ListIterator methods as prefer inline

CoreLibraryReviewExempt: Only adds annotation to existing functions
Change-Id: Ib6379e73713cd47a88e5cc67cecd4b5c8344adcb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382882
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-08-30 13:14:56 +00:00
Chloe Stefantsova 0dded3682f [cfe] Remove handling of legacy types from constraint generation
Part of https://github.com/dart-lang/sdk/issues/54902

Change-Id: I48555c46e62a90552b8fb3fdc21fb6cabe7fc70a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382840
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2024-08-30 11:52:23 +00:00
Johnni Winther 7e5b8031ec [cfe] Add NominalParameterNameSpace
Change-Id: Ia48158f11080368fe7b8c42170d45ef27e81701f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382581
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2024-08-30 11:45:57 +00:00
Chloe Stefantsova 59cb100195 [analyzer][cfe] Share constraint generation for declaration types
Part of https://github.com/dart-lang/sdk/issues/54902

Change-Id: Id83077113319031b3e11061110ce0b1beb45918a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382562
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2024-08-30 08:58:22 +00:00
Martin Kustermann 36f23ed8cb [dart2wasm] Remove makeListFixedLength/makeFixedListUnmodifiable
This removes usages of makeListFixedLength/makeFixedListUnmodifiable
in wasm core library implementation.

Furthermore we establish a guarantee that the backing store of
fixed length lists (modifiable or unmodifiable) always has the same
size as the actual list (and not larger).

This in return allows the fixed length iterators to not need a separate
length to track, as the backing WasmArray<Object?>'s length is
sufficient.

Change-Id: I1fe44781c6044187a3a129615a5065f08dfc53a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382860
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-08-30 06:23:19 +00:00
Ben Konyi 230c7ed90c [ VM ] Exit with error if --disable-dart-dev is provided after a Dart CLI command
Fixes https://github.com/dart-lang/sdk/issues/56592

Fixed: 56592
TEST=regress_56592_test.dart
Change-Id: I3363a27c6a4221a3c5388b3472cee978649c1e39
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382700
Commit-Queue: Derek Xu <derekx@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
2024-08-29 20:40:06 +00:00
Ben Konyi 1bf48b070c [ DDS ] Prepare for 4.2.6 release
Change-Id: Ibd9f120837f7fba997a08fef009459f21bbd9e4a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382940
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
2024-08-29 18:53:10 +00:00
Danny Tuppeny a0411ae244 [analysis_server] Prevent duplicate completions for extensions for libraries that import them
Fixes https://github.com/dart-lang/sdk/issues/56320

Change-Id: I4645165857c082cb26ac09eb12df3106769fb25a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382821
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-08-29 17:11:33 +00:00
Alexander Markov ce571036e1 [vm] Cleanup legacy AssertBoolean checks
With sound null safety front-end guarantees that all logical
expressions have a non-nullable bool type, so legacy AssertBoolean
checks are no longer needed and can be removed.

TEST=ci

Change-Id: If952da7bd0ac83c43de3e5d98845c5e5d8d29f6a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382744
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-08-29 16:45:00 +00:00
Konstantin Shcheglov 49c6679e4a Parts. Track used imports while resolving library files.
Change-Id: Ic23ec9ca49d93382449bfe2650089eb43099c3e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382680
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-08-29 16:19:11 +00:00
Sam Rawlins 895093e9f9 Initial PluginServer implementation
This is the core implementation of the "plugin server" that will support the API described at https://docs.google.com/document/d/1T8P323DJxsc3YPzveNIaSKWFkrJp9ydTR4jp_XFb7XQ/edit?resourcekey=0-f8Ue29KMUizqXNGhATp1tg#heading=h.23fjh5hfm2is

This is heavily curbed from the ServerPlugin class at
`package:analyzer_plugin/plugin/plugin.dart`, but does not depend on it.
It depends on two concepts from the analyzer_plugin package: (1) the
protocol used for de/serializing requests, responses, etc. And (2) the
`PluginCommunicationChannel` class. This is also just a utility for
communicating between the analysis server and the plugin server.

This plugin server is capable of "registering" individual "plugins",
which allows plugins to register individual (maybe multiple) lint rules,
and individual (maybe multiple) quick fixes.

The plugin server for now only responds essentially to three requests:

* `ANALYSIS_REQUEST_SET_CONTEXT_ROOTS`
* `EDIT_REQUEST_GET_FIXES`
* `PLUGIN_REQUEST_VERSION_CHECK`

All files are analyzed during `handleAnalysisSetContextRoots`, and
quick fixes are calculated during `handleEditGetFixes`.

There are many TODOs, but the included test shows that this plugin
server can notify the analysis server of lint diagnostics to be
reported, and can respond to a query for quick fixes.

Change-Id: Ibc93332319220a2caf49d20ab480940041a15049
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382480
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-08-29 16:03:42 +00:00
Derek Xu 162a35f654 Skip pkg/vm_service/test/id_zones_test on AOT configurations
This test makes use of `debugger()`, which isn't supported on AOT.

Change-Id: I88b6e21c5b3121873c753becb86a03add0234f4c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382660
Commit-Queue: Derek Xu <derekx@google.com>
Auto-Submit: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-08-29 14:49:07 +00:00
Derek Xu 46d02f42a4 [VM/Service] Fix service/bad_reload_test and service/get_object_rpc_test
service/get_object_rpc_test was failing because one ID in it hadn't been
updated to the new format.

service/bad_reload_test was failing because `ServiceEvent::PrintJSON`
was attempting to populate the `reloadError` property of every `Event`
of kind `IsolateReload` with an `@Error`, but it was not possible to
allocate IDs for these `@Error`s because `ReloadSources` runs for an
isolate group, not for an individual isolate. I fixed this by removing
the `reloadError` property and adding a `reloadFailureReason` property
with type `string`.

TEST=confirmed that service/bad_reload_test and
service/get_object_rpc_test complete successfully on a local build of
the linux-debug-x64 SDK, vm-linux-debug-x64 tryjob

Issue: https://github.com/dart-lang/sdk/issues/55869
Change-Id: Ibf507aa0e475a6b9bed42b055e9d19b54aa81844
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382661
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2024-08-29 14:48:58 +00:00
Danny Tuppeny d8376f191e [analysis_server] Include color hex codes in LSP completions to get color previews
VS Code will show color previews in code completion if there's a hex value at the start or end of the documentation (or a few other fields, but documentation seems lease intrusive here).

This change will compute and include the hex color if the client indicates it supports the Color completion kind.

Fixes https://github.com/Dart-Code/Dart-Code/issues/3941

Change-Id: I94a81993ce5ad95d8cdce2fd61dc7b139710a659
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382604
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2024-08-29 14:36:42 +00:00
Alexander Markov a3b7c9fb5a [dart2bytecode, vm/interpreter] Small fixes
* Use AllocateClosure instruction for closure instantiations in order
  to initialize closure entry point.

* Fix null handling in operator== to be before argument type checks.

* Add _InvocationMirror._withType to dynamic interface as it is
  implicitly used by noSuchMethod forwarders.

* Fix AssertAssignable for null objects.

TEST=language tests in vm-aot-dyn-linux-debug-x64 configuration

Change-Id: I7b1a037d4fde4d22ed32969e0f099b31ea4432ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382500
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-08-29 14:28:40 +00:00
Brian Wilkerson dd47ff74cc Remove MultiplyInheritedExecutableElement2
Also removes the only reference to the old model equivalent.

Change-Id: I9dd30f4d7864eca6190df7ae5ebb419ea61e1f9d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382683
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-08-29 14:06:51 +00:00
Johnni Winther 876b46de21 [cfe] Delay adding builders to declarations
This is a step towards creating fragments instead of builders during outline building.

Change-Id: I8616c8d0fa751693af820ee4fa9078e7ac5d7f40
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382800
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-08-29 13:11:55 +00:00
Johnni Winther acfcf784ae [cfe] Add TypeScope
This adds a TypeScope stack to the SourceBuilderFactory to associate each NamedTypeBuilder with the LookupScope in which it should be resolved.

Change-Id: I15a171b8570fed3d5134e16347c437f13baa5b94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382602
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2024-08-29 10:06:25 +00:00
Martin Kustermann 8bbccbee66 [dart2wasm] Move is/as checker generation from [Types] into their own [IsCheckers]/[AsCheckers] classes
This is analogous how we do it for [PolymorphicDispatchers]

Change-Id: I3b3187ebe11f50659cd89ed01d9fb4b29ab207c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382580
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-08-29 07:39:39 +00:00
Fedor Shcheglov ed53041597 Converted library augmentations into parts in analyzer/ tests.
Change-Id: I91ad3b6fb5fd4c785a1eb99e182c4e16525dd0b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382682
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-08-29 04:29:27 +00:00
Nate Biggs 04f3e7a740 [dart2wasm] Use brand types for wasm minimal recursion groups.
Brand types encode an integer as a struct type and allow us to break the equivalence relation between similar types in different rec groups.

We now compute equivalence classes at the rec group level reducing the number of brand types we have to assign.

We also improves the equivalence class computation by exiting earlier when a group/type is found to be part of an equivalence class. This is enough information to tell us which brand type it needs so we can exit the inner loop early.

Change-Id: I8c5e1cfc679f1fcb6b7f0e79bd71719f345784d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/381960
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2024-08-28 23:44:04 +00:00
Danny Tuppeny bbe6f2340a [analyzer] Don't crash on certain types of invalid data in analysis_options linter config
Fixes https://github.com/dart-lang/sdk/issues/56577
Fixes https://github.com/dart-lang/sdk/issues/55594

Change-Id: I1e69937cd104e8101a7f87b7c9b8ce26b914b3a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382605
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-08-28 22:21:27 +00:00
Danny Tuppeny ddab694633 [analysis_server] Add failing test for auto-import extensions
See https://github.com/dart-lang/sdk/issues/56320

Change-Id: I6a21ef528d6d67a34e7f845c6cb279f246fe2762
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382621
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2024-08-28 21:39:47 +00:00
Martin Kustermann 6addfa0acb [dart2wasm] Loosen the recursive inlining guard
We can allow inlining constructor initializer & body calls
while compiling a constructor

Change-Id: I992de6c42c638ff6b8e78e8a3108900ff8206ad3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382601
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-08-28 21:21:01 +00:00
Keerti Parthasarathy c78b8a5cc2 [Code completion] Move suggesting field from SuggestionBuilder to DeclarationHelper.
Also deleted unused class MemberSuggestionBuilder.

Change-Id: Ibe64963e342e4b0be822fbd25826159276a3d41e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382442
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2024-08-28 21:11:16 +00:00
Derek Xu 8fa0f56f45 [VM/Service] Add private _deleteIdZone RPC
TEST=pkg/vm_service/test/id_zones_test.dart, CI

Issue: https://github.com/dart-lang/sdk/issues/55869
Change-Id: I0b951505edd98364373d5913b7a01f6d4775998e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/380360
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-08-28 16:41:50 +00:00
Derek Xu daa8cbb29e [VM/Service] Add private _invalidateIdZone RPC
TEST=pkg/vm_service/test/id_zones_test.dart, CI

Issue: https://github.com/dart-lang/sdk/issues/55869
Change-Id: I02fcb2502b698066885b3f090435e43a34ed6fcd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/379820
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-08-28 16:41:50 +00:00
Derek Xu 6b978a8339 [VM/Service] Add secret _idZoneId parameters to all Service methods
TEST=pkg/vm_service/test/id_zones_test.dart, CI

Issue: https://github.com/dart-lang/sdk/issues/55869
CoreLibraryReviewExempt: This CL does not include any core library API
changes, only VM Service implementation changes in
sdk/lib/vmservice/running_isolates.dart.
Change-Id: Ib8af3f073f6db9172df90a5ea221269411f72156
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/379545
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-08-28 16:41:50 +00:00
Derek Xu 8b9be74d23 [VM/Service] Add private _createIdZone RPC
TEST=pkg/vm_service/test/id_zones_test.dart,
runtime/vm/object_id_ring_test.cc, CI

Issue: https://github.com/dart-lang/sdk/issues/55869
Change-Id: I6b092ea6ba4c7787635671af26e09af496ad9a5e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/379544
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-08-28 16:41:50 +00:00
Danny Tuppeny 516b6b23a6 [dtd] Fix permission checks to handle differences in file URI escaping
Fixes https://github.com/Dart-Code/Dart-Code/issues/5210
Fixes https://github.com/dart-lang/sdk/issues/54917
Fixes https://github.com/dart-lang/sdk/issues/55476

Change-Id: I492a4f876ea75972e9971f61d67d2ecf84e7b4c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/378461
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-08-28 15:30:07 +00:00
Kallen Tu 1243b9d2b2 [cfe] Lower all late wildcard variables to EmptyExpressions.
Late (wildcard) variables don't get evaluated until they're read, so when we lower them, we should be lowering all of them to EmptyExpressions regardless of if they have an initializer expression.

Bug: https://github.com/dart-lang/co19/issues/2833
Change-Id: Id89035a4e73c2395e7cf19e85bb98e7dbfe2d2a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382422
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-08-28 15:27:36 +00:00
Nate Biggs f00e9b1b29 [dart2wasm] Add --minimize-rec-groups to binaryen flags
This new flag uses a new algorithm to generate the module's type section. The new algorithm is able to produce smaller type sections reducing the overall size of the wasm binary.

For flute.complex at -O4 using this flag produced a wasm file 2.5% smaller.

Change-Id: Iaa7905174c496d637dc3d8d4533df6fd6f056597
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382462
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-08-28 15:14:39 +00:00
Daco Harkes 1f6151d11d [test] Make more newer tool versions available for tests
Unsharded tests have access to the buildtools/ directory, but cannot
find it. This is used in the dart-lang/native tests which are rolled
in to the Dart SDK.

Before this CL we already had the c compiler, linker, and archiver
available in environment vars. This CL extends that pattern to also
provide the paths to common utilities that come with the c compiler.

Change-Id: Ie254da729211865e7a7e5c3c9c8a7e147fe71553
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-mac-release-try,pkg-win-release-arm64-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382560
Reviewed-by: Moritz Sümmermann <mosum@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-08-28 13:37:29 +00:00
Alexander Markov 2e63d3135a [dart2bytecode, vm/interpreter] Records
TEST=language tests in vm-aot-dyn-linux-debug-x64 configuration

Change-Id: I6dd7d5617f5c076c722304ab2a753159f22c0bf6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382421
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-08-28 13:12:48 +00:00
Jens Johansen 0329ebfd99 [CFE et al] Lint for fields with StackTrace.current
This CL primarily adds a lint for fields with `StackTrace.current`
which is often useful for debugging, but shouldn't be left in.

* Add an ast visitor after the "explicit creation test",
  finding - for now - `StackTrace.current` calls in fields.
  This should have caught the left-in debug such in
  https://dart-review.googlesource.com/c/sdk/+/379281.
* Renamed explicit_creation to compile_and_lint
* Remove (for some time) unused "smoke_test_quick" files.
* Add kernel to the compile_and_lint suite, but ignore it for explicit
  creation (i.e. kernel will also be checked for fields
  with `StackTrace.current`).

Change-Id: Ib886d23a8945e7063dc673a7f99cbb3a6adc1139
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382361
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2024-08-28 09:46:08 +00:00
Martin Kustermann b327dae387 [dart2wasm] Make class id range normalization merge consecutive ranges
Lasse spotted this in [0]

[0] https://dart-review.googlesource.com/c/sdk/+/380780/

Change-Id: Ia66225f3e78a9714d4f9c9984ba3791d7595ae1a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382402
Auto-Submit: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2024-08-28 09:18:36 +00:00
Aravind b5928642ff [vm/ffi] Supporting .address.cast() expression in ffi leaf calls
Closes https://github.com/dart-lang/sdk/pull/56357

GitOrigin-RevId: 605e7d3fa5f4c7ce367539a76402e2e51aa69422
Change-Id: I79524b443326a161afe221d0a2afb6bed5866e59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/378221
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2024-08-28 06:34:09 +00:00
pq 77f9cbff13 [wildcards] clarify evaluation test expectation
See: https://github.com/dart-lang/sdk/issues/55719

Change-Id: I4e7bea8c571f3c52313a6f69af3837982a829207
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382441
Reviewed-by: Kallen Tu <kallentu@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-08-27 23:43:14 +00:00
Sam Rawlins b1f6d153c9 linter: Add note to avoid_redundant_argument_values
Fixes https://github.com/dart-lang/linter/issues/3103

Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: Ic721d6652928646131fec47148167f4595ddf021
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/380077
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-08-27 22:10:11 +00:00
Samuel Rawlins b3f31a0440 Revert "Reapply "analyzer: separate unused_element_parameter from unused_element""
This reverts commit b551690c56.

Reason for revert: flutter customer tests failing: https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8738601049545714785/+/u/run_test.dart_for_customer_testing_shard_and_subshard_None/stdout

Original change's description:
> Reapply "analyzer: separate unused_element_parameter from unused_element"
>
> Fixes #49025. Fixes #48401
>
> This allows users to blanket ignore unused_element_parameter without
> ignoring unused_element. They are reported in distinct situations so it
> is valid to separate them.
>
> This reverts commit b888da751e.
>
> Change-Id: I8ea52fcdcb491c140c1283602d6911c939e78d50
> Tested: trybots
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/381882
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Samuel Rawlins <srawlins@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>

Change-Id: Ie0df2f4be45e5db2fa255dcf8c30ddf8408c155b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382420
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Matan Lurey <matanl@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2024-08-27 17:44:28 +00:00
Konstantin Shcheglov c5d0da620d Parts. Store PrefixScope directly into PrefixElement.
There is no actual need to go through Map.

Change-Id: I065ad3dce75eafe876d22cc070e86f9e55cd3f05
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382440
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-08-27 17:14:38 +00:00
Danny Tuppeny 8ca61608d8 [analysis_server] Add an allow-list for LSP methods exposed over DTD
Before exposing existing LSP methods we need to provide a way for DTD clients to always get the same format responses regardless of the client capabilities provided by the original server. Until then, add an allow-list for LSP methods that we can use to selectively enable specific methods that are not affected by client capabilities.

Change-Id: Ia1c994a50c9b94a91f4085c09f9d9d94c0fad79e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382401
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2024-08-27 16:50:15 +00:00
Alexander Markov 365346f4a5 [vm, tfa] Handle all entry point and dynamic module pragmas on a node
Previously, TFA only handled the first pragma on a class/member
and ignored the rest.

TEST=language tests in vm-aot-dyn-linux-debug-x64 configuration

Change-Id: Ib5c7133cef653a7b60799a3205d5a182844ac40c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382200
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-08-27 15:57:00 +00:00
Lasse R.H. Nielsen 310d91aee8 Make async error injection set stack trace on errors.
Also removed a bunch of `CheckNotNullable`s that shouldn't be necessary any more. Any remaining non-sound-null-safety code runs today, and no more should be written. (And if it is, it'll mostly just err somewhere else, with a worse error message.)

Tested: New test added. Removed older tests checking for unsound null-safety.
Change-Id: I28626909cd8c1f91db6c61fc2b93042ed1b085dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/380780
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2024-08-27 12:51:26 +00:00
Jens Johansen de4a69fea3 [CFE] Remove StackTrace.current left in by commit c1283a38a5
Commit c1283a38a5 made the CFE much slower
 --- compiling the CFE itself before took ~4.1 seconds and after ~5.5
seconds after.

This undoes most of that by removing a stray `StackTrace.current`:

```
msec task-clock:u: -24.3982% +/- 0.9517% (-1368.99 +/- 53.40)
page-faults:u: 0.1740% +/- 0.0819% (177.60 +/- 83.62)
cycles:u: -25.5062% +/- 0.9825% (-5992163614.40 +/- 230825004.20)
instructions:u: -34.2928% +/- 0.0009% (-11300688315.40 +/- 289786.74)
branch-misses:u: -17.9038% +/- 4.9793% (-14383703.20 +/- 4000297.83)
seconds time elapsed: -24.3875% +/- 0.9508% (-1.37 +/- 0.05)
seconds user: -25.5429% +/- 1.2609% (-1.38 +/- 0.07)
Scavenge(   new space) goes from 73 to 63
```

Change-Id: I0d822c2dd2d5aa28cbb18bd938ceeb086da2af96
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382400
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2024-08-27 11:50:29 +00:00
Chloe Stefantsova 56230ca6cd [analyzer][cfe] Provide single implementation for a shared method
Previously, performSubtypeConstraintGenerationForFutureOrLeftSchema
and performSubtypeConstraintGenerationForFutureOrRightSchema had
almost identical implementations. The purpose of those methods was to
provide two differently typed entry points to the same algorithm. This
CL reduces the code duplication by introducing
performSubtypeConstraintGenerationForFutureOrInternal that the two
entry points simply redirect to.

Part of https://github.com/dart-lang/sdk/issues/54902

Change-Id: Idd545eed3cba67882f81b68e9b69ccf1aecb4257
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382164
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2024-08-27 06:23:19 +00:00
Konstantin Shcheglov 95e2a2d683 Parts. Migrate FileState special cases of augmentation tests to parts.
Change-Id: I17939b44fc655b1dcbe89fd947c819c05e3778ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382301
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-08-27 00:21:09 +00:00
Brian Wilkerson 702d5a4bd9 Implement fields, getters, and setters in the new element API
Change-Id: I2670e0c3bcb7f41d2177643849c115b071f8dede
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382240
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-08-27 00:18:59 +00:00