Commit graph

5267 commits

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