Commit Graph

48452 Commits

Author SHA1 Message Date
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
Konstantin Shcheglov c2b92853d4 Parts. Change using 'augmentation' to 'part' where applicable.
Change-Id: I61cb3e112d83ed20536e4018c50c568cae7fb902
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382300
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-08-26 23:19:51 +00:00
pq c371785d42 [wildcards] legacy navigation tests
See: https://github.com/dart-lang/sdk/issues/56567

Change-Id: I0abf861903e440f3bc6162e671c71d134786e8d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382280
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-08-26 23:05:57 +00:00
pq a4a146d3c4 [wildcards] legacy occurrences tests
See: https://github.com/dart-lang/sdk/issues/55681

Change-Id: I5426ef22d56f6c2ab92a2028969cebd867a676ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382242
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-08-26 22:59:09 +00:00
Konstantin Shcheglov bbe45a6f34 Parts. Fix for associating metadata with 'part' directives in parts.
Change-Id: I1bf3341f011ead6184915bc243538bd675ae7dc3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382221
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-08-26 21:39:12 +00:00
Fedor Shcheglov a5cfca1b48 Issue 56572. Fix suggesting extension methods on record types.
Bug: https://github.com/dart-lang/sdk/issues/56572
Change-Id: I47e4b07270843ffb53ab90963e04f01b3b105043
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382261
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-08-26 21:18:56 +00:00
Alexander Markov 062b0738e3 [dart2bytecode, vm/interpreter] await/yield/yield*
TEST=language tests in vm-aot-dyn-linux-debug-x64 configuration

Change-Id: I205bec19c2072fe9ac11a3211123bba43cb99d5e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/381945
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-08-26 20:35:18 +00:00
Sam Rawlins 0d368ce290 linter: Move tests for two lint rules
Change-Id: I30aa5a7b9bef44ecda913a19b102f5233723bb76
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382060
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2024-08-26 19:52:45 +00:00
Brian Wilkerson 50dc8bf4a6 Implement new model elements for methods and constructors
Change-Id: I0bed26eaed11556e79a967204bb398deb165a868
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382040
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-08-26 17:52:21 +00:00
Konstantin Shcheglov a6dbe2f066 Extension type. Issue 56508. Use nonSynthetic name offset.
Bug: https://github.com/dart-lang/sdk/issues/56508
Change-Id: Ia575089a28ac3ddd5fbbf7e57fde4b59204ce590
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382100
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-08-26 16:25:48 +00:00
Fedor Shcheglov 848169ae61 Make FileAnalysis.element required.
Change-Id: I10ca12e451155126fcdae3129938f4f7e7531f5e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382102
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-08-26 15:55:10 +00:00
Fedor Shcheglov b2401e0fe8 Migrate element model tests to part/part of.
Change-Id: I7ddf72c0d2418e83944027fd7a9b8a1c1ce8f9ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382101
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-08-26 15:53:48 +00:00
Jens Johansen f391b0d3e7 [parser/CFE] Allow opting out of lazy strings; CFE opts out for body building
The scanner, when creating StringTokens cuts out the substring lazily if
their length is above some threshold. The work is then only done when
and if we actually need the string.

This makes sense for the cases where we normally do not need the string.

In the CFE we scan all sources twice: Once for building the outline, and
once for building the bodies.
When building the bodies we in almost always actually need the string
anyway (something along the lines of we don't ask for <400 out of over
400,000 when compiling the CFE itself).

This CL opts the CFEs second scan (when building bodies) out of the lazy
strings, copying the substrings up front, avoiding the creation of
intermediary `_LazySubstring` (`_CompactLazySubstring` /
`_FullLazySubstring`).

With an AOT compile of the CFE, compiling itself, 50 runs gives these
statistics:

```
msec task-clock:u: -1.3619% +/- 0.3329% (-57.88 +/- 14.15)
page-faults:u: -1.1453% +/- 0.0162% (-1163.82 +/- 16.44)
cycles:u: -1.4138% +/- 0.3433% (-248274774.52 +/- 60279949.79)
instructions:u: -0.5573% +/- 0.0003% (-120171914.10 +/- 59862.46)
branch-misses:u: -3.2906% +/- 1.4496% (-2192237.90 +/- 965762.85)
seconds time elapsed: -1.3662% +/- 0.3338% (-0.06 +/- 0.01)
seconds user: -1.3354% +/- 0.3715% (-0.05 +/- 0.01)
Scavenge(   new space) goes from 63 to 62
```

25 other runs gave these:

```
msec task-clock:u: -0.7929% +/- 0.4759% (-33.69 +/- 20.22)
page-faults:u: -1.1654% +/- 0.0176% (-1184.36 +/- 17.88)
cycles:u: -0.7756% +/- 0.5043% (-136122352.96 +/- 88506748.30)
instructions:u: -0.5578% +/- 0.0005% (-120265633.72 +/- 115062.27)
seconds time elapsed: -0.7852% +/- 0.4726% (-0.03 +/- 0.02)
Scavenge(   new space) goes from 63 to 62
```

So it seems likely that new space GCs go from 63 to 62, theat the
instruction count goes down by 0.55% and that it's actually around 1% faster.

Change-Id: Ic462a67db7274cc8ed38df7f3ed9f41f7497fc82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382162
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-08-26 13:29:09 +00:00
Chloe Stefantsova c9d7e3a4f3 [cfe] Use exhaustive switch in MORETOP and MOREBOTTOM
Change-Id: I9d0197fa0a51bd8a72cb8207f159ceff7076c3e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382161
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-08-26 12:36:48 +00:00
Ömer Sinan Ağacan e241025b73 [dart2wasm] Give names to instantiation closure trampolines
Change-Id: If7372d482492fb1d3763e14c4f872cff545a88bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382160
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2024-08-26 10:50:33 +00:00
Daco Harkes 3d44d5598f [dart2wasm][ffi] Don't crash compiler on Native.addressOf
`Native.addressOf` is not implemented in dart2wasm (yet).

However, crashing the compiler means we cannot use packages which use
`Native.addressOf` even if these are not invoked.

This CL changes these expressions to a `throw` at runtime. This enables
using the subset of packages that use `@Native`s.

Implementation note: The existing FfiNative transformer doesn't
recurse into visitors. And it extends the transformer for the VM which
doesn't recurse. So I don't want to change it to recurse over the
whole AST. Instead, this introduces a new transformer that traverses
the whole AST.

TEST=tests/web/wasm/ffi/ffi_native_test.dart
TEST=existing tests with rolling `package:ffi` in via DEPS.

Closes: https://github.com/dart-lang/sdk/issues/56461
Change-Id: If8fab07a852939a4b519ae7cc47b4071adda8a3a
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-jscm-chrome-try,dart2wasm-linux-firefox-try,dart2wasm-linux-d8-try,dart2wasm-linux-chrome-try,dart2wasm-asserts-linux-chrome-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/380260
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-08-26 08:10:23 +00:00
Chloe Stefantsova a02427fdf7 [cfe] Use exhaustive switch in isSubtypeOf
This CL uses exhaustive switch statement instead of chained if
statements in the implementation of isSubtypeOf. In addition to that,
all of the individual methods for computing isSubtypeOf for specific
pairs of DartTypes are inlined into the switch statement.

Change-Id: I425e8d415d07767313c6f1ff796f7715e35f10bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382000
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-08-26 06:11:21 +00:00
pq ee0b971dbd [wildcards] ‘go to super’ tests
Change-Id: I5ffdffe84356e3431d1c4e7b8b861ae812dbbe85
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/381884
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-08-24 00:07:00 +00:00
pq 9d916f4fdc [wildcards] ‘document highlights’ test
See: https://github.com/dart-lang/sdk/issues/55681

Change-Id: I3297ede2b7dea1247ab8f2b6e8c972acac53c4c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/381885
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-08-24 00:03:17 +00:00
pq 4f4ba74d8b [wildcards] implementation marker tests
See: https://github.com/dart-lang/sdk/issues/55681

Change-Id: I29afe39dd293e2e9da67791ad92f3d6d8356493e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/381807
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-08-23 23:58:58 +00:00
pq 63ccfe81be [wildcards] hover tests
See: https://github.com/dart-lang/sdk/issues/55681

Change-Id: I58630feb6e8b35b00d90d20c305a2f0ca9b37e4b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382042
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-08-23 23:55:14 +00:00