Commit Graph

4088 Commits

Author SHA1 Message Date
Johnni Winther 9f9d7cdc7b Collapse JsKernelToElementMap hierarchy
Change-Id: I47df1a7f3af3d3741293ee43cd1d205842138f3b
Reviewed-on: https://dart-review.googlesource.com/c/84002
Auto-Submit: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-11-09 20:20:41 +00:00
Johnni Winther 5cb37ff5b8 Collapse KernelToElementMapImpl hierarchy
Change-Id: Ia6e14e0890709448443c97561c8641d0379a3536
Reviewed-on: https://dart-review.googlesource.com/c/84001
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-11-09 20:20:41 +00:00
Johnni Winther 49a4a177ab Support explicit data files in --read-data and --write-data options
Change-Id: I7324efc8c0f0a86643b753e903fbb261168d77d6
Reviewed-on: https://dart-review.googlesource.com/c/84000
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Auto-Submit: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-11-09 19:44:07 +00:00
Sigmund Cherem 1c1e013177 Introduce an interactive progress that uses a single line per phase
Change-Id: Ib8537192511dce32adfacbbaea31e7ae7184f617
Reviewed-on: https://dart-review.googlesource.com/c/83960
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-11-09 18:52:54 +00:00
Sigmund Cherem c44421dbba less verbose: remove progress form verbose mode, add a separate flag for it
Change-Id: Ieadc001316713e3434a22420956cd7d0bf6bc77d
Reviewed-on: https://dart-review.googlesource.com/c/83920
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-11-09 18:06:41 +00:00
Stephen Adams 849ece596a [dart2js] Use properties on Closure class for one common case
We can share the properties for single-argument closures by putting
the properties on class Closure. (It is worthwhile to do this for zero
and two argument closures, but we will need to add subclasses. That
will be another CL).

Change-Id: I30027965150f64200396df3d82140fb112b0899f
Reviewed-on: https://dart-review.googlesource.com/c/83640
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-11-08 20:54:03 +00:00
Johnni Winther a9e2af657f Refactor static type computation
This decouples the computation of static types from the kernel impact
visitor and prepares for flow sensitive static types (i.e. guarded type
promotion).

Change-Id: Ic8b6283bd64d535ff49b1d6fee2e5ae38d48a2d9
Reviewed-on: https://dart-review.googlesource.com/c/83381
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-11-08 13:16:42 +00:00
Stephen Adams ff433daa03 Access more code via hunkHelpers
Change-Id: I0c43ea0903ee05b3c130e38f73bba9ce30b3506b
Reviewed-on: https://dart-review.googlesource.com/c/83540
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-11-07 22:02:31 +00:00
Stephen Adams 3be0d61793 Split installTearOff into static and instance versions
We will move other methods into `hunkHelpers` at a later stage.

Change-Id: Id37a0bddb81cc47af55baa2896dc5716ccacf3e1
Reviewed-on: https://dart-review.googlesource.com/c/83220
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-11-07 00:44:34 +00:00
Stephen Adams e9ba30a4b4 [dartjs] Shorten "call*" when minified
We can do this now 'mirrors' is not longer supported.

Change-Id: I469710df4c3d7e7f17b5a6ed9569f9e991f8bba6
Reviewed-on: https://dart-review.googlesource.com/c/82960
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-11-07 00:10:22 +00:00
Stephen Adams 36874154b4 [dart2js] Simplify defaulting bool.
The small diamond from `boolOrNull ?? false` can become a fast comparison:

    boolOrNull == null ? false : boolOrNull  -->  boolOrNull == true

The straight-line code is then available for other optimizations, e.g. generate-at-use placement.

Change-Id: I7a14705a82eda4c716ee600ccca44e6658187649
Reviewed-on: https://dart-review.googlesource.com/c/56160
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-11-05 21:43:01 +00:00
Stephen Adams 19659b399d Use '==' in more cases.
Change-Id: I06b576e88cb97e819cd238970c03b7908451e010
Reviewed-on: https://dart-review.googlesource.com/c/82100
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-11-05 19:43:08 +00:00
Sigmund Cherem 61df5fdec8 Encode dart2js source-map extensions in strings.
This reduce the memory footprint and cost of parsing these extensions.  Another
advantage is a reduction on the size of the .map files.  On a large customer
app, this was a 11% reduction, and the frames section was about 1Mb (excluding
the extra names and uris added on the existing tables).

The encoding works as follows:
 - minified names are written as a list of names and indices, in pairs.

    {'n1': 1, 'n2': 2} => 'n1,1,n2,2'

 - frames are encoded using a sequence of values with markers for the different
   kind of frames. Numbers are encoded using VLQ deltas. We use VLQ because it's
   already available to any parser that deals with the mappings).

This change also uses the dart2js_tools parser implementation for all unit tests.

Change-Id: Iacc2833c6517eb473955cc618adec501c610870f
Reviewed-on: https://dart-review.googlesource.com/c/82780
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-11-05 18:24:33 +00:00
Johnni Winther 9a1a7763f1 Skip checking of casts in metadata
This avoids assertion failure on js-interop class computation.

Change-Id: I040c6d63dbc427d239eb97c22dc8c3c67a6fb9fd
Reviewed-on: https://dart-review.googlesource.com/c/82722
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-11-05 10:40:58 +00:00
Matan Lurey c8fd361478 Stop using deprecated package:collection/*.dart
where `*.dart` isn't `collection.dart`.

Closes #32676
https://github.com/dart-lang/sdk/pull/32676

GitOrigin-RevId: 40f025bcf9ef71f6ccef5bc318f9862518aa0692
Change-Id: I95be4e7b31d269921a9ebbb91e5cdb2aa6702ec6
Reviewed-on: https://dart-review.googlesource.com/c/48460
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2018-11-05 10:13:06 +00:00
Johnni Winther 672a049303 Move KClosedWorldImpl to its own library
+ and merge it with its mixin

Change-Id: Ib0eea07cee0bed602be90cf4a324bd423cba0a86
Reviewed-on: https://dart-review.googlesource.com/c/82720
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-11-02 21:11:31 +00:00
Johnni Winther b9a67ee27d Merge ClosedWorldBase and JsClosedWorld
Change-Id: Iab026a163a7a63ab0dad2026f43f79e0eaa8da01
Reviewed-on: https://dart-review.googlesource.com/c/82680
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-11-02 20:54:54 +00:00
Johnni Winther ad07f8a9e0 Explicitly import dart:async
This makes the dart2js code version 2.0 compliant

Change-Id: I65565222b641841b6eead9d43f81b3d52c3e962e
Reviewed-on: https://dart-review.googlesource.com/c/82642
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-11-02 17:46:16 +00:00
Johnni Winther 73eadf53c2 Move JsClosedWorld and JsClosedWorldBuilder to their own libraries.
Change-Id: I5bf75fcb443a591d460fd9e0f7c2258e345fff40
Reviewed-on: https://dart-review.googlesource.com/c/82640
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-11-02 17:34:33 +00:00
Johnni Winther 556dd9a345 Add support for serialization on command-line
Change-Id: I4fa85c3e06e1f142265cecff83ff1b8db74bfe65
Reviewed-on: https://dart-review.googlesource.com/c/82445
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-11-02 14:12:18 +00:00
Sigmund Cherem 6004c8a187 Ensure generatedSize takes into consideration empty fragments
This fixes a crash in dump-info. We should investigate more closely why are we
reaching the empty output units in the first place, since we expect dump-info
wouldn't need to report data about any entity that used to be there.

Change-Id: I8c996c4ea4a86531bec28f0f294fe48086177219
Reviewed-on: https://dart-review.googlesource.com/c/82280
Reviewed-by: Harry Terkelsen <het@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-10-31 20:27:15 +00:00
Johnni Winther 22de8d50af Test (de)serialized equality of compiler output
Change-Id: I0f7218cfebb88355b51f8f4f1e298cc6a6e2be2b
Reviewed-on: https://dart-review.googlesource.com/c/81681
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-10-31 09:48:28 +00:00
Johnni Winther a09ec46da6 Test in-memory serialization/deserialization in test-mode
+ fixes for switch and continue

Change-Id: I1f4fb9327b9db08eb69f750a66073affe2659f7d
Reviewed-on: https://dart-review.googlesource.com/c/81603
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-10-30 11:18:24 +00:00
Johnni Winther 41c50d9ac9 Support serialization of deferred imports
+ add tests for various fixes
+ add canonicalization support in serialization

Change-Id: Ib6a8bfd6073dbd93c1ba4fd9d2feff77ac43b178
Reviewed-on: https://dart-review.googlesource.com/c/81402
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Auto-Submit: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-10-26 09:36:18 +00:00
Johnni Winther 99f73f26c0 Move allocated list data to global inference results
Change-Id: I6d2810daeb64053557ac587fed1631643b5e45bc
Reviewed-on: https://dart-review.googlesource.com/c/81401
Auto-Submit: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-10-25 17:45:49 +00:00
Johnni Winther 741f81afba Use List instead of Link in class_set
+ fix the order of the iterator to match the class hierarchy tree

Change-Id: I06011b673f7413160863eb8bb4f00c3cdd8a5ad2
Reviewed-on: https://dart-review.googlesource.com/c/81400
Auto-Submit: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-10-25 17:37:44 +00:00
Johnni Winther 8b6f8969a6 Support post-inference serialization/deserialization
Currently handling Swarm in-memory serialization/deserialization.

Change-Id: I4b01f70d1e42d7462ed079ece227d6c2ed4de597
Reviewed-on: https://dart-review.googlesource.com/c/80445
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Auto-Submit: Johnni Winther <johnniwinther@google.com>
2018-10-22 14:37:04 +00:00
Stephen Adams f0a116d339 [dart2js] Some tear-off cleanup
Replace jsArguments with isIntercepted

Change-Id: I440a86fb411d3e278fa60ed86e5d43c5efb79033
Reviewed-on: https://dart-review.googlesource.com/c/80721
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-10-19 02:37:49 +00:00
Sigmund Cherem ef870b25e6 Dont complain about TypeImpl in switch cases
As discussed earlier today: even though TypeImpl overrides ==, all other
implementations do not and most switch cases handling type literals work as
intended.

We however continue to consider this a bug that needs to be fixed in the future
by canonicalizing types in dart2js.

Change-Id: Id8b1a6a84e7bb1859398456ef70f25b7301f9fe4
Reviewed-on: https://dart-review.googlesource.com/c/80703
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Auto-Submit: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-10-18 23:18:16 +00:00
Stephen Adams 0aa2dc6ead Batch 'inherit'
- Add an inheritMany method for the common case of many subclasses.
- Copy helper functions to locals to get js-minification of helpers in main part.

Change-Id: Ideff5ebe90e5ad7a3728290772c5b8bd4d6f580b
Reviewed-on: https://dart-review.googlesource.com/c/80525
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-10-18 03:48:12 +00:00
Johnni Winther 843b4c9c23 Refactoring to prepare for serialization
- pipes GlobalLocalsMap, ClosureData and OutputUnitData through JClosedWorld

Change-Id: Id1d8353a9c75217aab7e06a276bfb503f50a5811
Reviewed-on: https://dart-review.googlesource.com/c/79683
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Auto-Submit: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-10-17 12:05:05 +00:00
Johnni Winther 2a9ba09b93 Allow abstract operator == methods in switch case constants
Change-Id: I14800a050f10ced1fd2d029b006b1d55c0cfb32c
Reviewed-on: https://dart-review.googlesource.com/c/80141
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Auto-Submit: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-10-17 07:22:53 +00:00
Stephen Adams ee975c89e2 [dart2js] Force --fast-startup holders to be fast objects
Change-Id: I85ff6abc8bbde42fa7c35637776a1120a573f2f8
Reviewed-on: https://dart-review.googlesource.com/c/80380
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-10-17 04:23:53 +00:00
Stephen Adams dac3e0d9df [dart2js] Don't create instance call-through stubs for statics
Change-Id: I10f5586c9ef8450dbe67d12b50c7fb7e8cb74ba1
Reviewed-on: https://dart-review.googlesource.com/c/79460
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-10-12 19:24:15 +00:00
Johnni Winther dc9d6785de Report compile-time errors on invalid switch cases
This is a temporary fix for issue 32557 until CFE handles it.

Change-Id: I4f0cfa5a98af6b25536f0c8e0a257940f8ce708b
Reviewed-on: https://dart-review.googlesource.com/c/79561
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Auto-Submit: Johnni Winther <johnniwinther@google.com>
2018-10-12 17:52:12 +00:00
Peter von der Ahé ddf67772bb Remove warning about inferring packages URI from dart2js
Change-Id: I37ee171b0359e1fa6720d7af9e403f4dfab76e9e
Reviewed-on: https://dart-review.googlesource.com/c/79480
Auto-Submit: Peter von der Ahé <ahe@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-10-12 07:37:23 +00:00
Stephen Adams bd223d0ec4 Add consistent_type_error_test
Change-Id: Ic48765468dcdd19371291a32514b9b04012a762a
Reviewed-on: https://dart-review.googlesource.com/c/79146
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-10-12 00:52:25 +00:00
Sigmund Cherem 0cdd5b9ff3 Raise warning to error: duplicate key in a const map is now an error in Dart.
Eventually the plan is to handle this in the CFE when it performs
constant-evaluation, but for now we can check this in dart2js
(see https://github.com/dart-lang/sdk/issues/32983)

Change-Id: Ic2e5cfd96961094e634da201c55f82398c060aca
Reviewed-on: https://dart-review.googlesource.com/c/79421
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-10-12 00:18:34 +00:00
G?nter Z?chbauer 2da0b9f4f1 fix some typos
Closes #34738
https://github.com/dart-lang/sdk/pull/34738

GitOrigin-RevId: d211bbacfe65355cf7304c990ffb6c79d7a229cf
Change-Id: If690e6d378e543b300e1f6a353ceae73e39c29db
Reviewed-on: https://dart-review.googlesource.com/c/78900
Reviewed-by: Alexander Thomas <athom@google.com>
2018-10-10 19:15:30 +00:00
Peter von der Ahé f1b6d81404 Remove Target.strongMode
Change-Id: I60f72904f4a9ae3427b2a2633a22f70a6b6f8ea9
Reviewed-on: https://dart-review.googlesource.com/c/79020
Commit-Queue: Peter von der Ahé <ahe@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-10-10 12:49:18 +00:00
Peter von der Ahé 8c872e0e3a Remove TargetFlags.strongMode
Change-Id: Ibf8661e5444d16666c54f1d81c626893b000521a
Reviewed-on: https://dart-review.googlesource.com/c/78986
Commit-Queue: Jens Johansen <jensj@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-10-10 12:11:41 +00:00
Stephen Adams 2a3a5c88c7 [dart2js] Omit empty parts in --fast-startup
If all the components of a part-file are empty, the part file can be
removed.

On one app reduces number of parts from 710 to 599.

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

Change-Id: I043d723645fd43c953536c82199ac41f43010c12
Reviewed-on: https://dart-review.googlesource.com/c/78190
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-10-08 19:25:33 +00:00
Stephen Adams f96362ccfd [dart2js] Smaller code by caching values
- Move more that one assignment into var-list
- Move 'this' to a local variable
- Move repeated large 'fast' constants to local variable

Currently under flag --experiment-code-1


Change-Id: I091cab47f498b4ec3759b9ed358bcc0f2e73fdb1
Reviewed-on: https://dart-review.googlesource.com/c/77025
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-10-08 17:40:19 +00:00
Johnni Winther 127c3fed6c Handle data URIs in dart2js
Change-Id: Ifca03b51aa16e2b4676490c94dafe335e1a94171
Reviewed-on: https://dart-review.googlesource.com/c/76901
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-10-08 13:00:34 +00:00
Johnni Winther 073f6e8623 Register type arguments on generic super invocations.
Closes #34701

Change-Id: Ib0e575213c87be915cbfaff101e4421352030e87
Reviewed-on: https://dart-review.googlesource.com/c/78360
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-10-05 22:25:57 +00:00
Stephen Adams 7e77c29989 Revert "Test necessity of dart2js function name-setting code"
Change-Id: I2ffa8aa6dcba5753ac5feea41f2fcc840fd349e0
Reviewed-on: https://dart-review.googlesource.com/c/78191
Reviewed-by: Stephen Adams <sra@google.com>
2018-10-05 03:01:42 +00:00
Stephen Adams 1c2f15f9e3 Test necessity of dart2js function name-setting code
This is a probe CL to see if some code can be removed on IE11.

Change-Id: I506c95c6325ecf3ce2a39f03e5d8bc50e61289ec
Reviewed-on: https://dart-review.googlesource.com/c/78151
Reviewed-by: Stephen Adams <sra@google.com>
2018-10-05 02:30:28 +00:00
Peter von der Ahé 29d57107dd Move dependency_walker to package:analyzer
Change-Id: I9882c2be31366cc85a1623a2b324ce4ec200aa20
Reviewed-on: https://dart-review.googlesource.com/c/77804
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-10-03 12:25:06 +00:00
Peter von der Ahé 248954117a Consolidate dart2js front-end dependencies
Also, convert dart2js to use onDiagnostic.

Change-Id: Ifdf89349eaf2ebe8cfcd1994712b3d1be2dd4197
Reviewed-on: https://dart-review.googlesource.com/77400
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-10-02 12:34:28 +00:00
Johnni Winther 41a875f420 Fix (super)mixins issues
Change-Id: I5892f2fec7fc7b7449fb600c74e4d105dc0f4bbe
Reviewed-on: https://dart-review.googlesource.com/77180
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Auto-Submit: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-09-28 23:03:24 +00:00