Commit graph

5614 commits

Author SHA1 Message Date
Sam Rawlins 48ee1f218d [analyzer] new warning for nullable '==' parameter type
This rule checks that a parameter to an `operator ==` implementation has
a non-nullable type.

I intentionally did not enforce, in this rule, that the parameter is
exactly `Object`. It is legal to narrow the parameter type to a
different non-nullable type, like `int`. I can't imagine doing it, but
it seems to be unrelated to whether the type should be nullable or not.

Fixes https://github.com/dart-lang/linter/issues/3441

Replaces https://github.com/dart-lang/linter/pull/3923

Change-Id: I61d4a7b1ab8318dc9403da1633c352de95bfac61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277700
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-01-13 19:51:29 +00:00
Stephen Adams ef6ce1e88a [dart2js] Basic records
Records can be constructed, returned, and field accessed in non-dynamic code. Type checks don't work, so records cannot be added to generic collections like `List<(int,int>)`.

- Add runtime for base classes for records of various arities.

- Use impacts to collect record static types used.

- Create record classes for each record shape. Record classes have
  extra metadata properties on the prototype. This allows slower,
  general operations at the root of the hierarchy that can be
  overridden with specialized operations lower in the hierarchy.



Change-Id: Ic1b38a5076c2d05f2ecff0a9ed3255b43645386e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278699
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2023-01-12 04:44:16 +00:00
Nate Biggs eaba8086db [dart2js] Update "subtype" type mask processing and other improvements to linearization.
Change-Id: Ied820595cb209ee2c29cecaf5998188a45de36a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277601
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-01-11 20:21:37 +00:00
Nate Biggs f8c6fe1446 [dart2js] Fix some more sound null safety issues.
Change-Id: Idca708abb1defca7ce1db8c6923c6f31f8ab3438
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278840
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-01-11 17:35:29 +00:00
Johnni Winther deaf9ce16e Revert "[cfe] Support external constructor with final fields"
This reverts commit c70d266270.

Reason for revert: Crash detected

Original change's description:
> [cfe] Support external constructor with final fields
>
> This adds support for having a final field and an external constructor
> without error, assuming that the external constructor initializes the
> final field. This supports the inline class with external members use
> case.
>
> Change-Id: Ie297ccc39b0a0731c146f9ac0698bba3fd83bfeb
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278502
> Reviewed-by: Srujan Gaddam <srujzs@google.com>
> Commit-Queue: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I339d9008cb84cda8dc20f29d1e103289bb5596b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278820
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com>
Auto-Submit: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-01-10 17:20:01 +00:00
Nate Biggs 0b4215c9f5 [dart2js] Fix sound null safety bug in serialization.
`null` is a valid key in the cache as it has a specific serialization index that gets tracked.

Change-Id: Id39e44bb1cd8e8015a851aeb89620e6891430940
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278580
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-01-06 20:23:11 +00:00
Johnni Winther c70d266270 [cfe] Support external constructor with final fields
This adds support for having a final field and an external constructor
without error, assuming that the external constructor initializes the
final field. This supports the inline class with external members use
case.

Change-Id: Ie297ccc39b0a0731c146f9ac0698bba3fd83bfeb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278502
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-01-06 12:25:21 +00:00
Josh Soref 50b94ef9fc Spelling runtime bin
TEST=build VM

Closes: https://github.com/dart-lang/sdk/pull/50862

GitOrigin-RevId: ae54b37666f70f670ee3af11c984c7e9a7e9da26
Change-Id: I459fda0439a1cd368f488a70d84ee6bb915e60bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277761
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-01-06 07:48:22 +00:00
Josh Soref 1ab011a2a7 Spelling tests web
Closes https://github.com/dart-lang/sdk/pull/50879

TEST=only changes to spelling to comments and internal string messages
GitOrigin-RevId: 3fa4104fa17054ea2247118a1b6213c62f2749e0
Change-Id: I776120bb2492c662dd32612dd2f6a670b5891e42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278060
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-01-05 01:26:52 +00:00
Nate Biggs 1469539e65 [dart2js] Fix type of _RecipeToIdentifier.
Change-Id: I59396791e23b5ea96848afeb087c795be389e041
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278420
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-01-04 20:49:01 +00:00
Nate Biggs cb87060664 [dart2js] Clean up leftover null safety hints.
Change-Id: Iebc59835018d2181760d3b6afc4cf18988c9dfb7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278260
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2023-01-04 18:36:38 +00:00
Nate Biggs a1dc4a9e76 [dart2js] Migrate memory compiler and helpers to null safety.
Change-Id: I578549e18acfeba4c450033b76959a0899b11fc3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278244
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-01-04 18:36:38 +00:00
Nate Biggs 0a8521f2da [dart2js] Migrate more files outside of the main dart2js app.
Change-Id: I9f717f70e7166f449196d71b1c06967553dbb0cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278243
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-01-04 18:36:38 +00:00
Nate Biggs 692a4950b0 [dart2js] Clean up null safety migration partial migrated files.
Change-Id: Ieecbad0b192a65118a7aa1e400a792661a339a3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278242
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-01-04 18:36:38 +00:00
Nate Biggs 093d67157a [dart2js] Clean up null safety migration interfaces for compiler.dart.
Change-Id: I8aa5ef1600648262e605073c36ad31af3e46b0ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278241
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-01-04 18:36:38 +00:00
Nate Biggs ddb9b8f7a7 [dart2js] Clean up some null safety migration interfaces.
Change-Id: I5c4d813ba724b9649e3687b0b4b69a68b26cd0b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278240
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-01-04 18:36:38 +00:00
Nate Biggs 3b908b472c [dart2js] Migrate dart2js.dart to null safety.
Change-Id: Ib59ad07d117dffa99e53f1ea67c103dbfdcc1114
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277303
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-01-04 18:36:38 +00:00
Nate Biggs 6df1184015 [dart2js] Fix null soundness issues before migrating last file.
Change-Id: Icfdd44b34b260f269f4a50f3a12d99f7be11697f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277304
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-01-04 18:36:38 +00:00
Nate Biggs 12aa078024 [dart2js] Migrate compiler_api_unmigrated.dart to null safety.
Change-Id: I2484ac5ccd5210d7422f304e45927307091c0e1f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277302
Reviewed-by: Stephen Adams <sra@google.com>
2023-01-04 18:36:38 +00:00
Nate Biggs cf0c7fa3a0 [dart2js] Migrate compiler.dart to null safety.
Change-Id: I8b075124942f8eb5d3febb979de6d3aa6340f760
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277301
Reviewed-by: Stephen Adams <sra@google.com>
2023-01-04 18:36:38 +00:00
Nate Biggs 5eaed3a444 [dart2js] Migrate js_model/js_strategy.dart to null safety.
Change-Id: I66ae330d1ea8a732343429f019645e6c9f30921d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277300
Reviewed-by: Stephen Adams <sra@google.com>
2023-01-04 18:36:38 +00:00
Nate Biggs 746a88c834 [dart2js] Prep js_model/js_strategy.dart for null safety migration.
Change-Id: Ia4eb541de5671850c34633d466ef2d7f0d50bbdc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277280
Reviewed-by: Stephen Adams <sra@google.com>
2023-01-04 18:36:38 +00:00
Nate Biggs 44764291b1 [dart2js] Migrate ssa/ssa.dart to null safety.
Change-Id: Iab3caf10b2cb26ab22c4f97a64f540b70ca15bf9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277261
Reviewed-by: Stephen Adams <sra@google.com>
2023-01-04 18:36:38 +00:00
Nate Biggs c9adf3f1f3 [dart2js] Clean up ssa/builder_interfaces.dart.
Change-Id: I1a42b5c5521dc1494bff9bd8015842770d555288
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277260
Reviewed-by: Stephen Adams <sra@google.com>
2023-01-04 18:36:38 +00:00
Nate Biggs 90d89acc59 [dart2js] Migrate ssa/builder.dart to null safety.
Change-Id: I57ff3a451319b298d86b32d7e3a2b97ad4c76541
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277220
Reviewed-by: Stephen Adams <sra@google.com>
2023-01-04 18:36:38 +00:00
Stephen Adams d5eeeb3585 [dart2js] Start using useDataKinds again
Change-Id: Ief4887873dbdb493bf164658393cd0e998e05e6b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277361
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-12-27 21:37:30 +00:00
Nate Biggs 612cc3b7af [dart2js] Prep ssa/builder.dart for null safety migration.
Change-Id: I7ff792c38bd2257bcff55186e9f6f0cabf5f9021
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277160
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-12-22 19:19:17 +00:00
Nate Biggs 0cf81391a5 [dart2js] Migrate ssa/branch_builder.dart to null safety.
Change-Id: I8d968b65cda73e391232c2cde872424439e93bb1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277081
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-12-22 17:44:27 +00:00
Nate Biggs 76cb3cc372 [dart2js] Migrate ssa/loop_handler.dart to null safety.
Change-Id: I0391fe611d55d63a18540ea5e3410da585a377ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277080
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-12-22 17:44:27 +00:00
Nate Biggs e53332946a [dart2js] Migrate ssa/jump_handler.dart to null safety.
Change-Id: I23475740209738302e17ef298394bccb847a341f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277060
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-12-22 00:21:28 +00:00
Nate Biggs 69d60f72c4 [dart2js] Migrate ssa/locals_handler.dart to null safety.
Change-Id: Ie01a5451ecfe2acda124d89cb2c59f78ffccccf0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276980
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2022-12-21 21:39:48 +00:00
Nate Biggs 5440e8fa02 [dart2js] Migrate ssa/string_builder.dart to null safety.
Change-Id: Iff1fe6e9fb1a6090546f01e00dc2155b69afc272
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276962
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2022-12-21 19:57:40 +00:00
Nate Biggs a7a0d6e30a [dart2js] Migrate ssa/type_builder.dart to null safety.
Change-Id: Idfb9485214112eae4a95b44a7361874eae9acc64
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276961
Reviewed-by: Stephen Adams <sra@google.com>
2022-12-21 19:57:40 +00:00
Nate Biggs 19c3e21a3c [dart2js] Prep SSA builder and associated files for null safety migration.
Change-Id: I7c1c9a816d380cf566690747ee9a64784c8f185a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276960
Reviewed-by: Stephen Adams <sra@google.com>
2022-12-21 19:57:40 +00:00
Nate Biggs 398d47cd10 [dart2js] Add priority to dartDeferredLibraryLoader hook.
Change-Id: Ib77b20fc56aa67b4f3318f9dcd8fa65b62c56509
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275800
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-12-20 15:39:09 +00:00
Josh Soref 419df9d3e5 Spelling pkg compiler
Closes https://github.com/dart-lang/sdk/pull/50774

GitOrigin-RevId: 41028b5de4e2e0719e08f180e32ccc1f2bef8dac
Change-Id: I5e6675d490a44feb0ea008582879266e421939f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276561
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2022-12-20 13:06:29 +00:00
Stephen Adams 9e115addbf [dart2js] Fix slow analysis of word widths #50759
The `bitWidth` computation sometimes visits a large dependency DAG a
tree. This change fixes the performance problem.

- Cache results from previous visits. This fixes the occasional
  exponential time.

- Move computation earlier 'instruction selection'. This allows the
  result to be used for detecting when assignment-ops can be used. I
  didn't see any changes due to this.

- Strengthen bitWidth computation to fall back on type inference results.


Bug: 50759
Change-Id: I482cc7d3b8a1e9af5798d22252cd9bc111be711d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276301
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-12-19 23:51:09 +00:00
Stephen Adams fdeb41d111 [dart2js] Fix #50755
Bug: 50755
Change-Id: Icfd9349e2373c995255d3651c1f0c8f26c462cc6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276203
Auto-Submit: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-12-17 03:27:58 +00:00
Nicholas Shahan c39ac36ed3 [3.0 alpha][dart2js] Remove use of NullThrownError
It is being removed in Dart 3.0 and a `TypeError` should be used
instead. This is true in legacy code as well and all test
expectations will be updated.

Change-Id: I021fa4ecb1a9bbc404598113c65349e17926cd91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275782
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-12-15 21:36:56 +00:00
Johnni Winther 81845864ca [kernel] Rename View* to Inline*
TEST=existing

Change-Id: I8726c936261ceb770b489f264d14fff02a1b4998
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275243
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2022-12-14 08:36:57 +00:00
Nate Biggs 0ebed3f7d5 [dart2js] Make _call non-null in CallSiteTypeInformation nodes.
Change-Id: I114b772f72dc377ea1a8a3499318fe71f1ea56da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275460
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-12-14 02:20:21 +00:00
Stephen Adams d633b0a383 [dart2js] More records implementation
These are scattered changes to get to type inferrence.

- Add some impact tracking for used record types
- Add RecordTypeInformation and FieldInRecordTypeInformation
- Add a simple test to show inference is currently very conservative.

Change-Id: Icb81033b11588c1bddd01c8c5fcf69950fdb77e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275161
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-12-14 02:20:18 +00:00
Nate Biggs c15f248840 [dart2js] Fix linearization call tracking.
`null` was being included in the set of called nodes and this was causing members normally called once to not be inlined.

Change-Id: Ie42302e47691bb924dea1e54b82e08072c0ecd7b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275122
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-12-13 22:23:17 +00:00
Nate Biggs 750b684cf9 [dart2js] Fix small bug in linearization.
Change-Id: Icc8c91131eaf8f1a7d10482f8549aa522552d05f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274960
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-12-12 23:48:53 +00:00
Sigmund Cherem 2d282a65ea [dart2js] hide "invoke from" console message.
This message was meant to be presented as an extra diagnostic message when the
compiler was running with the verbose flag, but it was accidentally
presented in the help message when running 'dart compile js -h -v'.

Change-Id: Ic2e76fc117bfd76f071756cc48ee6ce28d0f0391
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275042
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-12-12 20:18:53 +00:00
Brian Wilkerson 1e4a974a5d Remove some unnecessary ignore comments in compiler
Change-Id: I323c846776637b91922abac73acc2eac6017d4de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274722
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-12-09 22:54:08 +00:00
Nate Biggs 5dca4cbd42 [dart2js] Distinguish virtual calls from direct calls to recover some lost accuracy in types.
This recovers the accuracy of types that were previously being widened and even performs better than today's algorithm for some specific cases.

Change-Id: I0139a0fd662a91315282ba94e4c1a29d44056b9d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273501
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-12-08 21:19:54 +00:00
Nate Biggs 6144b6ed89 [dart2js] Clean up ssa/optimize.dart migration files.
Change-Id: I0aaf3e719ab6ab794840a6a07f58c3ee82a61e23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274322
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-12-08 18:12:27 +00:00
Nate Biggs 25e650691f [dart2js] Migrate ssa/optimize.dart to null safety.
Change-Id: I3d6b177e30f27a73590e53d0d650fd2342c04ed2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274321
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-12-08 18:12:27 +00:00
Nate Biggs 531e356587 [dart2js] Migrate ssa/value_range_analyzer.dart to null safety.
Change-Id: I20d5d55c9a31f87bcb517e8d416ff01a712e0c4c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274320
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-12-08 18:12:27 +00:00
Stephen Adams 49f9a85be2 [dart2js] Clean up migration interface
Change-Id: Ie40716265fce4cdb7ce298d8cbbf6c86fe06c05d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/274267
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-12-08 04:17:51 +00:00
Stephen Adams 2dbd64bb29 [dart2js, js_runtime] Make JSNull.== an external method
Change-Id: I5a69b4f085a1d418fe60af7a8726bc713b54a0bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273462
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-12-08 02:14:00 +00:00
Sigmund Cherem e8906e65e7 [3.0 alpha][dart2js] No longer infer the null-safety mode from sources.
This prepares dart2js to default to sound null safety in Dart 3.0.

The compiler no longer infers the default mode based on the input
program, instead uses sound null safety unless
'--no-sound-null-safety' is specified.

On a separate change, we expect to remove the option of disabling
null safety.

Note: this change should also be reflected in the CHANGELOG, but
we've currently not included it to redeuce merge conflicts, as we plan
to land multiple 3.0-alpha changes in a short window of time

Change-Id: Id87498cc5976548ec89d1f36c60674b72406950a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270860
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-12-07 04:02:13 +00:00
Nate Biggs badf1c5a0e [dart2js] Use new call target calculation in DynamicCallSiteTypeInformation.
Change-Id: I7077df4e718cc8836aa00aa7fc37249f8c735140
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267140
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-12-05 20:22:25 +00:00
Nate Biggs efe18b5c4a [dart2js] Add inferrer engine changes for type graph call linearization.
Change-Id: I23c1f12f4b619be9f4409b23f83cf54cd0fcc301
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267062
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-12-05 20:22:25 +00:00
Nate Biggs 6173ba5dab [dart2js] Add findRootsOfTargets to abstract domain.
Change-Id: Ib5035537f242a0b518a47d53c5d4e20b8bbb71fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266880
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-12-05 20:22:25 +00:00
Nate Biggs e48df2f7f3 [dart2js] Carry library load priorty through to script tag creation.
Change-Id: Ie05b5ffe0f2e1638faf8b784a2e8c5535ec0d76a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272760
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-12-02 05:19:53 +00:00
Nate Biggs 3daee0282b [dart2js] Fix inferrer bug in handling exit conditions in try/catch/finally.
This is showing up in places like here where we are inferring `JSObject.toString` to return `String?`:
https://github.com/dart-lang/sdk/blob/main/sdk/lib/_internal/js_runtime/lib/js_patch.dart#L204

Change-Id: Ie15c6a06cd1e0f9ead87b4a9ceaa949bdcbce989
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269040
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-12-01 22:16:35 +00:00
Nate Biggs ad14e5d67c [dart2js] Add universe/member_hierarchy.dart
This will be used from DynamicCallSiteTypeInformation nodes to get a list of receivers for dynamic calls. The InferrerEngine will also use it to calculate overrides of a given function and mark them as called.

Change-Id: I5738e393ae2de4cb93fd55c60e944a2db067b448
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266422
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-11-28 23:26:08 +00:00
Nate Biggs 456ca8a264 [dart2js] Delete hashCode implementation on TypeInformation.
This hashCode is rarely used today so there shouldn't be any significant change from this. But in terms of code health it's better to remove this now.

Change-Id: Iff3ea93a4d82c3977ca7903888def7cbcb2f138f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/272401
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-11-28 20:51:38 +00:00
Stephen Adams 72f429d63b [dart2js] Prepare to migrate ssa/optimize.dart
Change-Id: I1cb0fc08fa4682c0ec13fb8e101ebaaa34bc76bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/271860
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-11-28 20:45:00 +00:00
Stephen Adams 419c5fdb91 [dart2js] Cleanup ssa/value_range_analyzer.dart for migration
- Remove the dynamic 'apply' operation from `constant_system.operation`.
- Create all range expressions from ValueRangeInfo.

Change-Id: I008d941141e2b91056173a317f387f0986fce4fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270321
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-11-21 22:58:31 +00:00
Ahmed Ashour 9bea89246a Fix grammar
Fixes #50509

TEST=ci

Change-Id: I7ca115bbe6f436e9df126afddcc08eaba79af2f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270740
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-11-21 20:07:29 +00:00
Nate Biggs 795e35e0af [dart2js] Don't use deferred serialization strategy for Dart2JS info dump.
The info dump processor ends up deserializing most of the deferred data anyway so there is no benefit to the deferred logic. This saves ~600MB on info dump.

Change-Id: Ib9a1154b38594a3f046d5da96b477de9f2c90b9d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/271041
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-11-21 19:29:58 +00:00
Nate Biggs bdb782ba8f [dart2js] Add mmap-based read to dart2js for linux systems.
Based on Martin Kustermann and Slava Egorov's versions of memory mapped views.

This feature is disabled by default and even if the flag is enabled, it will fall back to the current strategy if the platform is not Linux or the new strategy fails.

Phase 1 stats from 50 runs:
---Before---
Max memory: 8786.766
Median memory: 8116.242
Average memory: 8327.404081632654
---After---=
Max memory: 7805.691
Median memory: 7137.203
Average memory: 7305.301122448978

Phase 2 stats from 50 runs:
---Before---
Max memory: 9273.359
Median memory: 8742.133
Average memory: 8868.929124999999
---After---
Max memory: 9409.672
Median memory: 7500.148
Average memory: 7650.154000000001

Phase 3b stats from 50 runs:
---Before---
Max memory: 8979.367
Median memory: 8705.215
Average memory: 8703.982755102037
---After---
Max memory: 7809.898
Median memory: 7455.609
Average memory: 7449.96102040816


Change-Id: I73d73cfb26218399367c72c886f247836b89925c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269640
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-11-18 21:40:38 +00:00
Stephen Adams b8d85b7ad3 [dart2js] loadLibrary priority annotation
Add annotations

    @pragma('dart2js:load-priority:normal')
    @pragma('dart2js:load-priority:high')

The test shows that these annotations are scoped.

This CL is just plumbing the annotation through as an argument to the runtime call to the code that implements `loadLibrary()`. Actual prioritization is not yet implemented.

Change-Id: Iff1404baf34192139dab95e2dbb01c2d4e8dae45
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270283
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-11-18 19:22:29 +00:00
Nate Biggs 3d61bef06e [dart2js] Migrate serialization/task.dart to null safety.
Change-Id: Icbba0f1f1ba3d68d4374e15ade41d3a8876510e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270344
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-11-18 18:38:12 +00:00
Nate Biggs ec6184f7ef [dart2js] Clean up migration files for common/codegen.dart.
Change-Id: I7b236580cb0ecfa9aa71f4976bd954570b944284
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270343
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-11-18 18:38:12 +00:00
Nate Biggs ca07c65770 [dart2js] Clean up migration files for js_emitter.
Change-Id: I113f4cb410d4e3372825d9af8c83dbf4af844716
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270342
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-11-18 18:38:12 +00:00
Nate Biggs 7ef59cdf1f [dart2js] Migrate startup_emitter/emitter.dart and js_emitter/code_emitter_task.dart to null safety.
Change-Id: Iabad108c88a4e900fcb0c05dc23bb7318b04472b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270341
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-11-18 18:38:12 +00:00
Nate Biggs b91ad8cd39 [dart2js] Migrate common/codegen.dart to null safety.
Change-Id: I474f31946b9a9da59e7f51e78907691afc860782
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270340
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-11-18 18:38:12 +00:00
Nate Biggs 975cb8a9cb [dart2js] Move memory compiler out of test folder.
Change-Id: I4fd3b1fa91582ce19fb16a61a81013d694e0cd59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270540
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-11-18 02:59:15 +00:00
Stephen Adams 58c15eeeeb [dart2js] Migrate ssa/codegen.dart
Migrate the cycle codegen.dart, codegen_helpers.dart and variable_allocator.dart

Change-Id: I89b2b59736bd8024fe5a65bba4bbb60f3379b700
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268863
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-11-16 21:32:00 +00:00
Stephen Adams c50144d4d9 [dart2js] Migrate some small optimization phases
Change-Id: Ib9af322acdf247e0e431717b7f3ddec3dff15142
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270026
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-11-16 17:18:48 +00:00
Nate Biggs f2a46de0c1 [dart2js] Fix RTI in non-prod mode, ignore parameters on abstract methods.
Change-Id: Ie8752f4b055324a06c29812c2a9d756b060ceccc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269643
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-11-15 22:17:12 +00:00
Nate Biggs 26a5c637a4 [dart2js] Add metric to track FlatTypeMask.intersection cache size.
Change-Id: Ie727c3e0a8513fa67feb01f59ebfaa6029d320eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269520
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-11-15 22:09:06 +00:00
Nate Biggs ba662eb4b4 [dart2js] Replace dart2js_dynamic_test with lint and appropriate lint ignores.
See patch 2 for failures coming from this new analysis option.

Change-Id: I6bb10c2eb12431f6c503cc817a9c9bb45ba597a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269800
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-11-15 21:11:59 +00:00
Nate Biggs 271f72422e [dart2js] Add live abstract members into closed world.
Effects of this change are minimal on a large application:
- ~9100 new members being tracked.
- +500KB closed world serialized output (.3% increase)
- No discernible difference in closed world runtime
- Heap space in global inference after closed world deserialization increase is <1MB.
- No change in JS output

These abstract members will be used by the new hierarchy-based dynamic call type graph linearization.

Change-Id: I4ce56d12e039effe0a855fd23f2a5e69d0847025
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264900
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-11-15 04:52:01 +00:00
Nate Biggs 6cb9397f59 [dart2js] Add cache to FlatTypeMask.interesection
Both the calls to ClassHierarchy.commonSubclasses and UnionTypeMask.flatten (in the worse case) are expensive for large programs. Certain programs can have a type structure that ends up in the UnionTypeMask.flatten case very often which can be especially taxing.


Change-Id: I7799d2f5a7f764162a4ca753bfa37b11f583373f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/269221
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2022-11-11 22:49:02 +00:00
Nate Biggs 08e0de94be [dart2js] Migrate js_emitter/program_builder to null safety.
Change-Id: I4d9e6f025b21c157879d99ab0bbc2f25da5cd569
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268407
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-11-09 21:39:19 +00:00
Stephen Adams c66667e75e [dart2js] Stable sort for entities with same location and name
Sometimes entities have the same name and location. For example, the
synthesized getter and setter for a late instance field have the name
of the field and the location of the original field declaration.  Some
transforms inject multiple closures with the same location and name
('xxx_closure').

We used to 'break ties' by sorting on `hashCode`.  The `hashCode` was
somewhat deterministic as it relied on the `index` of Indexed
entities. The same program unchanged, or under minor changes, tended
to process the entities in the same order and, as the index-derived
hashCode was monotonic in the index, the relative visit order was
invariant when the program was recompiled without changes, and mostly
stable for small changes.

When the deterministic `hashCode` was removed and replaced by the
default `Object.hashCode`, this lead to nondeterministic output, since
the hashCode is different each run.

This could mainly be seen in the sourcemaps where the name might
change between 'foo' and 'foo=' as the relative order of the late
instance field getter and setter changed.


This change removes the comparison on `hashCode`.  Instead, we use a
stable sort, and rely on the entities being sorted having been
collected in some stable order.

Change-Id: I7c8749fea6d2f43bde84bc3991501572f35b1ffa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268660
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-11-09 21:13:47 +00:00
Nate Biggs a81cc9a1ed [dart2js] Migrate js_emitter/startup_emitter/(model|fragment)_emitter to null safety.
Change-Id: I167e164ef88f9c34aae06fe95494230ac1d52ac6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268700
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-11-09 20:04:41 +00:00
Nate Biggs 52562bbd54 [dart2js] Prep js_emitter/program_builder.dart for migration to null safety.
Change-Id: I95b3255706d2d6b4015555361416e3636e0965da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268406
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-11-09 04:49:54 +00:00
Nate Biggs 4c1391eb9a [dart2js] Migrate js_emitter/parameter_stub_generator.dart to null safety.
Change-Id: I2b260bf1b457f017a1686373ce74455f37be539f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268405
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-11-09 04:49:54 +00:00
Nate Biggs 14070184ff [dart2js] Speed up FunctionSet.query by organizing nodes by private/public and private by URI.
All nodes that match must be visited and compared to the queried selector. By organizing private nodes by URI the scope of nodes that need to be visited us much smaller.

In a big application this reduced the runtime of phase 2 by ~20s (~180s -> ~160s).

I see no significant memory difference from this change. +.1GB RSS according to DevTools directly after FunctionSets are initialized.

Change-Id: Id9c3a5ae84c7f0aad589cff89d4bec15e97758d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268408
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-11-08 19:11:10 +00:00
Nate Biggs 56225add77 [dart2js] Clean up js_backend/namer migration files.
Change-Id: I16f4797973d344868943b04f53d86973c163706a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268404
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-11-08 00:59:20 +00:00
Nate Biggs 25371c516c [dart2js] Clean up js_backend/rti_new migration files.
Change-Id: I3d065099f7a71e6a80f9e8f2abc667a019f019a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268403
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-11-08 00:59:20 +00:00
Mayank Patke 9d8b26b1ee [dart2js] Remove hashCode implementations from indexed entities.
Change-Id: I66a235e48b0eae8f96d9c0f7b5ffa1d139b376a0
Bug: #50258
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268364
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-11-08 00:16:07 +00:00
Nate Biggs e7e7d4a242 [dart2js] Migrate js_backend/runtime_types_new.dart to null safety.
Change-Id: Idf534967e5299c95e6d686324c5e002128f77340
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268402
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-11-08 00:04:47 +00:00
Nate Biggs de0679ac99 [dart2js] Migrate js_backend/backend.dart to null safety.
Change-Id: I6b38f996a8c9bf77343aba0f062e42d32d7b93ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268401
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-11-08 00:04:47 +00:00
Nate Biggs daa7e57d45 [dart2js] Migrate js_backend/impact_transformer.dart to null safety.
Change-Id: Id51ba86cd232cd6c5f715db3e90eab4421c436f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268400
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-11-08 00:04:47 +00:00
Sigmund Cherem 0ea0ac19e9 [dart2js] migrate runtime_type_generator
Change-Id: I41e54e20367ee9f1427f0d387f77410dbf9b80e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268104
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-11-07 23:30:01 +00:00
Sigmund Cherem 49cdbea06b [dart2js] migrate native_emitter.dart
Change-Id: I7feaeb849e3c8428d1ec7b8df00bf845f97d1c99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268103
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-11-07 23:30:01 +00:00
Stephen Adams a005521268 [dart2js] Migrate ssa/value_set.dart
Change-Id: I34f8cc745a86181ac28386ac1de5276455c34b4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268111
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-11-07 21:06:42 +00:00
Stephen Adams 890ec934ee [dart2js] Migrate ssa/tracer.dart, finish migrating src/tracer.dart
Change-Id: Ie6a69b5e655cb1e01f3f0ba337db69d66076722d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268110
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-11-07 21:02:49 +00:00
Nate Biggs 973064e625 [dart2js] Migrate js/size_estimator.dart to null safety.
Change-Id: Iaa1603706844aa65b31b27f94f107f246467eff4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268165
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-11-07 18:59:38 +00:00
Nate Biggs e58420992d [dart2js] Migrate js_backend/constant_emitter.dart to null safety.
Change-Id: I9ae42117fd329d93c95d54a381f6f8e032f7f313
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268164
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-11-07 18:59:38 +00:00
Nate Biggs 16009db252 [dart2js] Migrate js_backend/namer.dart to null safety.
Change-Id: I79725d67108540a07879c47927f8530840ce6b4a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268163
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-11-07 18:59:38 +00:00
Nate Biggs 60a6ad320d [dart2js] Migrate js_backend/js_interop_analysis.dart to null safety.
Change-Id: I0c8b34881be46c6204e77526ce26f14b811d9b4b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268162
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-11-07 18:59:38 +00:00
Nate Biggs 0cb784cfea [dart2js] Migrate js_backend/deferred_holder_expression.dart to null safety.
Change-Id: I7d5515fd7bf60061169c6a6f26207725717d088b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268161
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-11-07 18:59:38 +00:00
Nate Biggs 8cf4331992 [dart2js] Migrate js_backend/type_reference.dart to null safety.
Change-Id: I4f322c463bd5c3ba220dc4f7228f38c5e4eda7a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268160
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-11-07 18:59:38 +00:00
Nate Biggs 5829f9342f [dart2js] Speed up slow operation in closure tracing.
Previously both updated locations were using an expensive 'any' operation to see if one of the concrete targets was the 'currentUser'. This required iterating every target, which there could be many of for dynamic call sites. Looking for the member itself with a 'contains' operation on the concrete target list is much faster since the concrete target lists are backed by Setlets.

Locally this change lead to a ~15% improvement in runtime. The time spent tracing closures in a particular large app went from ~30s to ~2s.

Change-Id: Id9cd1cb9a8d8f0990893c827b9a3b49003180d8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/268166
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-11-07 17:12:48 +00:00
Srujan Gaddam 186e4c5c25 [dart2js] Do static interop erasure for both dill and src
This is a reland of https://dart-review.googlesource.com/c/sdk/+/266803.
Performance regressions came from visiting core libraries. To avoid
this, this CL skips all core libraries that aren't in an allowlist.

Change-Id: I68bbf8b8df6863dfc9deeca487a66ff60947b841
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267769
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-11-04 23:11:41 +00:00
Stephen Adams 238c74cbb8 [dart2js] Migrate ssa/nodes.dart
Migrate the cycle containing the four files nodes.dart, invoke_dynamic_specializers.dart, logging.dart, and validate.dart

Change-Id: I64aa8308e54f980e79e3405d9b751225306e39df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267900
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-11-04 21:56:47 +00:00
Nate Biggs 9766e53168 [dart2js] Migrate dump_info.dart to null safety.
Change-Id: I0b6232bb29866777b7048e30bed62abab10016d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267824
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-11-04 16:39:53 +00:00
Sigmund Cherem fbcccdefc9 [dart2js] migrate main_call_stub_generator
Change-Id: I7f8933d9a1de71418f03cf48b4afebfbadc0d0bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267767
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-11-04 15:27:13 +00:00
Sigmund Cherem 53c712e47b [dart2js] migrate interceptor_stub
Change-Id: Id1e75a59b758c979ab8384d0a250ea2aa1df4380
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267766
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-11-04 15:27:13 +00:00
Sigmund Cherem 1f8bad1a75 [dart2js] Migrate instantiation_stub
Change-Id: Ib9cce2bb5f2e2787daac390309418d59ac27fd54
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267764
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-11-04 15:27:13 +00:00
Sigmund Cherem 3318b5d892 [dart2js] Migrate class_stub_generator
Change-Id: I1461174b57713431b4f8c87aea04d9fc7a83cfa1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267763
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-11-04 15:27:13 +00:00
Nate Biggs 1aecd5bcce [dart2js] Migrate serialization/strategies.dart to null safety.
Change-Id: Iad23474f69b78231a6c77da5f5b8b379618f77be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267820
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-11-04 15:11:27 +00:00
Nate Biggs 3ed70b013b [dart2js] Remove JClosedWorld interface and use only implementer, JsClosedWorld, everywhere.
Change-Id: I9641033aa3a93a28ee428ddc63aa7fc337e5468a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267802
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-11-04 15:11:27 +00:00
Srujan Gaddam b597b7571a Revert "[dart2js] Run static interop erasure regardless if from dill or src"
This reverts commit 5d7029e288.

Reason for revert: Increases memory usage in dart2js benchmarks

Original change's description:
> [dart2js] Run static interop erasure regardless if from dill or src
>
> Removes modular transformation as well.
>
> Change-Id: Ib3aafcaf35b72fdb6a93db682dcf8df84842578f
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266803
> Reviewed-by: Joshua Litt <joshualitt@google.com>
> Commit-Queue: Srujan Gaddam <srujzs@google.com>

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I8c40f16983a3f7e2383dcf3b47c2134c9ecd6746
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267762
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-11-03 23:12:50 +00:00
Nate Biggs 902e5d030e [dart2js] Remove isConstructor from entity model in favor of type test.
Change-Id: Id082b573478e3d916bb450b12a9d57f3a852f158
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267800
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-11-03 20:48:12 +00:00
Nate Biggs 863ae7b60e [dart2js] Remove isField from entity model in favor of type test.
Change-Id: I94d854ea34f610f0212bc7b1abeedfa90c67968d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267741
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-11-03 20:48:12 +00:00
Nate Biggs beacf3d7bf [dart2js] Migrate inferrer/type_graph_inferrer to null safety.
Change-Id: Ib6f82a9b7fd58d7185f4d3b9997f2c0eacfa33cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267248
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-11-03 16:18:40 +00:00
Nate Biggs 217c18f296 [dart2js] Clean up inferrer/engine migration files.
Change-Id: I22a2b14eee779900881b54c40723e5cc59113d90
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267247
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-11-03 16:18:40 +00:00
Nate Biggs 08c981a387 [dart2js] Migrate inferrer/engine.dart to null safety.
Change-Id: I3eff0355904d5c221946c2ee3549128f771aa731
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267246
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-11-03 16:18:40 +00:00
Johnni Winther 05ff50e6ca [kernel] Add View and ViewType
These are needed for the 'views' feature. No nodes are created yet.

TEST=existing

Change-Id: I0c7a34e460a4d17bd39ee23e7aa6bd8851f4275e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266620
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-11-03 08:42:06 +00:00
Nate Biggs 6539e200b8 [dart2js] Migrate inferrer/type_graph_dump.dart to null safety.
Change-Id: Idc6af28c0bb257e78f11aa4c89ba04c1a67aebed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267242
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-11-02 23:55:48 +00:00
Nate Biggs 2bfabc6392 [dart2js] Migrate inferrer/builder.dart to null safety.
Change-Id: I0e9a51b72ee619932f324b5f636b4788faa7ad76
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267241
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-11-02 23:55:48 +00:00
Srujan Gaddam 5d7029e288 [dart2js] Run static interop erasure regardless if from dill or src
Removes modular transformation as well.

Change-Id: Ib3aafcaf35b72fdb6a93db682dcf8df84842578f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266803
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2022-11-02 18:12:28 +00:00
Stephen Adams 35d37349cf [dart2js] Preparation for migrating ssa/nodes.dart
- Make HInstruction visitors generic.

Change-Id: I9b3a14422a0eec50e0b2ae08d78b8c597482ad31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263221
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-11-02 17:22:15 +00:00
Nate Biggs 2df209607d [dart2js] Cleanup kernel/kernel_strategy migration files.
Change-Id: Ic00dbe113025caf330c4be8b2d77aff9a38ac90a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267240
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-11-02 15:39:25 +00:00
Nate Biggs 18d74d3e34 [dart2js] Cleanup closure migration files.
Change-Id: Id61ac38221cfeb51f8e680739d0bbf1f24b99aea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267203
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-11-02 15:39:25 +00:00
Nate Biggs ae08d32c8e [dart2js] Cleanup js_backend/no_such_method_registry migration files.
Change-Id: Iec7d28b02abf705b3b6e976ab21bcc6c365fdcb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267144
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-11-02 15:39:25 +00:00
Nate Biggs 6bf775e4eb [dart2js] Cleanup js_model/closure migration files.
Change-Id: Ibf61dd6646982976e2643829a9d23739a6b16e02
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267143
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-11-02 15:39:25 +00:00
Nate Biggs 014a604615 [dart2js] Cleanup js_model/js_world migration files.
Change-Id: I725d29ab35b862704bf375324563bfaf9491989e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267202
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-11-02 15:39:25 +00:00
Nate Biggs f120de03ef [dart2js] Cleanup js_model/element_map migration files.
Change-Id: Ic772ec503813ccaa0790d6b7aebf1a479fcbc2c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267201
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-11-02 15:39:25 +00:00
Nate Biggs dcd03b0dd4 [dart2js] Cleanup world migration files.
Change-Id: I387d0a819e1ac316ae615e2c5504fc5c9b4377ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267200
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-11-02 15:39:25 +00:00
Nate Biggs 879425cb1a [dart2js] Clean up kernel_world migration files.
Change-Id: I4963670116486451bb92cc65f9855e0c0298dcf8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267142
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-11-02 15:39:25 +00:00
Nate Biggs 8dea42e4e7 [dart2js] Clean up kernel/element_map and kernel/env migration files.
Change-Id: I8312642ba80176c7c298bebce82005be0a3a07b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/267141
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-11-01 21:11:12 +00:00
Sigmund Cherem 968778d94b [dart2js] further prepare constant_emitter (missing 1 dep)
Change-Id: Icb0f0effc2192c33f3c090ccdbb42de5bb78d270
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266865
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-11-01 17:51:18 +00:00
Sigmund Cherem dd666239ae [dart2js] use more facades in emitter
Change-Id: Id41ee31b20ba721ce9a8a180f94a4878d9cc4b90
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266864
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-11-01 17:51:18 +00:00
Sigmund Cherem 09cd5c5699 [dart2js] prepare deferred_holder_expression for migration.
Change-Id: I5f1e9731bb45df85b71aa24df6402d7b5b9bdff2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266863
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-11-01 17:51:18 +00:00
Sigmund Cherem 3d444b0239 [dart2js] move some namer static properties and methods outside the Namer class.
These are trivially migrated too. Removing static members makes it easier to
migrate later some downstream dependencies and make the Namer interface just be
an interface.

Change-Id: Ia9227577887a9428c3bd8e4cb46952eab5ef6983
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266862
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-11-01 17:51:18 +00:00
Sigmund Cherem 25b93827c5 [dart2js] use namer_interfaces.dart in more dependencies
Change-Id: Ifc0c24cc5ff22ef309379610c40dbe24a26590dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266726
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-11-01 17:51:18 +00:00
Sigmund Cherem 3221084eca [dart2js] reduce unmigrated dependencies from serializatin/task
Change-Id: Ia8d03cf6b57e42fe94d251526a2dc3cb1001cbf9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266725
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-11-01 17:51:18 +00:00
Sigmund Cherem 9493c5d5b3 [dart2js] prepare serialization/strategies for migration
Change-Id: Ic479799af4cc0ff55a6b5124eaeb52658606a2ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266724
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-11-01 17:51:18 +00:00
Sigmund Cherem c1579f39cc [dart2js] minor preparation steps in ssa folder
Change-Id: If03674dabd46a5b25009da664d21ca39f90e1016
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266723
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-11-01 17:51:18 +00:00
Sigmund Cherem 1e05d6aa43 [dart2js] prepare many libraries under js_emitter
Many libraries are either ready for migration, or only blocked
by other libraries in the same folder.

Change-Id: If18032e916c23b81aff04ec293f002f7aa446b01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266722
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-11-01 17:51:18 +00:00
Sigmund Cherem 5607a32214 [dart2js] step to prepare js_backend/namer.dart.
With this change, namer.dart no longer depends on unmigrated libraries
from other folders (only within js_backend)

Change-Id: Ib7c4b98a04dd157400f5e196a48db86eaaf334ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266721
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-11-01 17:51:18 +00:00
Riley Porter 0b4376e3d1 Revert "[dart2js] Change default for canPerformGlobalTransforms to false"
This reverts commit 700b94eb04.

Reason for revert: Revert due to internal failures: b/256219908

Original change's description:
> [dart2js] Change default for canPerformGlobalTransforms to false
>
> Fixes the staticInterop type erasure issue in dart2js when compiling the
> sdk separately from the code being compiled. With this change, the
> Angular hello_world app runs successfully with the dart:html prototype.
>
> Change-Id: Iaf5071f0f05d4fe1d17349adce4f1ce494154b9c
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262842
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Commit-Queue: Riley Porter <rileyporter@google.com>

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I42c5c1ff5eddb675354dbe0e719390df1656e281
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266306
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Riley Porter <rileyporter@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-10-29 00:14:21 +00:00
Nicholas Shahan 3bc3a84fd0 [ddc] Add basic support for new interface types
- Support interface types without generic parameters in type tests.
- Add '|' symbol to recipes to separate the library identifier from
  the type. This is used in the modular setting where types are not
  guaranteed to have a unique name.
- Add a runtime method to strip library identifiers when printing
  type names.
- Add a runtime method to retrieve original Dart type name from
  constructors.

Issue: https://github.com/dart-lang/sdk/issues/48585
Change-Id: Ib2a69c29177ebb7c582bff3246ee985666cd5919
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243362
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-10-28 19:26:50 +00:00
Riley Porter 700b94eb04 [dart2js] Change default for canPerformGlobalTransforms to false
Fixes the staticInterop type erasure issue in dart2js when compiling the
sdk separately from the code being compiled. With this change, the
Angular hello_world app runs successfully with the dart:html prototype.

Change-Id: Iaf5071f0f05d4fe1d17349adce4f1ce494154b9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262842
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
2022-10-27 18:54:30 +00:00
Sigmund Cherem 96e7d689db [dart2js] prepare dump_info for migration
Change-Id: I1d8161b67e62578d00751778e4a1242e142bdfa9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265965
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-10-27 17:51:18 +00:00
Sigmund Cherem bde9ca241b [dart2js] Use runtime_types_new_interfaces in a few more places
Change-Id: Ie7480f67b96e63e609a3090aba4eac7f07a057a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265964
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-10-27 17:51:18 +00:00
Sigmund Cherem d5a46dabca [dart2js] initial steps to prepare codegen and ssa/codegen.dart for migration
This removes most unmigrated dependencies, only 4 remain. 3 in the same ssa
folder, and one to js_backend/type_reference.dart

Change-Id: I15596d6f5a915c5043f87861ac1a9fa4327f8c4a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265680
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-10-27 17:51:18 +00:00
Srujan Gaddam 35cae2d4da [pkg:js] Rename export and mock transformers and separate them
Per previous review comment - this separates the three components into
separate files.

Change-Id: I601bd9ac29ddd032e913a60ce2b5b7dd81e39efc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264603
Reviewed-by: Riley Porter <rileyporter@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-10-26 16:34:38 +00:00
Mayank Patke 278815b192 [dart2js] Add abstract value domain to distinguish uncomputed values.
Normal dart2js invocations will continue using the existing abstract
value domains with `emptyType` as the initial type for type graph nodes.

When an appropriate debug flag is passed, all abstract values will be
wrapped so that the underlying empty type is only used when a value is
known to be empty. Abstract values which have not yet been computed will
print as "[uncomputed]" in order to aid in debugging but will otherwise
behave like the empty type during type graph construction.

Change-Id: I1ec41e42e8b566a0a6bfe969c2ff96f4e53d5f4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243844
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2022-10-25 19:24:19 +00:00
Sigmund Cherem fa4851cd4e [dart2js] prepare additional files in inferrer folder (part 2)
This now breaks the cycle in this folder, so all libraries can be migrated in a
specific order.

Change-Id: Ib76d813804e2d0eac485bbeb84a1e0aac0027e7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264360
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-10-25 16:42:16 +00:00
Sigmund Cherem ab0da67708 [dart2js] prepare inferrer folder for migration (part 1)
Change-Id: Ifd52acd8786f4b817158f569622b1333c48fe57d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264345
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-10-25 16:42:16 +00:00
Sigmund Cherem 04239b784f [dart2js] migrate runtime_types.dart
Change-Id: Ide7ac30296612be3b4208267dc9135f3361b5cf2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264344
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-10-25 16:42:16 +00:00
Srujan Gaddam 7f93985005 [pkg:js] Add validation for @JSExport and createDartExport
Creates an external createDartExport function in js_util.

Adds a number of checks for the annotation:
- Classes with the annotation should not have value in the annotation
- Classes with the annotation should have at least one instance member
somewhere in the hierarchy
- There are no export name collisions that are unresolvable accounting
for overrides
- Members with this annotation are instance members with a body only

Also adds checks to createDartExport:
- Checks that the type is a Dart class
- Checks that the type is marked as exportable

Change-Id: I52f27275966e9603e88921ce7897b7615178c4d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259511
Reviewed-by: Riley Porter <rileyporter@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-10-24 17:37:09 +00:00
Sigmund Cherem 3719dbf671 [dart2js] cleanup after fix.
Now that type parameters can occur nested within type literals there
is no reason to special-case type parameters. Now that we don't
consider type literals to be always constant, it is safe to remove
this extra check and handle type parameters the same as a generic
type literal containing a type parameter.

Change-Id: I887d162e20fd29f3285d73149927e51e1f1d1753
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264894
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-10-19 23:18:54 +00:00
Sigmund Cherem 0f16027f86 [dart2js] Fix for deferred loading bug.
Long ago Dart didn't support generic type literals and the deferred
loading algorithm assumed that in the ConstantCollector visitor. Now that Dart supports them, we need to ignore them if they get encountered.

Fixes #49851

Change-Id: I637f70a74bbe5ca8fc76c2f8ff79e97eeac19182
Fixed: 49851
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264884
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-10-19 21:50:07 +00:00
Sigmund Cherem b8b81d4d19 [dart2js] migrate js_world_builder
Change-Id: I794a773e49f267d187af3ea76a596007a40224d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264343
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-10-19 19:39:03 +00:00
Sigmund Cherem da689b6531 [dart2js] migrate universe/codegen_world_builder
Change-Id: Ia85fdc3b9b018475be29ab96e0e9928ba1b9a153
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264342
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-10-19 19:39:03 +00:00
Sigmund Cherem 71ff066c1e [dart2js] Migrate js_world.dart.
This also fixes a couple nullability signatures in world.dart and class_set.dart

Change-Id: I11b383c312a2320ae4ea7bac36c46c3f80fb7e0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264341
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-10-19 19:39:03 +00:00
Sigmund Cherem 4990d73002 [dart2js] Migrate kernel strategy
Change-Id: Ib8b251bc69e42c414e6519595af75c10187abbef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264340
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-10-19 19:39:03 +00:00
Sigmund Cherem 5501c7f978 [dart2js] Migrate resolution_world_builder.dart
Change-Id: I089cf76ec054cbcc562f51bde43a3931c1dba9be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262743
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-10-14 03:13:52 +00:00
Sigmund Cherem 83dfe0b3fe [dart2js] migrate kernel_world.dart
Change-Id: I44a5395b185035f95167875a57a392ae85f7eb40
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262742
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-10-14 03:13:52 +00:00
Sigmund Cherem b5bb9f84a1 [dart2js] add facade for kernel_strategy
Change-Id: I71681bd8d3e6d06aeedd3a8dfc94bbc47fa8fbd1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262741
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-10-14 03:13:52 +00:00
Sigmund Cherem 6843d6e5be [dart2js] Migrate no_such_method_registry.dart
Change-Id: Ib66a9c127dc3a88f835d5f74997260b0c856fe31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262740
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-10-14 03:13:52 +00:00
Stephen Adams 20fff85f10 [dart2js] Cache targetsIncludeComplexNoSuchMethod
This seems to speed up inferrer by 5-10%

Change-Id: I733159e9ec79212821444b4e502b28aa2bf81bdd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263220
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-10-09 06:42:44 +00:00
Stephen Adams fe98a5642e [dart2js] migrate ssa/types.dart
Change-Id: I721f584c61ff40863d4e9461330bb0d1db11d0d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263080
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-10-07 18:50:17 +00:00
Nate Biggs 1e6aa3fcbe [dart2js] Migrate inferrer/types.dart to null safety.
Change-Id: I39774c2a0875be6519c8bc95808a0fc76a27421b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263060
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2022-10-06 22:58:48 +00:00
Stephen Adams aaed0ce048 [dart2js] Add subtyping of record types against Record interface
- Fix bug with nullable record type, e.g. `(int,int)?`.

Change-Id: Ie8006e8ec3a9ffd675519df2ab7b4d101d8d5dcd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262843
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-10-05 21:56:07 +00:00
Stephen Adams edf0da2df4 [dart2js,js_runtime] Record type recipes and runtime subtype test
Change-Id: I54adb8b6184a19667a296a670fecb37d7ce9dce7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262126
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-10-05 16:48:01 +00:00
Stephen Adams 5365e6fb1b [dart2js] Rename JRecord to JContext
This is to avoid confusion as we implement the records language feature.

Change-Id: I35aee0d88a42b7b4960332c3d81c0551d6e3ebde
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262506
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-10-04 22:52:49 +00:00
Sigmund Cherem 33c1ff60da [dart2js] migrate io/kernel_source_information.dart
Change-Id: I377252c3e715624240460e47bad2b4bc3a12708c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262277
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-10-04 17:08:00 +00:00
Sigmund Cherem d9b74dc377 [dart2js] prepare io/kernel_source_information for migration
Change-Id: I800afd2e8091bc2560bb373f3d1535d15b84e82a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262276
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-10-04 17:08:00 +00:00
Nicholas Shahan da79baa962 [ddc] Fix bug in FutureOr type normalization
The correct normalization should only normalize FutureOr<Never>
when Never is non-nullable.

Change-Id: I592f3a4856c219b33a8f1ac8377567a956e1148c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261000
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2022-10-03 20:09:38 +00:00
Sigmund Cherem 5828f1be7f [dart2js] prepare no_such_method_registry.dart
Change-Id: I9f217a257e4a2ed6d16b98b4b85f41c216c6e1ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262279
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-10-03 17:49:56 +00:00
Sigmund Cherem c41cec8f50 [dart2js] migrate world.dart
Change-Id: Ib0bc169bc58675e9202a35fd232cf24f1dfac1e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262278
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-10-03 17:49:56 +00:00
Sigmund Cherem 9768f74c59 [dart2js] migrate resolution_listener.dart
Change-Id: I4fcb759ce8b65a59952506ff83462b92859c13eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262275
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-10-03 17:49:56 +00:00
Sigmund Cherem 7ab05daa4b [dart2js] prepare resolution_listener.dart
Change-Id: Ic69113e3640985283dc5ba292b060b9bdbe229d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262274
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-10-03 17:49:56 +00:00
Stephen Adams f7809873f4 [dart2js] Add RecordType
Add RecordType to the dart2js DartType hierarchy.
The RecordShape is made explicit so that processing the record type usually means processing the list of field types.
This pattern of shape + combined-fields will be used elsewhere, e.g. constants.

Filled out some uses of ir.RecordType until it gets converted to a dart2js DartType.


Change-Id: I6aa4d4a920cbb0e4f37e7079bc4d9d10e366a849
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261581
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-09-30 04:59:49 +00:00
Stephen Adams a8ab1853a9 [dart2js] Avoid eager initialization with a large set
Change-Id: Ic4027cfe09294836cc182969a7cb92be01d3c7a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261781
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-09-29 19:08:27 +00:00
Nate Biggs 0ec921e8c3 [dart2js] Fix node tracer migration
Change-Id: Id49719ca21471370e9428224a231d285d3c84551
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261560
Commit-Queue: Nate Biggs <natebiggs@google.com>
Auto-Submit: Nate Biggs <natebiggs@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-09-28 00:46:35 +00:00
Nate Biggs 8939d1e0f0 [dart2js] Migrate iterable tracers in inferrer.
Change-Id: I0a9eba5a65cb6dd1b8db5aef53c3a2caed9530b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260803
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-09-27 19:19:25 +00:00
Nate Biggs d6d33e61c9 [dart2js] Migrate closure_tracer.dart
Change-Id: Ic12ac824427cbddb1609f5c7b1e642621b39f82e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260802
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-09-27 04:29:18 +00:00
Stephen Adams 1af4a6a835 [dart2js] Migrate js_backend/specialized_checks.dart
Also prepare some ssa/ files by importing world_iterfaces.dart

Change-Id: Ifa1c61d27a32619baec60ab7835f66e36dee3bf5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261283
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-09-27 02:27:48 +00:00
Nate Biggs 94507d6502 [dart2js] Migrate node_tracer.dart
Change-Id: I2b0f7ad80477da638ed70fdfd0d0a20acdbc097c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260801
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-09-24 00:24:00 +00:00
Nate Biggs c0b449667a [dart2js] Migrate other abstract value domains
Change-Id: I7ede2113f8520ade4713f2bd64266a6090060255
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260800
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-09-24 00:24:00 +00:00
Sigmund Cherem 8bff8336a4 [dart2js] migrate source_file_provider
This reapplies f740b500e2

The change is not that different from the original, except that a
few changes have landed in between to address the failure
encountered by the SDK roll last time. Namely, the map lookup on
`resolvedUri` is normalized, so that the lookup will always match
how the store operation is done, and hence will succeed when copying
cache entries between resolvedUri and uri (see also
https://dart-review.googlesource.com/c/sdk/+/250440).


Change-Id: Ic3ad778a3e9ea465b515de9800f296c71683970c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260081
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-09-23 01:41:18 +00:00
Sigmund Cherem 2f1a6c9993 [dart2js] migrate js_backend/field_analysis.dart
Change-Id: Id554181edeca0e144e49ab747f764193a23a96cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260303
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-09-23 00:28:58 +00:00
Sigmund Cherem 2511f38bb1 [dart2js] migrate phase/modular_analysis.dart
Change-Id: I788e3952352fdd8c8d6bdce14ac57c437e583f2c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260302
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-09-23 00:28:58 +00:00
Sigmund Cherem 5fbd406929 [dart2js] migrate kernel/native_basic_data.dart and kernel/no_such_method_resolver.dart
Change-Id: Idb789679871b0702b02cfc840456702708970f6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260301
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-09-23 00:28:58 +00:00
Sigmund Cherem 9d8ea01862 [dart2js] migrate ir/modular.dart
Change-Id: Ica0332ccd9aebfa32ded6a4c17dd49f9573633b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260300
Reviewed-by: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-09-23 00:28:58 +00:00
Sigmund Cherem bba48857a6 [dart2js] migrate kernel/element_map.dart
Change-Id: I64d3cfa518ec4226c8008c3e9cab3d2f631e8934
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260286
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-09-23 00:28:58 +00:00
Sigmund Cherem 8b49851cb8 [dart2js] migrate kernel/element_map_impl to null safety
Change-Id: I34ca5b75240944d39dc88d5031fdac195563b67d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260285
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-09-23 00:28:58 +00:00
Sigmund Cherem 01f3d27c1e [dart2js] prepare element_map_impl for migration
Change-Id: I7faec717a427638fc04194fac2c0c63f21f1d07c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260284
Reviewed-by: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-09-23 00:28:58 +00:00
Sigmund Cherem 0ee953d7c2 [dart2js] migrate kernel/env.dart to null safety
Change-Id: I0913b133a39f72d29b5332ae38ad7a7a5dba48af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260078
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-09-23 00:28:58 +00:00
Nate Biggs 182742a61c [dart2js] Migrate masks.dart (and associated part files) to null safety
The changes between inferrer/ and inferrer_experimental/ are identical. The changes were made in one and then the files were re-copied into the other.

Change-Id: I2bb9d54ee39e8b9acba55e5e4c83392e5ab59586
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260320
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-09-22 00:29:47 +00:00
Nate Biggs 48b2cb6ea2 [dart2js] Prep for masks.dart null safety migration.
The changes between inferrer/ and inferrer_experimental/ are identical. The changes were made in one and then the files were re-copied into the other.

Change-Id: I5efd388913a2bdab9d6da028c0b753ba7264f3c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260246
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-09-21 23:37:46 +00:00
Nate Biggs 76169b54a8 [dart2js] Migrate interceptor_data.dart to null safety.
Change-Id: I0c3f767cad1ae372d116a13b408affb967a56f2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260245
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Auto-Submit: Nate Biggs <natebiggs@google.com>
2022-09-21 19:56:01 +00:00
Nate Biggs 3a7e7430dc [dart2js] Prep interceptor_data.dart for migration.
Change-Id: If3db12dd0fb02c09906503150525d2381c65f2ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260244
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Auto-Submit: Nate Biggs <natebiggs@google.com>
2022-09-21 19:56:01 +00:00
Sigmund Cherem 3add88c955 [dart2js] cleanup element_map_impl
Small follow up cleanup in element_map_impl addressing comments from the
previous code review.

Change-Id: I1eea8bba35575b953de4686351e60f0cbf353d84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260066
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-09-20 20:09:05 +00:00
Sigmund Cherem 755f124fcd [dart2js] prepare to migrate kernel/env.dart
This makes kernel/env.dart fully ready for migration.

Change-Id: I1baa5bc7280236e5e2dfdfb060525752eb68c2d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260067
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-09-20 20:08:37 +00:00
Nate Biggs a263aeee33 [dart2js] Add methods to closed world for call graph generation.
Change-Id: I22240a93e785eea0505d3594fbc41306890e24ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260241
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-09-20 19:54:35 +00:00
Nate Biggs e96a0f6c98 [dart2js] Use experimental type strategy from compiler based on flag.
Change-Id: I3b79750691792f8f4cc7a8c09d2d4cc9b142f074
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260240
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-09-20 19:54:35 +00:00
Sigmund Cherem 7d46dac715 [dart2js] improve nullsafe API for a few _find* methods
A few private methods in common/elements.dart are used to lookup classes
and members. This is a step in normalizing these methods, so that we use
different APIs when the values are required and when they are not.

Ideally this is a change we'd do more generally in our APIs (e.g. the env APIs
should be split).


Change-Id: Iacc2f012f6f60ae960c61d8897630f6a7f1d60e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260080
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-09-20 16:34:45 +00:00
Sigmund Cherem 026f253075 [dart2js] migreate js_model/element_map_impl
Change-Id: Ie490c4b592a9caa155d22eefe24af1a2816414df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259640
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-09-20 04:14:52 +00:00
Nate Biggs 27f4d280b7 [dart2js] Rename inferrerExperimental to inferrer_experimental
Change-Id: Ia951e055c4ecd30843a76aa7a84dde091c2fc73d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259940
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-09-19 18:19:11 +00:00
Srujan Gaddam 8a081b95c6 [pkg:js] Add type/conformance checking for createStaticInteropMock
Bug: https://github.com/dart-lang/sdk/issues/49351

Adds checks for the following cases:
- Type arguments to createStaticInteropMock are correct
- No missing members in implementing class
- Inherited and non-overridden @staticInterop members are implemented
- Dart class can implement through inheritance and mixins
- Implemented members are correct subtypes of @staticInterop members
- Potential extension member conflicts that are attempted to be
resolved through subtyping rules

Change-Id: Iacbe5846040ba7fab41459aa19be77351cf1efca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255761
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Riley Porter <rileyporter@google.com>
2022-09-16 20:13:30 +00:00
Ahmed Ashour 5fe480b788 Fix typos
Fix #49864

TEST=ci

Change-Id: I9a7e06d604cd0b4f56f2ac229ab3fc9f01cb9d76
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256824
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-09-16 19:35:00 +00:00
Nate Biggs 433c9eb4ee [dart2js] Add member applies to sets and builder.
Will be used during call hierarchy analysis in combination with explicit call graph construction.

Currently typemasks do not support the `difference` operation and so we cannot fully narrow the type cones based on the call hierarchy. An implementation is included here of the applies-to set with subtraction of overrides.

Change-Id: I3f6c113787a4d26e9751added482791365c12832
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259560
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-09-16 02:54:10 +00:00
Nate Biggs 9a91ff88fe [dart2js] Add experimental inferrer to Dart2JS.
Changes to experimental inferrer include:
- Subtyping the experimental results classes so that they can be passed around in place of the base results classes.
- Leave out 'abstract_value_domain.dart' and 'abstract_value_strategy.dart'. All references to these in the experimental inferrer refer to the version in the base inferrer. These AbstractValue* types leak out of the inferrer and require more significant changes to duplicate. If necessary we can revisit these down the road.

Change-Id: I91ff44336c0471cb64ad4e0d36d727a38caea2fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/259261
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-09-15 20:02:19 +00:00
Mayank Patke 581db69c7a [dart2js] Avoid adding empty type rules.
The fragment emitter already tries to skip the call to `addRules` if the
ruleset is empty, but this occurs too early. The ruleset encoder strips
tautologies like `T <: T` and `InterfaceType <: Object`, but this occurs
after the empty check.

This CL removes the preprocessing from the encoder and instead performs
checks when entries are added to the ruleset, fixing the issue.

Change-Id: I62f937e0ff6abac12973f82b2c89d8ea6f3162b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258040
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2022-09-08 19:25:43 +00:00
Sigmund Cherem ed5587dc2d [dart2js] add env_interfaces to prepare for migrating element_impl
Change-Id: Ic6c69a97e1e11a72e96ba1aeef7f6861568b9d52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257481
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-09-06 20:24:36 +00:00
Sigmund Cherem 34ce99b003 [dart2js] prepare to migrate js_model/element_map_impl.dart
Change-Id: I9912ef4abbf9800f34231cc4d4c8b35af63252ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257462
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-09-06 20:24:36 +00:00
Sigmund Cherem 42d3625e70 [dart2js] Migrate jsmodel/element_map.dart
Change-Id: I577ccf256704412d1da26a9233b29e2771e4709d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257461
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-09-06 20:24:36 +00:00
Sigmund Cherem eee6efc1f8 [dart2js] migrate closure.dart
Likely we can merge back closure_migrated into closure, but I'll keep them
separate to make the review process simpler.

Change-Id: I505a5b758f866fb9280a3453e57818be09ce8150
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/257163
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-09-01 19:21:52 +00:00
Johnni Winther 02c47b6de0 [cfe] Support const records
Change-Id: I3c0724e18a405ec0fe2d3a60e2722d78f9e3bed6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256666
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-08-31 21:47:01 +00:00
Sigmund Cherem 7393f9f9d6 [dart2js] migrate env.dart to null safety
There is a cycle between env and closure, so this also pulls out a subset
of closure to closure_migrated.dart

Change-Id: I7350c6a6efcb58c8343d93da93712e387925ca15
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256967
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-08-31 21:35:59 +00:00
Kevin Moore 460075336b pkg:compiler - enable and fix use_super_parameters lint
Change-Id: I2d8ae1db222fc70729fda9eeb62296285de9da33
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256760
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-08-29 22:56:27 +00:00
Kevin Moore 677cb7fb3e Eliminate more dynamic invocations in pkg/compiler
Change-Id: Ic1d3b118ccb80ea41197c464348f98f962b1ae67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256741
Auto-Submit: Kevin Moore <kevmoo@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2022-08-29 22:51:46 +00:00
Chloe Stefantsova ddff459c7f [cfe] Add RecordType, RecordLiteral, and associated nodes
TEST=Covered by upcoming language and co19 tests.

Change-Id: Ibe8ecfb7f854adce5646125f6909066e27424665
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256066
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2022-08-25 10:33:35 +00:00
Lasse R.H. Nielsen 8a883fa54d Change : to = for default values in pkg.
Leaves some in parser test:
 pkg/front_end/parser_testcases/error_recovery/keyword_named_formal_parameter_prime.dart

TEST=Refactoring, covered by existing tests.

Change-Id: I7a83ef95df3cbd283878b3685b5c747bd89a1b16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/256125
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2022-08-24 15:57:16 +00:00
Srujan Gaddam 9f10a3bc16 [pkg:js] Add JsInteropChecks to Wasm backend
Also cleans up and unifies some behavior across the backends:

- avoiding reinstantiating JsInteropChecks for every library
- having the native classes as a member instead of recomputing on dart2js

Now that these checks exist, we can add lib/js/static_interop_test to
the test directories the wasm trybot runs.

Change-Id: I912aae988afe7915e80cc13d00b8c47818dfa520
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255760
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2022-08-19 17:48:38 +00:00
Nate Biggs 876fb36c82 [dart2js] Apply correct readers and lookups for deserializing cached entities.
Since we are reading data in the context of a different reader, we should make sure that we use that reader's helpers.

Change-Id: Id7fbf3662104d131c1b31bff080a171bd3d38a88
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255800
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-08-19 16:55:06 +00:00
Nate Biggs 4b78f1b6c7 Reland "[dart2js] Enable flag (canary -> shipping) to intern dart type values."
This reverts commit 0e1d24ae80.

Reason for revert: Interning bug fixed by https://dart-review.googlesource.com/c/sdk/+/255257

Original change's description:
> Revert "[dart2js] Enable flag (canary -> shipping) to intern dart type values."
>
> This reverts commit e833510bc5.
>
> Reason for revert: breaks many tests in G3, see b/242822389
>
> Original change's description:
> > [dart2js] Enable flag (canary -> shipping) to intern dart type values.
> >
> > Change-Id: Iebac3a7c57665eccd100146f892b891a4591f554
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255201
> > Reviewed-by: Stephen Adams <sra@google.com>
> > Commit-Queue: Stephen Adams <sra@google.com>
>
> TBR=sra@google.com,natebiggs@google.com
>
> Change-Id: I9b2be8fc119f84f33181245cdfce416d13660daf
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255401
> Reviewed-by: Ilya Yanok <yanok@google.com>
> Reviewed-by: Alexander Thomas <athom@google.com>
> Commit-Queue: Ilya Yanok <yanok@google.com>

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I51336c2e53dd58fed6216e9a5c818f05e8795a8f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255663
Reviewed-by: Nate Biggs <natebiggs@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-08-18 21:30:54 +00:00
Nate Biggs 61d7200840 [dart2js] Add == override to Dart2JS ir.InterfaceType subclasses.
These subtypes were previously colliding with instances of the base ir.InterfaceType class in the interner map.

Change-Id: Iec6b53fa82e0994142c408a0a2be1ddd045898e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255257
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2022-08-18 20:12:44 +00:00
Nate Biggs 7ddee84e78 [dart2js] Update SSA/Codegen inlining metrics.
Add several more inlining metrics to SSA:
- getters (ellisions vs. inlines)
- setters (ellisions vs. inlines)
- intercepted length calls
- if conditions
- is checks
- late sentinel checks

After digging these are all the opportunities for optimization that I saw that I thought might be affected by changes in global inference. Open to feedback on whether any of these are unnecessary or if there's any other things worth tracking.

Change-Id: I70ff279a797f71b39b2bc02c00fbb3f6e149cb2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255202
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-08-18 19:23:54 +00:00
Chloe Stefantsova 1611fe6f45 [cfe] Separate out IntersectionType from TypeParameterType
TEST=Covered by existing tests

Change-Id: Ie7b99b1c109edff5198cfbf5d22e1cfb1dc130d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253665
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2022-08-18 08:47:29 +00:00
Nate Biggs 8f5983b3c3 Revert "[dart2js] Defer deserialized CodegenResults by members."
This reverts commit a547cfc096.

Reason for revert: With 15 shards this ends up holding too much serialized data and causes an increase in memory usage.

Original change's description:
> [dart2js] Defer deserialized CodegenResults by members.
>
> For large applications only ~60% of these objects are used. This defers their deserializtion until they're accessed in the codegen member map.
>
> In local testing on large applications this saved ~200MB of memory usage in the linker phase.
>
> Change-Id: I8ff87803fc23ef2d3f954646687e3fc67b68a4f7
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254600
> Commit-Queue: Nate Biggs <natebiggs@google.com>
> Reviewed-by: Joshua Litt <joshualitt@google.com>

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I51d292531be30b358a025d7c472f25e8aba4dc3c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255283
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-08-18 01:28:53 +00:00
Ilya Yanok 0e1d24ae80 Revert "[dart2js] Enable flag (canary -> shipping) to intern dart type values."
This reverts commit e833510bc5.

Reason for revert: breaks many tests in G3, see b/242822389

Original change's description:
> [dart2js] Enable flag (canary -> shipping) to intern dart type values.
>
> Change-Id: Iebac3a7c57665eccd100146f892b891a4591f554
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255201
> Reviewed-by: Stephen Adams <sra@google.com>
> Commit-Queue: Stephen Adams <sra@google.com>

TBR=sra@google.com,natebiggs@google.com

Change-Id: I9b2be8fc119f84f33181245cdfce416d13660daf
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255401
Reviewed-by: Ilya Yanok <yanok@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ilya Yanok <yanok@google.com>
2022-08-17 12:29:03 +00:00
Nate Biggs e833510bc5 [dart2js] Enable flag (canary -> shipping) to intern dart type values.
Change-Id: Iebac3a7c57665eccd100146f892b891a4591f554
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255201
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-08-17 02:50:42 +00:00
Nate Biggs 094ba2cdb3 [dart2js] Add inline measurement via new SsaMetrics.
Measures inlines (and skipped opportunities) during SSA and records them within the metric framework.

This can hopefully be used as a signal into the effectiveness of changes to the global analysis phase.

Change-Id: I9da5bad5792db8b089dbfc8725664ec13d32ab1b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255200
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-08-16 21:18:03 +00:00
Nate Biggs 7f00006975 Handle nullable metrics on compiler tasks.
Some tasks have nullable metrics (e.g. https://github.com/dart-lang/sdk/blob/main/pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart#L61) and so we should just skip processing those tasks.

Change-Id: Ie1f4e1042ef4b5d4a95a76085c37da088e885369
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255160
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-08-16 20:26:52 +00:00
Nate Biggs 4d5ac43514 [dart2js] Change default values for dependencies in js_backend/runtime_type_resolution.dart
Default value of `dependencies` should be `const {}` (and narrow field type) so that VM can devirtualize calls to the `_CompactLinkedHashSet` when iterating.

Change-Id: I112d9cd9a3cd060a38e292bc1a3c54a8a2847dfe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252301
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-08-16 15:54:48 +00:00
Sigmund Cherem fead8b897e [dart2js] remove support for reading sources from http (tech-debt)
Long ago the compiler had logic for reading sources via an http
connection. This is not a supported use case and there is no need to
keep this around anymore.

Change-Id: Ic59c154def264a52d9310133f76b153c9972899c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251701
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-08-16 00:01:26 +00:00
Nate Biggs a547cfc096 [dart2js] Defer deserialized CodegenResults by members.
For large applications only ~60% of these objects are used. This defers their deserializtion until they're accessed in the codegen member map.

In local testing on large applications this saved ~200MB of memory usage in the linker phase.

Change-Id: I8ff87803fc23ef2d3f954646687e3fc67b68a4f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254600
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-08-15 16:13:46 +00:00
Johnni Winther 50ac2500a1 [dart2js] Handle private names correctly in K/J-model
The library wasn't taken into account when handling computing class
members in the K/J-model and not handled correctly when computing
applicable selectors. This made dart2js unable to handle members with
a name private to a different library than the enclosing library.

Fixes #33732
Fixes #49226

Change-Id: I5ba143d87662bbd42e0ff02355054e4a937be8f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252665
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2022-08-11 06:56:32 +00:00
Stephen Adams 5e267854e1 [dart2js] Disentangle instance field setter and static field initializer
A FieldEntity is used as the entity for generating the setter of an
instance field (when a check is required), and as the entity for the
initializer expression for a static or top-level field.

I think it is a bit clearer to have a separate method for each case
rather than one method with conditional paths.

Change-Id: I32e63c3f3566a63e3d38315cab17d613f006405e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253562
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-08-03 17:06:28 +00:00
Mayank Patke e9ee4621cb [dart2js] Update async compiler invocation.
Addresses comments in
https://dart-review.googlesource.com/c/sdk/+/252843.

Change-Id: I4014f9b6a9f33f8e2e93404d5265a7c4b860d6d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253341
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-08-01 22:13:04 +00:00
Srujan Gaddam 61abaeda3f [CFE/web] Move static interop erasure and remove outline stubber
Deletes the outline stubber as it's not necessary on any backend.
DDC should compile the entire sources and outline dill in one step.
dart2wasm operates similarly, and so only needs the modular transformer.
dart2js moves the erasure to a global transform.

Also, this CL reverts now unnecessary plumbing that was needed for the
outline stubber.

Change-Id: Ic085c4fad5a6bdfc7d6916f7fa575c6ef9b20110
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253000
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2022-08-01 18:17:44 +00:00
Stephen Adams 4abf0e494b [dart2js] Fix #49502
Fields in mixin applications are copies of the fields from the
mixed-in class. As such, they don't need a getter or setter in the
mixin application.

Change-Id: I62a5779355e4ec57ad4b138bc17a29e42e903f79
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253021
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-07-29 22:16:52 +00:00
Sigmund Cherem 6407b674e3 [dart2js] Steps to prepare js_model/env.dart for migration
env.dart and closure.dart have a circular dependency that is a bit
hard to break, but this is a step towards starting migrating them.
It may be worth migrating the cycle of env and closure together
in one go.

That said, the definitions moved from closure.dart to
element_map_migrated.dart (e.g. ClassDefinition) seem to match
other definitions already in the latter file
(e.g. MemberDefinition)

Change-Id: Ifa8114b992e75ec6662db702fa1dd51b31112276
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252964
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-07-29 01:34:51 +00:00
Sigmund Cherem b7581c00ce [dart2js] Migrate kernel_impact.dart to null safety
Change-Id: I26e35b22035d22dcc8b46432af1dc8f45f185dc6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252963
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-07-29 01:12:55 +00:00
Sigmund Cherem 10ed38fa3b [dart2js] Migrate abstract value strategy to null safety
Change-Id: Iae8a77663b3e87f7d05f7faa0c85bb8cf3bdfc9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253003
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-07-29 01:04:52 +00:00
Stephen Adams dc5dbbae4c [dart2js] test for #49502
Change-Id: I2f33db918476271e77befcc3466271da80ad9504
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252868
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-07-28 04:18:40 +00:00
Mayank Patke 1015134a83 [dart2js] Fix metrics reporting.
Because the compilation wasn't `await`ed properly, metrics reporting was
failing immediately rather than first waiting for the compilation to
occur. This fixes the issue and uses the `async`/`await` API instead of
`Future` methods, which should be easier to follow.

Change-Id: I2438a2de333a91c6918e5a286342448ff11f6823
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252843
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2022-07-27 22:19:10 +00:00
Anis Alibegić 40e18905f2 Fixed various typos in a lot of files
Closes https://github.com/dart-lang/sdk/pull/49478

TEST=Manual

GitOrigin-RevId: f4c9c6869dfe73639295e86574a021523b3d374d
Change-Id: I134a97caed4eec59d70e9cbca16b7e9a472cf2c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251902
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Kevin Chisholm <kevinjchisholm@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2022-07-25 12:21:59 +00:00
Stephen Adams f503281917 [dart2js] Document some dart2js @pragma annotations
Also add `never-inline` and `prefer-inline` aliases.

Change-Id: If5d932e3b86b78b2177abac79ac6c49fb9b8ed6f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252500
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-07-22 19:45:07 +00:00
Mayank Patke 92bd9a4604 [dart2js] Clean up inferrer support for indirect dynamic calls.
Change-Id: Ibc2a84e959886b02024847d315a4cbc83885b79a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252407
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-07-22 19:29:47 +00:00
Sigmund Cherem 27a8e17f52 [dart2js] Migrate world builder
Change-Id: I365fec81299e6fe1ee7217f307ff41934fd75067
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252414
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-07-22 17:58:56 +00:00
Sigmund Cherem ec51bf0a9a [dart2js] migrate powerset_bits.dart
Change-Id: I7abd6781a657ea2564ba08e3b7d4e8274ae3939b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252413
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-07-22 17:58:56 +00:00
Sigmund Cherem 13a6684fe3 [dart2js] Migrate js_backend/codegen_listener.dart
Change-Id: I5cfa5c01c2ca46a8f58270ad9376ce3b8f756c1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252412
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-07-22 17:58:56 +00:00
Sigmund Cherem 943ddf4728 [dart2js] migrate native/enqueue to nullsafety
Change-Id: I26f6b262e298f69189844dd33736c65dd344d279
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252406
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-07-22 00:11:36 +00:00