Commit graph

5502 commits

Author SHA1 Message Date
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
Kallen Tu
a5ad599cf0 Reland "Cast errors to HttpExceptions and add lint to convert to tidy up dynamic calls in core libraries."
`catchError` in http_impl also handles SocketExceptions.

Change-Id: I865bdd6bde4272f6cb657a86a1c78734e4ee331c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263183
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2022-10-21 18:28:23 +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
Ahmed Ashour
c8bda70c66 Remove nbsp
Fixes #50202

Change-Id: I67e2f02f49deaf1bd9dc1f32a35310704f4d921b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264120
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2022-10-17 08:18:49 +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
Kallen Tu
446ee14abf Cast sockets that set _owner and read closedReadEventSent of _NativeSocket
Change-Id: I0d3b24f503dcb167dd039e47228a665ca3d38453
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262272
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2022-10-11 13:12:33 +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
Kallen Tu
7e1890d78b Revert "Cast errors to HttpExceptions and add lint to convert to tidy up dynamic calls in core libraries."
This reverts commit 5b7bd563d3.

Reason for revert: Broke VM tests, not always HttpException.

Original change's description:
> Cast errors to HttpExceptions and add lint to convert to tidy up dynamic calls in core libraries.
>
> Change-Id: I7ea73b232d13baf84e834d742ebc16f2a081e727
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262626
> Commit-Queue: Kallen Tu <kallentu@google.com>
> Reviewed-by: Lasse Nielsen <lrn@google.com>
> Reviewed-by: Leaf Petersen <leafp@google.com>

TBR=lrn@google.com,leafp@google.com,kallentu@google.com,dart-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: I1777750c07b84b267d0b62dbfe93d54a6bfee7ae
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263180
Reviewed-by: Leaf Petersen <leafp@google.com>
2022-10-07 20:11:57 +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
Kallen Tu
5b7bd563d3 Cast errors to HttpExceptions and add lint to convert to tidy up dynamic calls in core libraries.
Change-Id: I7ea73b232d13baf84e834d742ebc16f2a081e727
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262626
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2022-10-07 18:12:28 +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
Kallen Tu
b3e57bd2f7 Remove dynamic call in _JsonMap.
Change-Id: I73297a65a59aeefee9f170aa640b9d5d20e7bf9e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/262271
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2022-10-06 18:12:02 +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
Kallen Tu
ce7c036db2 Make _detachRaw an external method of Socket to avoid dynamic calls.
Change-Id: Iba40ba3b0f0defea7efa750688386c7fe21bbae7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261260
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2022-10-05 01:44:22 +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
Kallen Tu
646886c968 Type Socket in _HttpConnection to avoid dynamic invocations.
Change-Id: I55b4312dcf6f2af79f183f21b8d2722f62f0aece
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258515
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2022-09-30 19:29: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
Kallen Tu
80c6f0e824 Clean up dynamic invocations in dart2js core library files.
Change-Id: I3967a13585b2e3c8e0859bef9d08f181f88bf1f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/260450
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2022-09-26 22:26:37 +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