Commit graph

5388 commits

Author SHA1 Message Date
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
Sigmund Cherem 95f7dfdb71 [dart2js] Migrate deferred_load (take 2)
Change-Id: I7c9fdc16231e9c35a23716d87dafcc2b118b2335
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252403
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2022-07-22 00:10:06 +00:00
Nate Biggs e2d926c1b2 [dart2js] Always do codegen in serialization tests.
Change-Id: I3837c7c31c5073212426a1526dab9d2ca7d8cde3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252440
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-07-21 18:51:55 +00:00
Nate Biggs 8b3e9a84e7 Add test for unordered indexing in serialization.
This test catches an issue previously uncaught by tests where offsets for indices were written incorrectly and could therefore lead to errors when deserializingelements in deferred mode.

Change-Id: I14bf80bbe4fa47c12e543679803c7be38582a0e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252300
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2022-07-21 03:59:25 +00:00
Nate Biggs 42af130704 [dart2js] Migrate js_backend/runtime_type_resolution.dart
Change-Id: Ic4d892110c319b6f36aa97d6ab511a8ee043d14e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251380
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-07-20 20:28:55 +00:00
Nate Biggs ac39e20618 [dart2js] Migrate js_emitter/startup_emitter/fragment_merger.dart
Change-Id: I2c9e20b116e4ff1665939dc272dd263622848c57
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251183
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-07-20 20:28:55 +00:00
Nate Biggs 459f8c784e [dart2js] Migrate js_emitter/model.dart
Change-Id: Ieb43ffafd10354255b846fe8d4069a6932463ff4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251182
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-07-20 20:28:55 +00:00
Nate Biggs d4eff1fe7e [dart2js] Migrate js_emitter/metadata_collector.dart
Change-Id: I5494de7b1475bed8a3a5f9fcd9154d7d457803c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251181
Reviewed-by: Stephen Adams <sra@google.com>
2022-07-20 20:28:55 +00:00
Michael Thomsen e84412af45 Remove unsupported APIs in dart:mirrors
Contributes to bug: https://github.com/dart-lang/sdk/issues/34233
Fixes https://github.com/dart-lang/sdk/issues/32507

Change-Id: Iee72e9f91fc1fc49761e6f5e6e9dba412493c8ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/248003
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2022-07-20 18:28:35 +00:00
Stephen Adams d6e78f27af [dart2js] late annotations with context
Annotations

    @pragma('dart2js:late:trust')
    @pragma('dart2js:late:check')

are now scoped, so that an annotation on a library or class will take effect unless shadowed by a closer `dart2js:late` annotation.
Currently the annotations affect only `late` fields.

Change-Id: Ida5c2b9387449263e29e74925aac9172fb3dc40c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251503
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-07-20 06:04:34 +00:00
Nate Biggs f7afab742a [dart2js] Reland deferred-serialization flag
Change-Id: I5774a271b4197945682439de6fe59771895547ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251882
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-07-19 18:02:06 +00:00
Nate Biggs 4670685e7d [dart2js] Set default sink start offset to be 1 instead of 0.
This was misaligned with the default for the read path of these indexed values.

Change-Id: Ic00c894965a60383786831e95bc14e7380496e1f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251881
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-07-19 17:54:04 +00:00
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