Commit graph

5361 commits

Author SHA1 Message Date
Sigmund Cherem 710c0b3695 [dartj2s] (tech-debt) better error locations for sources from dill files.
This change addresses a technical debt issue in dart2js, where
errors sometimes get reported as a binary offset location, instead
of a line/column position with contextual data from the source file.

The reason for this behavior is that dartj2s reports binary offsets
when it can't recover line/column data and show the contents of the
file. This typically happens if the file cannot be read directly
from disk.

The fix consits of adding an API to record the contents of files
that are not read directly by the compiler. We then use this API to
provide all sources collected by the CFE when parsing components
from .dill files.

Note: this CL also deletes the `autoread` feature in
source-file-provider. That feature was added for the same purpose.
The way it worked was that instead of registering source content, it
tried to read the sources from disk on-demand as errors got
reported. This doesn't always work for three reasons:

* First, we often use custom schemes (like the multi-root scheme) in
  dill files to make the .dill deterministic in distributed build
  systems, the autoload feature had no understanding of how to
  translate those custom URIs to file URIs (that translation is only
  define at the time the .dill is being built).

* Second, sometimes the files are simply not available, for example,
  in hermetic build systems like bazel we have no access to those
  files.

* Third, when files were found, there was no guarantee that the
  contents were consistent. That is, the current version of the file
  on disk could have been modified and have different contents than
  those used when the .dill file was built.

I tested this manually by adding a crash in SSA and observing the
location in multiple scenarios, including running from source,
running from a .dill with file URIs, running from a .dill with
multi-root URIs, crashing in SDK locations in regular files and
patch files.

Change-Id: Ief09be577f4c9c4b345b4e2641918cafbe93c3fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251700
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-07-19 17:10:06 +00:00
Mark Zhou 0ee0fba728 [dart2js] Adding supertype hierarchy to dump info
Note: this info is not added to the proto format

Change-Id: Ic7407405dea7bcd7b9d3328cfe0850609dc007a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250785
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2022-07-19 00:55:53 +00:00
Nate Biggs 386ad2ff46 [dart2js] Unland deferredSerialization flag
Change-Id: Id04cab15d8e81df9661390b1d4cc48d2767abded
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251243
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-07-14 01:00:43 +00:00
Stephen Adams a886326767 [dart2js] Don't store collection of methods with no side-effects
The annotation data is queried on demand rather than being precomputed.

Methods that don't throw are computed after computing side-effects.


Change-Id: I4e31f0b7df668d41a15dcafee0c84fc7249e0699
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251340
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-07-13 21:12:53 +00:00
Stephen Adams 7a33665af5 [dart2js] Don't store collection of noInline/tryInline methods
Not storing a collection of methods is a step towards processing
annotations more 'online'.

Change-Id: I378ec4db9526004a1f1dc56886bbc91a7acde7f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251322
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-07-12 21:45:42 +00:00
Nate Biggs bf996eb769 [dart2js] Migrate js_backend/enqueuer.dart
Change-Id: I8949e6a3ca083f33f55ceb2cf37bf09c5d69450d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251124
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-07-12 20:17:42 +00:00
Ahmed Ashour 99f0fb5b70 Fix typos
Fixes #49364

TEST=ci

Change-Id: Ic643819c9cdd7b56690981b96b854b1e8d622fff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250160
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-07-12 19:35:22 +00:00
Mark Zhou 91a9774010 [dart2js] Loading kernel component for kernel dump info
This is required for apps that use split-phase compilation

Change-Id: I8ea20dd610781064af95d2ac3c7c612db3dd7e5a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250948
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-07-12 18:43:43 +00:00
Nate Biggs 7fd20c724d [dart2js] Add blocked info to null safety candidates tool.
Calculates and prints the number of files blocked by each unmigrated file. Adds he option for a flag to sort by number of blocking files.

Change-Id: I565f565d2d68e6d630bb2c9bb6d7fc46b016e365
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251180
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-07-12 18:39:02 +00:00
Nate Biggs 0d68f53b18 [dart2js] Migrate resolution/enqueuer.dart
Change-Id: Id5e2b026e284bf27189397a2f6aedef1ac2911b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251125
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-07-12 17:34:52 +00:00
Mark Zhou 635a3bf00f [dart2js] Adding total program RAM usage to dump info's output
See: #49160

This doesn't offer a phase-specific view of the ram usage nor aggregate ram usage across split phase compilation.

Change-Id: Ia1f781f9bd35b40048ac23fe103b8fee3b4da584
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250947
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2022-07-12 00:53:41 +00:00
Nate Biggs 15ad24978c [dart2js] Migrate 2 ready to migrate files to nnbd.
Change-Id: I281c7bb8cfea56a81e71817007e7acdc98d5ac12
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251123
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-07-11 22:21:16 +00:00
Alexander Markov 3a1229e56c [kernel] Remove obsolete AsyncMarker.SyncYielding and YieldStatement.isNative
AsyncMarker.SyncYielding and YieldStatement.isNative became
obsolete after async/async*/sync* kernel transformation was removed in
https://dart-review.googlesource.com/c/sdk/+/249944.

TEST=ci

Issue: https://github.com/dart-lang/sdk/issues/48378
Change-Id: I69ac994af77f7e403686750bf8df437868bf33fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249947
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2022-07-11 18:20:45 +00:00
Nate Biggs d5abb2a301 [dart2js] Migrate locals_handler type_graph_node and type_system to nnbd
Change-Id: I77f66764943bcdf204744da6bcc1932381895c5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249964
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-07-11 18:02:41 +00:00
Sigmund Cherem fb23707955 [dart2js] update cache using absolute resolved URI
This is very similar as the change Ivan sent in
https://dart-review.googlesource.com/c/sdk/+/250081, except that we additionally
skip updating the cache unnecessarily.

This should allow relanding the change that migrates this library.

Change-Id: I37684e66abe43446f4a5e8b3ed41d6573d93a3ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250440
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-07-11 17:20:21 +00:00
Nate Biggs 0837917d89 [dart2js] Prep for local_handlers.dart, type_system.dart, type_graph_nodes.dart migration
Change-Id: Iadaac53aa1eb94aa1cfd614210741c6a5f8dfd27
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249963
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-07-11 15:51:51 +00:00
Nate Biggs fffe5ce6ec [dart2js] Promote variables after as statements.
Resolves issue where some programs could not be compiled with dart2js and --enabled-asserts flag. The following assert was failing:
https://github.com/dart-lang/sdk/blob/main/pkg/compiler/lib/src/ir/static_type.dart#L987

This assert checks that the promoted static type that Dart2JS calculates for variables is a subtype of the promoted type calculated by the CFE. This was not true in some cases.

The cause of this discrepancy was that `as` expressions were not properly promoting casted variables. For example:


int func() {
  dynamic x = 3.0;
  x as double;
  return x.asInt();
}


The cast on the second line of the function should promote the type of `x` through the rest of the function and `asInt()` should not be a dynamic invocation.

Change-Id: Iea2508627fb6b3f0cdde785624a00aa2d22d75de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250860
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-07-09 01:58:49 +00:00
Nate Biggs 9832e68fef [dart2js] Migrate inferred_data.dart to nnbd
Change-Id: I865ab785cff8ab397b4bbc78ad1f4a053dbf68c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249962
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-07-09 01:40:49 +00:00
Nate Biggs a068993f56 [dart2js] Migrate native_data.dart
Change-Id: I63a0243c75f0d358e495fd0a753cb2447b75acac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249961
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-07-09 00:18:39 +00:00
Nate Biggs 397c8d26dd [dart2js] Enable deferred-serialization flag by default.
Change-Id: I7f462a6a944abbf9eea4381ff72f9ebdf74fae61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250201
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-07-07 20:38:13 +00:00
Nate Biggs 709c4202b5 [dart2js] Global inference should merge breaks after each case statement
The type bounds in each case statement can diverge when a break is hit in a conditional control flow block. Previously the switch statement was just merging the end state after visiting each case block. Instead we need to merge all possible termination states for each case.

This is trivial when the switch only contains breaks. The termination states are just those when we reach each break (or the end of the switch if there's a default).

When there are switch-continue statements we must reconcile the states that flow into each targeted switch before reconciling the types of those targeted switches themselves. We achieve that by making two passes over the cases, the first to gather the continue states and the second to update the switches affected by those states. Similar to before this is done repeatedly until a fixed point is reached.

Fixed: 46770
Change-Id: I5795748a4591e6a1dc283f2a54129e09a20d13d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250200
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-07-07 15:38:51 +00:00
Sigmund Cherem 245f7a003c [dart2js] Add a couple scripts to aid our migration.
These are simple scripts to count progress and find migration candidates.

Change-Id: I872d85891001349dadbcf1d67e64ab5aa993d2a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250146
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-07-02 04:25:21 +00:00
Mark Zhou b40969ea57 [dart2js] Adding function kind info to closure call methods
Change-Id: Ibb78a41c8e414c909999591c8d667a7697af32ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250147
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-07-01 00:30:46 +00:00
Nate Biggs c084ebb430 [dart2js] Prepare native_data.dart for nnbd migration
Change-Id: I9179dd5ac7feb6790c7d0fe3e3aab7213d489424
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249960
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2022-06-30 23:11:03 +00:00
Nate Biggs 837bb22581 [dart2js] Fix unordered index for codegen sharded mode
Index cache maps should be copied instead of used directly. And the set of indices (DataSourceIndices.caches) needs to be copied as well since we alter it when reading each shard.

Change-Id: If7a640ead07a54e3cb6003eee89c44db8f449812
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250202
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-06-30 17:16:26 +00:00
Mark Zhou bb75cf4519 [dart2js] Adding formal kernel dump info tests
Change-Id: I2e0f7c8cb5943b2de5d09f3a310c8485b108797d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250113
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2022-06-29 20:39:55 +00:00
Sigmund Cherem 8a0289eec9 [dart2js] migrate import_set.dart
Change-Id: Ie582bf62803e31b952e110f2c6160d2237bb9d10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249952
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2022-06-29 17:23:25 +00:00
Mark Zhou 515d8741e3 [dart2js] Moving entity map to kernel dump info annotator
Change-Id: I1aa5167759e1cdb1bdfbea76062df8fcafb8a67a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250022
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2022-06-28 21:37:06 +00:00
Mark Zhou ee21de85f1 [dart2js] Fixing info resolution paths in kernel dump info
Includes skipping duplicated installation code.
For more info, see #49348

Change-Id: I34833df32156d9fe090b579b665dd9cb93860f8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250020
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-06-28 21:37:03 +00:00
Srujan Gaddam b372fd4c52 [CFE/pkg:js] Find reference of stub if it already exists
Fixes #49301

From https://github.com/dart-lang/sdk/issues/49301#issuecomment-1165536192

Adds referenceFromIndex to outline transformations so that the eraser
can use it to find the reference for the stub if it was already created.
This is needed when the module where the stub exists is invalidated.
Since references in other modules should still be valid, we should
attempt to get that reference.

Change-Id: I5905a002480444aecd57de650cd439bdc34d4eba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249729
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-06-28 18:36:02 +00:00
Stephen Adams f740b500e2 Revert "[dart2js] Migrate source_file_provider.dart"
This reverts commit c9ff7d95fd.

Reason for revert: Test failure in google3

Original change's description:
> [dart2js] Migrate source_file_provider.dart
>
> Change-Id: Iaded7ebfe4415f8108c9364521939b8394ab598a
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249780
> Reviewed-by: Nate Biggs <natebiggs@google.com>
> Commit-Queue: Stephen Adams <sra@google.com>

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

Change-Id: I23d7ae645b871ed7cca00e49288eb9e2c3f4fce7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250105
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2022-06-28 18:00:53 +00:00
Nate Biggs e87c84ff69 [dart2js] Migrate serialization.dart to nnbd and remove temp migration files.
Change-Id: I109c219fa0cc989ac1f3eea6b5d6de0b0cbb7d22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249746
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-06-28 03:41:12 +00:00
Nate Biggs 1e7cb2f449 [dart2js] Migrate js_model/locals.dart to nnbd.
Change-Id: I76b137b68f10f2bb043df8e1d37455925a3bf536
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249745
Reviewed-by: Stephen Adams <sra@google.com>
2022-06-28 03:41:12 +00:00
Nate Biggs ca26ed23dc [dart2js] Prepare for locals.dart migration
`element_map_interfaces.dart` contains temporary interfaces that exist for the duration of the nnbd migration.

`element_map_migrated.dart` contains 'real' code from `element_map.dart` that has been migrated. This will get re-combined with the `element_map.dart` once it is all migrated.

Change-Id: I55cc414de471adbe2d63c0e226558d5b4773d409
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249744
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-06-27 21:43:52 +00:00
Nate Biggs 2edfa30d02 [dart2js] Migrate js_model/elements.dart and parts of js_model/closure.dart.
Change-Id: I50c950bbaeba720a16327eb6f82ceabe4c8d9e0f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249743
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2022-06-27 21:19:43 +00:00
Stephen Adams a1535a893a [dart2js] Migrate ir/impact{,_data}.dart
Change-Id: I84b844d279eb7fd5daff7242cdf686ba27220af5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249732
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-06-27 20:44:32 +00:00
Stephen Adams c9ff7d95fd [dart2js] Migrate source_file_provider.dart
Change-Id: Iaded7ebfe4415f8108c9364521939b8394ab598a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249780
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-06-27 20:38:25 +00:00
Nate Biggs 97ad0fbf30 [dart2js] Move more serialization logic into nnbd.
At this point the only imports of the pre-nnbd DataSourceReader and DataSinkWriter are files that need to instantiate the class. Other references have been migrated.

Change-Id: I79672fc5f8c681d05a183990e184535f1becc0e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249742
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-06-27 17:01:32 +00:00
Stephen Adams aa43ca02ec [dart2js] Annotations for late fields
Change-Id: I46ed386a1db6d79de9f9c9f15b9ac06f7f398956
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248708
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-06-27 06:34:01 +00:00
Stephen Adams 4c8a50109d [dart2js] Change return type of failedAt to Never
This allows `e!` to be replaced by `e ?? failedAt(...)` where a more descriptive internal error is desired.

`failedAt` used to return `bool` so that you could write

    assert(condition || failedAt(...));

We have had assertions with messages for a long time, so that was changed to

    assert(condition, failedAt(...));

This still works with the type `Never`.

Change-Id: I132665d898a6aefe1fcf73235e88c156bab1e21e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249730
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-06-24 22:58:59 +00:00
Stephen Adams 69ef56cffa [dart2js] Migrate universe/class_hierarchy.dart
Change-Id: I0bd5ab3c021e9c1e6087fb3b651696a9888d8078
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249700
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-06-24 21:35:00 +00:00
Nate Biggs 7628eefbd3 [dart2js] Move imports of 'serialization.dart' to use 'serialization_interfaces.dart' instead.
Change-Id: I556fe4962f0a414f7dcee2dd1650c9c626468fde
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249741
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-06-24 20:45:40 +00:00
Johnni Winther e18977ed9c [cfe] Report error for missing concrete super target
In response to https://github.com/dart-lang/sdk/issues/47406

The error is currently not reported if the mixin declaration is from
an outline dill.

Change-Id: I94a61d6409d0c238614d9f377b5f324153360bc6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249184
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-06-24 14:04:49 +00:00
Jens Johansen b4e2012f5b [CFE] Remove support for .packages file
This CL:
* Removed the redirect from .packages to .dart_tool/package_config.json
  (whenever such a file existed).
* Removes support for the old format entirely.
* Updates all tests etc that were found.

Fixes https://github.com/dart-lang/sdk/issues/48939

TEST=Existing tests updated.

Change-Id: Iccf711c455ac1885189aa773ca74dd8f55012964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248603
Reviewed-by: Michael Thomsen <mit@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2022-06-24 08:20:39 +00:00
Stephen Adams 9cc3b14dfa [dart2js] Prepare to migrate ir/impact_data.dart
Add the required methods to serialization_interfaces.dart

Change-Id: I201461f7a534d02cbfef4d095c670e0c60c40f22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249664
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-06-24 04:39:29 +00:00
Nate Biggs e40fd307ef [dart2js] Allow SpecialMemberDefinition to copy Deferrable from ClosureMemberDefiniton
Codegen deserialization was inadvertantly loading the nodes for many ClosureMemberDefinitions, specifically ones for generators. The node doesn't actually end up being used after this point though so the Deferrable is unnecessarily triggered.

To get around this we have the SpecialMemberDefinition constructor copy the Deferrable out of the ClosureMemberDefinition.

To avoid exposing the deferrable I've moved the ClosureMemberDefinition into the same library as SpecialMemberDefinition.

This brings the number of Kernel AST function bodies being deserialized down to 2 in cm_shell (down from many thousand).

Change-Id: I0781ab490dc1972118cf2ac2359f467916031633
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247283
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-06-24 03:35:38 +00:00
Stephen Adams 5da4b521ea [dart2js] Migrate backend_usage.dart
Also:
- KFieldAnalysis takes an elementMap instead of the whole strategy.
- Fix a missing `?` from a previous migration

Change-Id: I7f8fab61c644d14d1f037603a8539a2db5090d8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249547
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-06-24 01:51:48 +00:00
Johnni Winther 391540c889 [cfe] Make (Abstract)Super*.interfaceTarget non-nullable
This is a step towards improving the semantics of these nodes.

TEST=existing

Change-Id: I95bdb86790414b38af73e9e932cc228b3c0f1f6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249040
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-06-23 09:16:55 +00:00
Nate Biggs 9d3308528b [dart2js] Migrate visitors.dart and types.dart to nnbd.
Change-Id: Ic9f83d1f1fdae13f71ad04d703d5915148395f2d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249520
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-06-22 23:48:27 +00:00
Mayank Patke 757e3b6537 [dart2js] Migrate static_type.dart to null safety.
Change-Id: I4ef2b7c6f971c085400e348af490515c8c3f47f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249461
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-06-22 23:36:15 +00:00