Commit Graph

4698 Commits

Author SHA1 Message Date
Sigmund Cherem be0f94b218 [dart2js] include dart:_js_annotations into the platform file by default
Change-Id: I7d93347cc41e344213a5c62f72638d4d2fd18728
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153366
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2020-07-06 21:41:02 +00:00
Mark Zhou b4c60e6e1c [dart2js] Removing switch class restrictions.
From the spec: `It is no longer required that the [case expression] evaluate to instances of the same class.`

Fixes #42409

Change-Id: Ieecd96cb75d683658ffc767d973b0ff2f5e6d834
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153060
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2020-07-06 19:12:51 +00:00
Johnni Winther 34f5c9d0b4 [cfe] Implement new async return rules
Closes #41800
Closes #41900
Closes #42134
Closes #42282
Closes #42236
Closes #42169

Change-Id: Ia994bc07fba4e2342fcb59d44fc77608198a328b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152150
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-07-06 07:04:40 +00:00
Mayank Patke e8daaefabf [dart2js] Ensure generic local functions are marked as potentially
needing type arguments.

Change-Id: I50831df2530395b9ec3562be171422b0b6455335
Bug: https://github.com/dart-lang/sdk/issues/42501
Fixes: https://github.com/dart-lang/sdk/issues/42501
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152606
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-06-26 21:27:38 +00:00
Mayank Patke cf62339751 [dart2js] Ensure type arguments are passed when invoking a generic
function property.

Change-Id: I387977e2f1fb7732d94331b7a97cceeec767aaae
Bug: https://github.com/dart-lang/sdk/issues/41449
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151301
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-06-24 20:12:39 +00:00
Stephen Adams 9030ade7e2 [dart2js] Remove HIs and HIsViaInterceptor
Change-Id: Ieb0dc5bd0e48e40132ec3469bbc2204aa9556986
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152041
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-06-22 23:25:46 +00:00
Stephen Adams 8e2c51e8fd [dart2js] final locals may be assigned
A 'final' local can be assigned via definite assignment or via a
'late' initializer.

Fixed: 42422
Change-Id: I5e03ca534fb18fcb928db99daa6654c8942c9bff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151867
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-06-20 05:15:29 +00:00
Mayank Patke f2f3a256b4 [dart2js] Add support for Never as a type literal.
Change-Id: Ia543f33619ce46e42a6ac5d0b2d19f44b32525b2
Bug: https://github.com/dart-lang/sdk/issues/42344
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151461
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-06-19 23:17:47 +00:00
Mayank Patke 6c593ac117 [dart2js] Visit type parameter bounds in the scope visitor.
Change-Id: Ief8cc2a88ef0833a10969237fa02cfdec869116d
Bug: https://github.com/dart-lang/sdk/issues/42344
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151460
Reviewed-by: Stephen Adams <sra@google.com>
2020-06-19 23:17:47 +00:00
Stephen Adams 7425b3de51 [dart2js] Remove more dead code.
Change-Id: Iff5b3921f40981c8122d7720ce80a5f01731aa47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151883
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2020-06-19 21:20:07 +00:00
Stephen Adams acf41746f5 [dart2js] More old-rti cleanup
Change-Id: Ia1bb661a255a9e3ea48b79ff33532d0d66e8e80e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151803
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-06-19 17:49:33 +00:00
Stephen Adams d8b7ec5163 [dart2js] Share large strings
On a per output-unit basis, repeated large strings are shared via a
`string$` pool.

TODOs:

- don't do it with strings passed to JS() code (they might need
  to be property accesses).

- tweak thresholds, using different thresholds for slow/run-once code.

Change-Id: Ib14245d9d428e52fb2ca23f34fa533de97fa2208
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136304
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-06-19 16:34:13 +00:00
Stephen Adams 1596bf3cd4 [js_runtime] Remove js_rti.dart
Change-Id: Ie28cca1b3b869e3bba55bbbd6ac8071ce22fb310
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151800
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2020-06-18 21:11:12 +00:00
Stephen Adams a26ad7fb7c Remove more old-rti code
Change-Id: I9c9cf3d1a408138790176525cff4e8991cd1ba32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151632
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-06-18 16:24:10 +00:00
Stephen Adams 0ccc96f470 [dart2js] remove more old-rti code
Change-Id: I462dd6aec1bf39c16e340699b2803254fd4fc941
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151345
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2020-06-17 20:31:01 +00:00
Johnni Winther 7fce125300 [cfe,kernel] Add AstPrinter
This CL adds a Node.toText method together with an AstPrinter. These
facility and better toString implementation on AST nodes while allowing
for toString independent printing of AST to use in testing. This also
add support for an integrated toString of custom/internal nodes.

Some work is still needed in bringing the toString implementation on
all nodes to the old quality, and not all internal nodes have
customized textual representations yet. This work is left for future
CLs.

Change-Id: Ib0bf8a0bc02f489dfacdc8aa5f96da9c52f26058
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150923
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-06-16 17:15:10 +00:00
Stephen Adams cf1681e11e [dart2js] Remove more unused old rti helpers
Change-Id: Icbc50554f2b3ae2cb74b32c9876c7c0cdf15c75b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150640
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-06-15 18:23:17 +00:00
Dmitry Stefantsov 929d5e4a98 [cfe,ddc,dart2js,vm] Add FutureOrType
This CL is the sum of the following 5 CLs:
* https://dart-review.googlesource.com/c/sdk/+/149297/
* https://dart-review.googlesource.com/c/sdk/+/149299/
* https://dart-review.googlesource.com/c/sdk/+/149320/
* https://dart-review.googlesource.com/c/sdk/+/149321/
* https://dart-review.googlesource.com/c/sdk/+/149323/

The reason for landing the 5 CLs as one CL is to prevent potential
troubles with bisecting over the branch because the change is fully
functional only with all 5 CLs.

Closes #40123.

Bug: https://github.com/dart-lang/sdk/issues/40123
Change-Id: Ice52250a98acfe455b1d7fa5bb0624c115ca5dac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150934
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-06-15 12:18:46 +00:00
Stephen Adams 84d3f3681f [dart2js] pass null for missing required argument in weak mode
Now passing:
language/nnbd/required_named_parameters/required_named_args_legacy_test
language/nnbd/required_named_parameters/required_named_args_weak_test

Change-Id: Ide909eb6eb996ca48c851b45f1069f6562b52d5e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151096
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-06-13 00:15:52 +00:00
Stephen Adams bbeda37c05 Address review comments from 150935
Change-Id: Ia137c8c139e13cb9b3f8017328f5a79edfcbc0b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151022
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-06-12 05:54:28 +00:00
Stephen Adams a13a2d7c84 Redo "[dart2js] Delete unused old-rti helpers"
Change-Id: I756a1adde6bbecdb5f28eb93f93041463435476d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151041
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-06-12 01:29:39 +00:00
Johnni Winther ab034e69b4 [dart2js] Fix reduction to declared type in type promotion computation
When reducing the type promotion in case of assignment, the target
info wasn't correctly handling the reduction to the trivial state.
This caused an error in a following join computation.


Closes #42281

Change-Id: I2144f5401e9736308dc37147f7a5cb9ab1be8583
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150935
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-06-11 18:52:38 +00:00
Mayank Patke 9f6510b31b [dart2js] Replace accesses to options.nullSafetyMode with
`options.useLegacySubtyping` where possible.

Change-Id: I462044e536f061cc0c67b044b986494801f58e1b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150765
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-06-11 17:35:41 +00:00
Stephen Adams 96fc158e4e Revert "[dart2js] Delete unused old-rti helpers"
This reverts commit e75b824aed.

Reason for revert: Break in google3 

Original change's description:
> [dart2js] Delete unused old-rti helpers
> 
> Change-Id: I0f97dddbfcbe5f51dff1d7d68f880e85d62768a4
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150504
> Commit-Queue: Stephen Adams <sra@google.com>
> Reviewed-by: Sigmund Cherem <sigmund@google.com>

TBR=sra@google.com,sigmund@google.com,joshualitt@google.com

Change-Id: If71d84fda4ce596bb762d32454a4c635185f189f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150780
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-06-10 17:46:40 +00:00
Michael Thomsen 41a7db13bc Avoid divisive terms
Based on guidance in https://developers.google.com/style/w

Related to https://github.com/dart-lang/sdk/issues/42247

Change-Id: If40c8e39bb35f1f7dfad9cb977c7a494a2cc3bd7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150626
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
2020-06-10 14:23:57 +00:00
Stephen Adams e75b824aed [dart2js] Delete unused old-rti helpers
Change-Id: I0f97dddbfcbe5f51dff1d7d68f880e85d62768a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150504
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-06-09 18:24:53 +00:00
Harry Terkelsen 54fe29e965 support @JS annotation from SDK
Attempt at fixing https://github.com/dart-lang/sdk/issues/39740 to allow the flutter web engine to use @JS
interop to avoid the overhead of the SDK available js interop.

Bug: 39740
Change-Id: I7ba9c8981e639cd267bee3086ba900b89bfc0d6f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150501
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Harry Terkelsen <het@google.com>
2020-06-09 17:10:15 +00:00
Stephen Adams e3fac1dde2 [dart2js] Remove Options.useNewRti
Change-Id: Ib959cddf7929e2e5d6f3e514e718976fd0135b7e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150473
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-06-09 17:01:55 +00:00
Joshua Litt f9f1ca6171 [dart2js] Create tests/dart2js for nnbd.
Change-Id: Ib8721cf976803d8d1b9d723b7e691e344c768b67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149881
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2020-06-09 16:53:15 +00:00
Stephen Adams 7eee7b6957 [dart2js] Remove old rti in ssa/
Remove HInstructions related to old rti.

Some methods are still called 'fooNewRti'. These will be renamed 'foo'
at the very end of removing old rti.

Change-Id: I36fcc9d2d5bc19988e26fa5014c895f54b88900c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150276
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-06-09 00:43:05 +00:00
Stephen Adams 89c5b5c904 [dart2js] Call-through stubs must forward type arguments
There are several problems contributing to issue 41449.
This fixes the malformed call-through stubs.

Change-Id: I90f1584f221956ee3fe4111314cba2813a16837c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150283
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2020-06-08 18:40:53 +00:00
Stephen Adams 5f30b07f34 [dart2js] Remove trivial dead code in simplifier
The biggest impact is removing the orphaned HInterceptors for all the
call instructions lowered to other instructions. (The SSA is much
easier to read with this noise immediately removed!)

I have seen no code differences except one or two pieces of dead code
like `[];` that must have become dead on the last simplify pass after
the last DCE pass.

I am experimenting in another CL with some algebraic rewrites and
simplification of bit operations to target some weak code. This change
makes the rewrites work much better.

Change-Id: I057269d44abb44916255a48b36761bb719b73eaa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150267
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-06-08 17:37:01 +00:00
Stephen Adams 4b9c2356e9 [dart2js] Don't confuse value and location.
A HParameterValue can be an SSA value or a mutable local variable
accessed via HLocalFet/HLocalSet. The latter happens in code that is not
completely SSA-converted (due to exception control flow).

The main bug is that the check on a mutable-variable-mode HParameterValue
should have been on a HLocalGet of the value, and not the HParameterValue
itself. This means that a reference to the HParameterValue cannot be
replaced with a strengthening check, as that breaks the invariant that
HLocalGet/Set refer to variables. There was code in types_propagation
that tried to work around this broken invariant.

The bug (issue 42189) required
  - An elided instance method parameter
  - try(-catch)(-finally) to avoid complete SSA-conversion
  - -O0 to avoid optimizing away the check early with inferred types

The first attempt at a fix was to not check the elided parameter at all
since the default value is statically checked. This is still worthwhile.

Bug: 42189
Change-Id: Idd5e2b1485eba4950a36d1e4ff57ebe35e4c98a0
Fixed: 42189
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150171
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-06-07 00:11:11 +00:00
Joshua Litt 451694e855 [dart2js] Move dart2js_native to dart2js/native.
Change-Id: I2f879fe18376b8c1b82fc201d488425dc154d2b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149341
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2020-06-04 18:11:49 +00:00
Joshua Litt 05ca544f15 [dart2js] Move tests/compiler/dart2js_extra to tests/dart2js_2.
Change-Id: Iaa0ca2b4f2d1b15f79ddca37834d3ed2497bc068
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149242
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-06-03 15:15:30 +00:00
Michael Thomsen 873bd241dd Clarify terms for environment declerations
Fixes https://github.com/dart-lang/sdk/issues/42136

Change-Id: I53ab8d0608f0229a4e22d24e54f29a5ddf150766
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149595
Commit-Queue: Michael Thomsen <mit@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-06-03 13:37:19 +00:00
Johnni Winther 3a021a6545 [cfe] Remove EvaluationMode.legacy
This is no longer valid. Since the SDK is agnostic we should default to weak mode.

Change-Id: Ia9fbf911e7ebb595c93a71afe3bb8de7495cebba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149065
Reviewed-by: Jens Johansen <jensj@google.com>
2020-05-30 09:47:02 +00:00
Stephen Adams 63ade9680f [dart2js] tweak deferred load list printing
In non-minified output, some newlines in the map are helpful.

Change-Id: I36f0e0bbeebe40c685923fabd9abe439526c3f54
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149486
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-05-29 23:51:57 +00:00
Stephen Adams fd48e704cb [dart2js] SSA cleanup
- remove unused selector fields
- add types to some constructors

Change-Id: Ia42700feae376088003500fcc1666a8e0b3cf754
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149372
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-05-29 17:19:46 +00:00
Joshua Litt 20faaa5d94 [dart2js] Move dart2js unit tests to pkg/compiler/test.
Change-Id: Ib18f554c1076f27a3f7c0df5a36410da41a1f467
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148784
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-05-28 18:51:11 +00:00
Mayank Patke bbb8923ebb [dart2js] Ensure all top/raw type predicates go through DartTypes.
Conceptually, this makes sense because a type is not intrinsically top
or bottom or raw, but only in the context of a type system. This also
makes these predicates much more maintainable and puts them in a form
identical to the one at the RTI level.

Change-Id: I83154a82cef6cbaa9c4d0f27cb95f01473c1e015
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149049
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2020-05-27 05:28:03 +00:00
Mayank Patke d1546cac87 [dart2js] Make diagnostic message arguments strongly typed.
We were passing arguments as just a `Map` and forcing the Message to
handle the String conversion, but the caller is much better equipped to
do it and prevents the dynamic typing.

Change-Id: Icc4ab91edf233b81a64aa3b03462b541349fa751
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149048
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-05-27 05:28:03 +00:00
Mayank Patke 8d6a0541dd [dart2js] Always treat Never as a bottom type.
Previously, we were only treating it as a bottom type with strong NNBD,
but weak NNBD can still contain Never.

Change-Id: I88f1aac3d228918f82e7e75d01531df802613ddb
Bug: https://github.com/dart-lang/sdk/issues/41970
Fixes: https://github.com/dart-lang/sdk/issues/41970
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148940
Reviewed-by: Stephen Adams <sra@google.com>
2020-05-27 05:28:03 +00:00
Stephen Adams e007545c42 [dart2js] Add HFunctionReference
Defer representation of function reference until codegen pass.
Not using opaque HForeignCode allows GVN and dead code removal to work.

Change-Id: I481094acca49c8b47d4ed9813a5150cbc8c9e4ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145340
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2020-05-26 22:17:42 +00:00
Mayank Patke 46dc9fb9a7 [dart2js] Set NNBD mode based on entry point.
Tested with https://github.com/dart-lang/null_safety_sample_package/.

Change-Id: Icecbee11da44eb9eb9cb3eb36f905f4a7126996b
Bug: https://github.com/dart-lang/sdk/issues/41208
Fixes: https://github.com/dart-lang/sdk/issues/41208
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148580
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-05-26 22:08:52 +00:00
Sigmund Cherem 15ee305516 [dart2js] treat native return types as nullable in weak mode.
This is a temporary workaround. The `dart:html` library contains type
annotations based on the chrome IDL, but it doesn't consider browser
compatibility or whether an API is only supported on some contexts.

We can revert this as soon as `dart:html` is sound again.

See https://github.com/dart-lang/sdk/issues/41960 for details.

Change-Id: Ia92e8821adc8e3fab8cd8e08327a282c133962ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148622
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2020-05-19 04:54:09 +00:00
Stephen Adams 2aa7674cb2 [dart2js] Collect lazy statics in collector
Use the collector to distribute lazy statics to OutputUnits.  This is
much faster than filtering the lazy statics for each OutputUnit.

Code emitter times (most of difference in 'build program')
CM: 94s --> 58s
CMSS: 209s --> 72s

Change-Id: Ib1b71290c71c62810d902e9be1c48ee9985273eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148620
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-05-19 04:06:59 +00:00
Stephen Adams 998a92d2cc Cleanup deferred_import.dart
Use Map/Set/List literals instead of 'new ...'.

Change-Id: I0f7b4bad4a1859e4f154cf2666465cbb3153867f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148442
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2020-05-18 21:41:26 +00:00
Stephen Adams c1486bcb24 [dart2js] Reduce Lists in DeferredLoadTask
ImportSets do not need to store the list of members of the set as it
is available implicitly on the canonical construction path. All that
is required is a back-pointer to traverse the canonical path from the
end (i.e. ImportSet).

This reduces the memory required by DeferredLoadTask by O(N).

Change-Id: Id23ce91d4aa01a74cd0f9ff4246dc56b65db1bf9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148184
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-05-16 01:02:33 +00:00
Mayank Patke 22e5856ae5 [dart2js] Normalize the FlatTypeMask representation of Null.
Change-Id: I8362f9fd4373fc64d2125602d35e8f7612081a93
Fixes: https://github.com/dart-lang/sdk/issues/41867
Fixes: https://github.com/dart-lang/sdk/issues/41918
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148182
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-05-15 21:45:12 +00:00