Commit Graph

5548 Commits

Author SHA1 Message Date
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