Commit Graph

4973 Commits

Author SHA1 Message Date
Mark Zhou 1e706215d1 [dart2js] Adding experimental flag for emitting treeshaking info
This will eventually be merged with --dump-info

Change-Id: I81884868521abc542bb0268912bfb37e6241cac5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238500
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2022-03-25 17:21:40 +00:00
Joshua Litt 9f33a4a052 [dart2js] Inline CompilerDiagnosticReporter into its super.
Change-Id: I3b675df3069f2ff7cb74374bcc2ee1caa31e8610
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238800
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-03-25 16:15:50 +00:00
Mark Zhou ca99bde913 [dart2js] Cleaning up codegen inputs and dart2js_info
Change-Id: I844b43580dbf8738b72e638b24be726e878f8635
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238780
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2022-03-25 15:22:20 +00:00
Nate Biggs 49c1a91587 [dart2js] Refactor serialization/deserialization implementations (6/6)
Rename DataSource -> DataSourceReader and SourceReader -> DataSource to more accurately reflect these classes' new roles. 'Writer' and 'Reader' are used for the higher level class that composes serialization operations. The 'Sink' and 'Source' handle the low-level conversions to/from the storage format.

Change-Id: I384b5f134beb040676f8e1ef4fba056e0c40358f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238243
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-03-24 18:50:19 +00:00
Nate Biggs f0b1143bc6 [dart2js] Refactor serialization/deserialization implementations (5/6)
Copy comments from original interfaces to new DataSink and DataSource and organize methods based on original interface.

Note: If the reorganization makes the diff on this too complicated I can just add the comments and leave in the order it was in.

Change-Id: I959ae19d80ad330ef67334effb8aad8661689937
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238242
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2022-03-24 18:50:19 +00:00
Nate Biggs c4c013b7f7 [dart2js] Refactor serialization/deserialization implementations (4/6)
Move DataSource/DataSink to implement serialization via composition rather than inheritance taking simple interfaces that do low-level writes/reads.

Note: Names and locations of classes will change throughout the next several CLs.

Change-Id: I04807d64a1238b42308ec93e5b5dda6ef2101c00
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238241
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2022-03-24 18:50:19 +00:00
Nate Biggs 4f4b4d06b5 [dart2js] Refactor serialization/deserialization implementations (3/6)
Combine AbstractData(Source/Sink) and Data(Source/Sink) into a single class. This simplifies the inheritance hierarchy before switching to a composition structure.

Note: Names of classes will change throughout the next several CLs and comments from the interface get added back in here:
https://dart-review.googlesource.com/c/sdk/+/238242

Change-Id: I50597e04f5b18a1150da4822c4886d12896bed8f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238240
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2022-03-24 18:50:19 +00:00
Nate Biggs 20ca69b8b7 [dart2js] Refactor serialization/deserialization implementations (2/6)
Copy mixin logic into AbstractSink/AbstractSource classes since these are the only usages of the mixins.

Note: Names and locations of classes will change throughout the next several CLs.

Change-Id: Ie154741a83c3488a098f3ebf5cf340f19a1a9c52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238220
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2022-03-24 18:50:19 +00:00
Nate Biggs 59c4fc3260 [dart2js] Refactor serialization/deserialization implementations (1/6)
Rename abstract class files in preparation for refactor.

Note: Names and locations of classes will change throughout the next several CLs.

Change-Id: Ibf1e56b9e1e550fd14f6b2b803b6bbbc2d7cae3c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238162
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2022-03-24 18:34:49 +00:00
Joshua Litt b0da308fc5 [dart2js] Always compute impacts directly on kernel.
While this adds an intermediary form for impact computation, it did not
seem to noticeably change the time it takes to compute the closed world
on a large application.

In addition, it will be a necessary change if we want to start moving
some of the validation currently being performed while building
`ResolutionImpact`s modularly.

Change-Id: I76d63a34bbd099103051ead67ec54fd38142929a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/235482
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-03-24 15:11:22 +00:00
Joshua Litt 0ad7f27990 [dart2js] Apply mixin transform globally.
This cl applies the mixin transform only on the full dill. In addition,
this cl also adds a concatenate dills step to more closely match
modular builds in production.

Change-Id: Icb37c5e2180c9e8246334143a6f772a203f80bf9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238320
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-03-23 18:38:51 +00:00
Mayank Patke 05a6506c92 [dart2js] Clean up unused topLevel member in DartTypeConverter.
Change-Id: I67e38effb7035e0af73cabc923d1e4e529fd9b72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238262
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2022-03-22 22:29:00 +00:00
Stephen Adams f82c8b4fe6 [dart2js] Use trusted types for URLs of deferred loading scripts
Using a trusted type policy for the script elements injected to load
deferred libraries allows a content security policy to be enabled to
prevent untrusted scripts elements from loading code.

TEST=https://dart-review.googlesource.com/c/sdk/+/237638

Change-Id: Ie3505a68d83cb19c7f8bdbefa01df7fc58d9924a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237542
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-03-19 20:01:32 +00:00
Joshua Litt c2a63d7cc8 [dart2js] Add a 'modular analysis' phase.
Change-Id: Idda666911a15e1726a15db65eb0cce2733851fdc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237633
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-03-17 19:06:16 +00:00
Stephen Adams e2c9472485 IE11 cleanup - setting function names is unnecessary
Change-Id: Iaf327270bbee48736905b42e7b4290c2eb78e51a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237185
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-03-15 19:22:03 +00:00
Mayank Patke 1d239794ea [dart2js] Ensure finally sees the inference results of an abortive
`try` block.

Change-Id: Ib5793a9207a7f327780b97ed53530fa89fd9c8f2
Fixes: #48422
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/235983
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2022-03-14 20:49:48 +00:00
Joshua Litt 6f5a99b211 [dart2js] Fix bug with leafless constraint graphs.
Change-Id: If0ddb1e0e3559f8ec05b0303da37adcd72acd336
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236444
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-03-11 02:35:05 +00:00
Joshua Litt f3092bebd8 [dart2js] Introduce 'load_kernel' phase.
Change-Id: Iefc15122dfd08b514a2f883d856a7b8a005911b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233765
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-03-09 20:11:44 +00:00
Joshua Litt ce73305411 [dart2js] Cleanup _RtiNode.testState.
Labeling nodes as direct / indirect seems to have been unstable and
unused, so this cl removes that logic. Also removed logic to process
_RtiNode._literalState which ssems to have been unused as well.

Change-Id: Ic463149ee353abcd55c22684f12ba11eb92cc91d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/235722
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-03-08 00:30:23 +00:00
Mark Zhou 6f2291aaf7 [dart2js] Adding additional initialization logic for runtime allocations
Fixes an issue where the allocations object was not always initialized for certain apps

Change-Id: I717bd20c1bef3e4a64d9d4243c4fe3d48178ae2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/235441
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2022-03-06 07:44:21 +00:00
Stephen Adams 6231245e80 [dart2js] Constant-fold indexers of constant Lists and Maps
Change-Id: Id2a15047759d3b1b8230379adff314e9052c922c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/235283
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-03-05 02:14:31 +00:00
Johnni Winther 1f848492b7 [dart2js] Compute the correct selector for InstanceGetterInvocation
The Selector computed for InstanceGetterInvocation used the name of
the getter eventhough the invocation is actually a .call invocation.
This lead the computation of whether type arguments need to be parsed
to fail because it queried with the wrong selector.

Closes https://github.com/dart-lang/sdk/issues/48304

Change-Id: Ia08fb91fa24b5b04eba850f75f9b66cb89494dda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/234288
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-03-01 08:55:17 +00:00
Stephen Adams 96a4051dda [dart2js] Remove dynamic calls from ssa/variable_allocator.dart
Change-Id: Ibe7f47eb7a01c09ba29c5e7b311f195570def3bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/234140
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-02-23 21:40:42 +00:00
Stephen Adams b55de5554b [dart2js] Avoid eager initialization optimization for some Maps and Sets
Unfortunately we have to give up on eager initialization of many maps
and sets due to unknown dependencies and effects in the hashCode
implemenation. Eager initialization of some cases could be recovered
as they are eligible to be `const` maps and sets.

Fixed: https://github.com/dart-lang/sdk/issues/48442
Change-Id: I6500123ff9d1fe42bacb53718a4b9e4e969ebc3f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233942
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-02-23 19:17:32 +00:00
Joshua Litt 6e2b3da2e2 [dart2js] Remove StagedWorldImpactBuilder.
This thin wrapper appears to be no longer necessary.

Change-Id: Ice608986e3579dd7c23591a44d7955ac3e92d7df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233720
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-02-23 18:20:02 +00:00
Joshua Litt 7b4c8496b9 [dart2js] Cleanup some indirection in impacts.
1) Inlines ImpactBuilder into ImpactRegistryMixin + rename
   to ImpactBuilder.
2) Inlines ImpactData into ImpactDataImpl + drop the Impl.

Change-Id: I47322a309708fd6345e4cf4e9a5de505bdbc81c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233685
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-02-23 17:12:03 +00:00
Stephen Adams 8774f7fd31 [dart2js] Cleanup dynamic call in ValueSet
Change-Id: I0c440b1df288fa39ffb4cc892831520ff47402d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233965
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-02-23 16:42:14 +00:00
Joshua Litt f3ee8e19ac [dart2js] Eliminate uses of dynamic in behavior.dart.
Change-Id: I81b9e34770953afa0820eec70d817cdf2ab39fde
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233963
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-02-23 03:39:16 +00:00
Joshua Litt 9f8feed92a [dart2js] Inline enqueue creation into compiler.
Also removes a few minor dead methods, and cleans up EnqueueTask which
can now just be a GenericTask.

Change-Id: Ib1614774df740739762f943df0a7bf901f7fdfc4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233721
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-02-23 01:51:04 +00:00
Joshua Litt 49f23164f3 [dart2js] Cleanup comment in options.dart.
Change-Id: I8586aea2901a407cb33d2bd8730cce25f2515842
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233943
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-02-23 01:18:19 +00:00
Joshua Litt f788ab8c89 [dart2js] Inline Native*Impl into Native*.
This CL inlines NativeBasicDataImpl, NativeDataImpl, and their
respective builder impls into their respective interfaces.

Change-Id: I40c02e0d4cbe1bc66f166db1b998726082be0606
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233725
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-02-22 23:34:12 +00:00
Joshua Litt 2e14b26976 [dart2js] Remove BackendStrategy.
At this point we only have one backend. Maybe in the future we will have
a second backend, but that will be far enough in the future that it
makes sense to 'rediscover' the value of this pattern.

Change-Id: Ic4f5d3494c48325ea73ea2e64f923a9c532e9c52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233764
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-02-22 21:13:54 +00:00
Joshua Litt 21b93bcf9f [dart2js] Cleanup some indirection in element_map_impl and friends.
1) KernelElementMapImpl is inlined into KernelElementMap.
2) KernelBehaviorBuilder is inlined into BehaviorBuilder.
3) KernelClassQueries / ClassQueries are removed.
4) NativeMemberResolver is inlined into KernelNativeMemberResolver.
5) NativeClassFinder is inlined into BaseNativeClassFinder.

Change-Id: I04d14a64155de54aafc2abe8579304c018ad9490
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233658
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-02-22 20:35:32 +00:00
Stephen Adams 194ac46cfa [dart2js] Remove --legacy-javascript customizations
Change-Id: I8469f3d517ef42d897fa2310823e5ac8f3d8aeee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233860
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-02-22 19:23:22 +00:00
Joshua Litt 934ad4753d [dart2js] Elide a number of interfaces.
Inlined KClosedWorldImpl into KClosedWorld
Inlined ResolutionWorldBuilderImpl into ResolutionWorldBuilder

Change-Id: Id88abac06f7cd279413ae56ea8b021b349009649
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233655
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-02-19 02:49:52 +00:00
Stephen Adams 07d63eab7e [dart2js] GVN string concatenation
GVN pure stringifiers and string concatenation.

I removed the comment regarding #9293. I could not understand it.
Removing the 'setDependsOnSomething()' does occasionally produce
worse-looking code, but at the application level, the code is
marginally smaller.

https://github.com/dart-lang/sdk/issues/48243 is a more general
description of the 'looks better' problem that pure operations tend to
sink to their use, increasing live-ranges of the operands.  The
sinking is sometimes advantageous - e.g. when the new location is on
an error path.

I see common subexpression elimination often in the pattern of
constructing default strings for Intl.plural:


    Intl.plural(...,
        one: '$first (+$howManyMore language)',
        other: '$first (+$howManyMore languages)',
        ...);

--> old JavaScript

    var
      t1 = A.S(first) + " (+" + howManyMore + " language)",
      t2 = A.S(first) + " (+" + howManyMore + " languages)";
    return A.Intl__plural(..., t1, t2, ...);

--> new JavaScript

    var
      t1 = A.S(first) + " (+" + howManyMore;
    return A.Intl__plural(..., t1 + " language)", t1 + " languages)", ...);

Change-Id: I56aff26c9e5e31954fef224378f3723a05b318ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233641
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-02-18 23:20:52 +00:00
Stephen Adams b13257e01b [dart2js] Remove ability to choose --legacy-javascript
Change-Id: I48cc93c5778807e6c86168b096ae8ae97ff08b66
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/232483
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-02-18 02:24:11 +00:00
Mayank Patke d539c43372 [dart2js] Create child LocalState for inference of labeled statements.
This is analogous to what we do for other control flow constructs.
Without this, a `break` to the label causes the outer scope to also
appear aborted.

Fixes: #48317
Bug: https://github.com/flutter/flutter/issues/96394
Change-Id: I575a5bf96b25b49df6f15d429881e310b3b34d15
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233446
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2022-02-18 00:58:20 +00:00
Joshua Litt fee5309e61 [dart2js] Remove ImpactTransformer.
Removing the indirection now that there is only one ImpactTransformer.

Change-Id: I20644113d4fce046138df4adc4b1f836d81c2523
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/232964
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-02-17 23:11:16 +00:00
Joshua Litt f50a4b4612 [dart2js] Cleanup some TODOs in dart2js' frontend api.
These appear to be no longer necessary.

Change-Id: I8ec8a13394b6e56697de3ccee3a5326b149a137a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233000
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-02-15 17:41:39 +00:00
Joshua Litt 201557fb1d [dart2js] Remove FrontendStrategy.
This CL cleans up some indirection now that we only support
KernelFrontendStrategy.

Change-Id: Iaee8d41e061cc88957cae00d61111cbd8c076d65
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/232963
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-02-14 23:44:10 +00:00
Stephen Adams 1314d66d41 [dart2js] Better dead phi removal
Remove dead phis including back-edges and cycles.

Add a postcondition validation for optimization phases.

Add post-phase validation test for dead-phi removal and dead-code elimination.

Bug: https://github.com/dart-lang/sdk/issues/48397

Change-Id: I178cda52dd165e825b9e2d9ae642c22162cee2e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/232782
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-02-14 23:30:30 +00:00
Joshua Litt 1e799e1580 [dart2js] Merge CompilerImpl into Compiler.
This indirection is no longer needed.

Change-Id: Ic917ec758dc8a8a648fea9f74ddf75f47b6b9d4d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/232485
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-02-14 20:42:50 +00:00
Stephen Adams 75d4047276 [dart2js] Dead code eliminator should remove dead phis
The bad codegen reported in #48383 was due to an unused phi confusing
the expression-tree construction algorithm. It was trying to generate

    data = cond ? callWithSideEffects() : null;

but `data` is unused, so somehow we generated only

    cond;

We should not have unused phis at this point so I put a safety check
in the above code to not try to build an unused conditional, and
changed the dead-code eliminator to eliminate dead phis.

Now we get

    if (cond)
      callWithSideEffects();

I compared the output for some large apps and there were about a dozen
changes. All looked like improvements, e.g. not assigning to an unused
variable. There was some code missing that is now present, but luckily
for the large apps, it was all code that did not have real-world side
effects.


Fixed: 48383
Change-Id: Id7b32cfa0cbfb47a4d9eff174ad9ae52da99f6a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/232781
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-02-14 20:15:30 +00:00
Joshua Litt 971772bf6d [dart2js] Cleanup a few minor uses of dynamic.
Change-Id: Ic29689ce30f368bfa21bdd2bd13cca038973fba0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/232321
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-02-14 18:33:33 +00:00
Joshua Litt 95a924d289 [dart2js] Delete ImpactStrategy.
This strategy is no longer necessary with the single frontend, and
inlining all the logic makes the code much easier to follow.

Change-Id: I73995aa6249b52a932dbfb2d459c2d6633a620d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/232029
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-02-11 17:45:07 +00:00
Joshua Litt 4ce081c99b [dart2js] Remove old compiler interface.
Change-Id: If4f98f4d32a42ce8c2aabd98116997934b13b557
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/232001
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-02-10 16:27:25 +00:00
Joshua Litt 663d682ab3 [dart2js] Remove pkg/compiler/lib/src/helpers.
Most of these tools have been replaced by better tools.

We may re-add some of these in the future, but if so then maybe they should live in pkg/compiler/tool.

Change-Id: I673dd27dafad59cc01b0be0705c2032c11fca713
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231980
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-02-09 17:21:46 +00:00
Joshua Litt 21a5f73456 [dart2js] Cleanup ImpactCacheDeleter.
This cl mostly just removes indirection around clearing the Impact cache.
However, there is one minor logic change, today we clear the impact cache
before calling DeferredLoadTask._buildResult, but after this cl the
impact cache is cleared by its owner(Compiler) in the compiler pipeline
itself.

Change-Id: I5845b786887f861c61a0ac79a3c8f2de2a3a2a14
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/232026
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-02-09 02:28:41 +00:00
Joshua Litt ef02841083 [dart2js] Cleanup NativeEnqueuer.
This cl removes an unnecessary concrete interface, and makes the
existing base class abstract.

Change-Id: I41891a7b3c57008de05a7c4a20a70452983ab441
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/232125
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-02-09 01:01:37 +00:00