Commit Graph

3739 Commits

Author SHA1 Message Date
Stephen Adams 38467cca03 Track always-initialized-to-null fields
Change-Id: Idb4d3a0395ce73eaaa4fc15a8df3bceaa4821b4f
Reviewed-on: https://dart-review.googlesource.com/57525
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-06-04 21:05:01 +00:00
Johnni Winther 82755aa303 Rename ClosedWorld to JClosedWorld and merge it with ClosedWorldRefiner
Change-Id: I858695194fe4b0dffb7c85a93e2d6bcc04dd6229
Reviewed-on: https://dart-review.googlesource.com/58022
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-06-04 09:22:41 +00:00
Johnni Winther b58cc36ddc Extract KClosedWorld from ClosedWorld.
Change-Id: I2db59cea5081fde2f0b35c6518d6b618df617ac1
Reviewed-on: https://dart-review.googlesource.com/57827
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-06-04 09:22:41 +00:00
Stephen Adams 56424f08a8 [js_runtime] Test for JavaScriptFunction type tests.
- Add test for JavaScriptFunction type tests
- Make toString() for JavaScriptFunction more explicit.

Change-Id: I60042b909709c822c924336fd4973f35dc7f779a
Reviewed-on: https://dart-review.googlesource.com/58062
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-06-02 00:40:24 +00:00
Johnni Winther f3502f9051 Fix bug in RTI optimization
Change-Id: Iec3026f0a79ac54dd125e15f00e4beb21e9a371c
Reviewed-on: https://dart-review.googlesource.com/58020
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-06-01 22:20:59 +00:00
Johnni Winther b75da964ef Move all type mask code to inferrer/typemasks and use it via an AbstractValueStrategy
Change-Id: Ib6f0089b0fee05488fea9295cbb5df944bb29d49
Reviewed-on: https://dart-review.googlesource.com/56980
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-31 16:15:32 +00:00
Johnni Winther 39b0efd613 Handle generic jsinterop classes as type arguments.
Change-Id: I89d8a77d632cf6d4f8adffa84f042a1c03a79f26
Reviewed-on: https://dart-review.googlesource.com/56665
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-05-31 07:50:52 +00:00
Johnni Winther 3dd70ce67b Usa AbstractValue in the rest of ssa
Change-Id: Id29d7bdaaeaa0fb6dfd4f5fbba50468cd474cd8e
Reviewed-on: https://dart-review.googlesource.com/56664
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-31 07:26:52 +00:00
Emily Fortuna e7bad54986 Make dart2js only run with 64 bit ints, not the larger ints from the vm.
Change-Id: I03887a0af963f1a8f68acff0428635fc130687f5
Reviewed-on: https://dart-review.googlesource.com/57041
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-05-30 17:21:49 +00:00
Johnni Winther 9d9eff44c9 Support sharing function signatures in deferred parts for fast startup
Change-Id: I2ee08817241512269fe04d7fb0e3367df847d37a
Reviewed-on: https://dart-review.googlesource.com/56940
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-05-30 13:25:48 +00:00
Peter von der Ahé 2514a67614 Import link.dart directly
I'd like to deprecate and remove the Link class,
as best as I can tell, it doesn't offer the same
performance benefits as I've seen on other platforms.

Fasta mostly uses "null" to represent empty lists, and
after the old dart2js front was deleted, there are few
uses remaining.

This CL makes it easier to find the remaining uses.

Change-Id: I73ac9b6b8b1bf5fed9669ae939cb3252cedbef0f
Reviewed-on: https://dart-review.googlesource.com/56781
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-05-29 07:40:27 +00:00
Peter von der Ahé 990c85276b Avoid allocation and bottom-type on Link
Change-Id: Ib23e596edf55285cc63e3a391da3712b2bcb1224
Reviewed-on: https://dart-review.googlesource.com/56761
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-05-29 07:40:27 +00:00
Johnni Winther 6b7f3d5f54 Share non-generic signatures through init.types
Change-Id: Ie132bbe805780022c91e5578c8dc4636c3c4cc8b
Reviewed-on: https://dart-review.googlesource.com/56671
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-05-28 07:40:24 +00:00
Johnni Winther 89514bd8cf Cleanup library_loader.
Change-Id: I0255580cd9292bcd3a5997c7d97d83b25d888372
Reviewed-on: https://dart-review.googlesource.com/55960
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-24 09:52:50 +00:00
Johnni Winther 18407141b7 Split deferred load entity computation by class, member and local function
Change-Id: Ifb612de6ac945d2ececa96871f0eb3fc5ceb4052
Reviewed-on: https://dart-review.googlesource.com/55896
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-24 09:52:50 +00:00
Johnni Winther 0ec82e24ce Avoid late creation of entities.
This changes has been reviewed as part of https://dart-review.googlesource.com/c/sdk/+/55898

Change-Id: I28d41110919a592499ee7b5b7605728638bd5ea2
Reviewed-on: https://dart-review.googlesource.com/56481
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-05-24 08:01:00 +00:00
Emily Fortuna 552680b7f0 First round of changes to dart2js to make it strong mode clean.
Change-Id: Idc3612072c3cf28a4f58bbb890908f67473d8292
Reviewed-on: https://dart-review.googlesource.com/56284
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-23 21:26:04 +00:00
Stephen Adams 2c8c05f877 [dart2js] merge generator body into empty entry function
Change-Id: I99a5f16f9a22d3c3cbb4989151a8d3c7bfda16ef
Reviewed-on: https://dart-review.googlesource.com/56037
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-22 21:17:44 +00:00
Stephen Adams e1cabfd1d4 [dart2js] 'Fix' error in registrations
Restore 'overregisration' removed by
https://dart.googlesource.com/sdk/+/929b79e86533b6c409437fbc4a08cf5dfde8be75

Change-Id: I607d2bfbbaa4ea9d320b37aebba06acd1da1af19
Reviewed-on: https://dart-review.googlesource.com/56038
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-05-22 01:56:11 +00:00
Emily Fortuna 49d5ca3bb4 Switch to BigInt for ConstantValue.
Change-Id: I17eec094d794b1c4791d491ea523d284f9eae4ed
Reviewed-on: https://dart-review.googlesource.com/55500
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-05-22 01:04:41 +00:00
Stephen Adams 929b79e865 [dart2js] Don't insert redundant checks
This is in preparation for detecting if a generator header has checks.

By not registering the redundant checks (which should really done in codegen) we remove a few $isXXX flags.

Change-Id: I30deb2bc498858540cd326243798248c51ce9375
Reviewed-on: https://dart-review.googlesource.com/56006
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-21 22:23:18 +00:00
Johnni Winther ada23cde0b Add deferred test for local functions
Change-Id: I9f4b67de9435e74378af72d2a0c0fc711c0b0252
Reviewed-on: https://dart-review.googlesource.com/55891
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-18 19:33:48 +00:00
Johnni Winther f1f660fe1e Small cleanup
Change-Id: I368fbaa3bac5a5a47c374f26998cce8ad8b265a6
Reviewed-on: https://dart-review.googlesource.com/55890
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-18 19:33:48 +00:00
Johnni Winther 78f348b3d5 Don't export types/masks.dart from types/types.dart
To make uses of TypeMask explicit in the imports.

Change-Id: I7c0c2377b65720394dcda217e5e68a4e3f9a4e9c
Reviewed-on: https://dart-review.googlesource.com/55421
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-17 08:05:42 +00:00
Johnni Winther 54331b1c4b Delete elements.dart and resolution_types.dart
Change-Id: Ib50dabdbeec72ebf443e85b51b818d9ed0602b4f
Reviewed-on: https://dart-review.googlesource.com/55221
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-16 09:54:18 +00:00
Johnni Winther baf09db165 Remove Resolution and Target
Change-Id: I30fb47acd820077b0dd9efebc3460a9a8a1e6e1f
Reviewed-on: https://dart-review.googlesource.com/55200
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-16 09:54:18 +00:00
Johnni Winther 1f20129650 Remove mirrors analyses
Change-Id: I1a4a0d2bd1d87a5877864d46636ff68d0426a09c
Reviewed-on: https://dart-review.googlesource.com/55127
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-16 09:54:18 +00:00
Johnni Winther 47a67b2b8f Delete AST nodes
Change-Id: Iab9396b3a21cd9502c455fb73633216faed777ef
Reviewed-on: https://dart-review.googlesource.com/55126
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-16 09:54:18 +00:00
Johnni Winther f4fb1fe932 Remove most references to tree/tree.dart
Change-Id: I2ebcfdc616ee204e8e39277537e7e3c622caee42
Reviewed-on: https://dart-review.googlesource.com/55121
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-16 09:54:18 +00:00
Stephen Adams 8cf81446a3 Add method stubs to support instantiation stubs
Change-Id: Id9cce10b6319d268eb4ec2745465df5f06d3b906
Reviewed-on: https://dart-review.googlesource.com/55081
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-05-15 20:32:46 +00:00
Johnni Winther 3fc7925894 Add impact_test
Change-Id: Ic607d69375d1ad41f6aac349822e47c7dbf77b5a
Reviewed-on: https://dart-review.googlesource.com/54906
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-15 13:53:56 +00:00
Johnni Winther 6fe26e7e55 Delete ElementVisitor, equivalence_helper and move live Elements functions
Change-Id: I0af209210d4a471ba12f939bd8e3a429dab100df
Reviewed-on: https://dart-review.googlesource.com/54913
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-15 08:37:29 +00:00
Johnni Winther 0cd377fe33 Delete ConstantCompilerBase
Change-Id: Ib2d748d380713b742110c772fac2fe7d428b7ded
Reviewed-on: https://dart-review.googlesource.com/54911
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-15 08:37:29 +00:00
Johnni Winther f493274ce8 Delete more parts of resolution
Change-Id: I1c9ab31efa7c4a97f283275d5122c7b9a8762fb8
Reviewed-on: https://dart-review.googlesource.com/54908
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-15 08:37:29 +00:00
Johnni Winther 330271ed2b Delete modelx
Change-Id: I8f69655ee251cef097b46d80ddfbb7d2434b1051
Reviewed-on: https://dart-review.googlesource.com/54903
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-15 08:37:29 +00:00
Johnni Winther 4d76600b22 Delete SemanticSendVisitor
Change-Id: I0ccf8527e973dc5cfeac19caaaac026f91795e17
Reviewed-on: https://dart-review.googlesource.com/54860
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-05-15 08:37:29 +00:00
Sigmund Cherem a06f7c9241 Remove dart:_isolate_helper.
The rest of the code was used in a single place, so I've moved the code to the
appropriate library.

Change-Id: Idd0416bf7365e3de05f20ab1184428ae7ae614b2
Reviewed-on: https://dart-review.googlesource.com/54745
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-05-15 00:21:28 +00:00
Sigmund Cherem be77569d57 Remove old mirrors library now that the old-frontend is being deleted
Change-Id: Iea1cbb0c4422fa51e632ac03c9cd01e4916181fc
Reviewed-on: https://dart-review.googlesource.com/54744
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-05-14 21:38:07 +00:00
Johnni Winther f75db77597 Delete ScannerTask, DietParserTask and TypeCheckerTask
Change-Id: I5dede24df4583a7bd6d6d493e8f55c257bc8f0bc
Reviewed-on: https://dart-review.googlesource.com/54408
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-14 08:14:07 +00:00
Johnni Winther 14537e3a2f Delete LibraryLoader and patch parser
Change-Id: I0ea824541ec3b5b204577d4cd1da32ffba30c071
Reviewed-on: https://dart-review.googlesource.com/54405
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-14 08:14:07 +00:00
Johnni Winther 506c8819ae Delete CompilerResolution, ResolutionFrontEndStrategy at al.
Change-Id: I13698f02d5c9af878750290ad1aef8d32777684f
Reviewed-on: https://dart-review.googlesource.com/54403
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-14 08:14:07 +00:00
Sigmund Cherem 3c22fc9216 Allow null nonce
This should fix the bots for FF and safari.  (Chrome returns '', but FF and
Safari return a null value.)

TBR=sra@google.com

Change-Id: I9a402d3c9f4fed09b9181a8ec29f68ff6770e509
Reviewed-on: https://dart-review.googlesource.com/54714
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-05-11 20:41:59 +00:00
Sigmund Cherem c7683ad41b Support strict CSP in dart2js.
dart2js will now set the CSP nonce on scripts that are inserted for deferred
loads. Note that this change only applies to the default hunk loader. Custom
hooks need to set the nonce value manually.

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

Change-Id: I04abc7904dff22dad586690d175b87c77c3f1fe2
Reviewed-on: https://dart-review.googlesource.com/54702
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-05-11 17:41:07 +00:00
Stephen Adams ef6e19a83a [dart2js] Implementation of extractTypeVariables
Change-Id: I80272dade861e30440f64fe36c1bf4bb5cd2eb8a
Reviewed-on: https://dart-review.googlesource.com/54625
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-11 01:37:45 +00:00
Sigmund Cherem c25a9fd46b Remove support for dart:isolate in dart2js.
Change-Id: I1216a0ac91d8a1d13b441809596e1a8b5e51bb34
Reviewed-on: https://dart-review.googlesource.com/54526
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-05-10 01:20:17 +00:00
Stephen Adams 6efd3b3654 Refactor output code for generators
sync*/async/async* generators have two parts: an entry, which does
checks and computes the element type of the result, and a body, which
is transformed after lowering to JavaScript.

The split ensures that the code for checks is done at function call
time, rather than e.g. in the moveNext method of a sync* iterator.

A following CL with optimize the split to generate one function when
there are no checks and the type argument is simple enough for textual
substitution.

Change-Id: I5414109ca851f9267871aa113a2e29b16236986d
Reviewed-on: https://dart-review.googlesource.com/54308
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-05-09 18:22:07 +00:00
Sigmund Cherem 3ec1b929e3 Remove dependencies on isolates.
This starts removing support for isolates. I've kept around the
isolate library for now, but I stopped injecting the isolate logic
unless you directly access an isolate API.

Concrete changes:

* Timer no longer uses the event queue: this was only used in worker
isolates, soon to be removed.

* Checking for whether the code is run within a worker is not dependent
   on initializing the isolates global state. This was important to allow
   deferred-loading to work without the isolate logic.

* Workers no longer track pending async calls correctly. This may make it possible
   to terminate worker isolates early, again this wont be relevant shortly.

Bug: https://github.com/dart-lang/sdk/issues/32684
Change-Id: I05025418e05c3641ba1a3bc34ea75ca558a28fbd
Reviewed-on: https://dart-review.googlesource.com/54160
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-05-09 16:36:26 +00:00
Johnni Winther 4c7926107e Remove support for --use-old-frontend option
Change-Id: Ia6e7ded5e312cce4841ded8170fc01a51f07b098
Reviewed-on: https://dart-review.googlesource.com/54229
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-09 09:11:01 +00:00
Johnni Winther b347839ee6 Remove impact_test
A replacement is in progress in another CL.

Change-Id: Ib1eda85caa10c5e5a00f4c9e1b5c1605a2a56da6
Reviewed-on: https://dart-review.googlesource.com/54227
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-09 07:55:08 +00:00
Johnni Winther 3adb731af3 Remove id equivalence test and ast id helpers
Change-Id: Icac1794fe791f75f969a04072555468ee91fb5c4
Reviewed-on: https://dart-review.googlesource.com/54226
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-09 07:55:08 +00:00