Commit Graph

4088 Commits

Author SHA1 Message Date
Johnni Winther a86621318d Delete CompileTimeConstantEvaluator
Change-Id: I025566965d992829e93e84912d68317f145d96b2
Reviewed-on: https://dart-review.googlesource.com/54885
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-15 08:37:29 +00:00
Johnni Winther 76ab610097 Remove parser listeners and partial elements
Change-Id: Ifb5fffdca3a0e4f2bca7c35ae3c1a99490978ebf
Reviewed-on: https://dart-review.googlesource.com/54882
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-15 08:37:29 +00:00
Johnni Winther aeaa3b05c4 Remove more parts of resolution
Change-Id: Ic32851c32f4119b9682bb8538cfd7aa745ca7f09
Reviewed-on: https://dart-review.googlesource.com/54880
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
Johnni Winther 049d41ee36 Delete AST-based SSA builder
Change-Id: I16aa702eae335a01163a3b79d36bf4e60561756e
Reviewed-on: https://dart-review.googlesource.com/54841
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-15 08:37:29 +00:00
Johnni Winther 4fbd22c9e2 Remove AST-based inference
Change-Id: I368630e15d08ecbc0fdee288985746f90477159b
Reviewed-on: https://dart-review.googlesource.com/54822
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-15 08:37:29 +00:00
Stephen Adams 65c4eebcf6 [dart2js] $async$self does not require a temp
Change-Id: Ief44aa36b67928cf33176410ebf1dfd5c794b024
Reviewed-on: https://dart-review.googlesource.com/55040
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-05-15 00:29:48 +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
Harry Terkelsen fe51bb1b14 Don't eagerly enqueue JS helpers when we see a native class
We no longer eagerly enqueue defineProperty, toStringForNativeObject,
or hashCodeForNativeObject. We only enqueue convertDartClosureToJS
when needed.

For the following 'Hello World' program, code size dropped from 33175 to 10066:

```
import 'dart:html';

main() {
  window.console.log('Hello World');
}
```

Change-Id: I47860b44b572f7a162fc95c9cccefdc9012810dd
Reviewed-on: https://dart-review.googlesource.com/54500
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Harry Terkelsen <het@google.com>
2018-05-14 18:11:09 +00:00
Johnni Winther d0d265b5a7 Remove GraphBuilder.commonMasks
Change-Id: I477054bf4d05772e1c2e3d14a0862b8528661fcb
Reviewed-on: https://dart-review.googlesource.com/54390
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-14 08:29:57 +00:00
Johnni Winther c71e680152 Delete ResolverVisitor and friends
Change-Id: I012a86ca2d0f1986b226f1e4fea20ee295ccb6ed
Reviewed-on: https://dart-review.googlesource.com/54409
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-14 08:14: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
Johnni Winther d4c7a444fe Support isTry optimization in phi-nodes for kernel
Change-Id: Ia9c4b239b135eab7a7d02773b89b614407119156
Reviewed-on: https://dart-review.googlesource.com/54389
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-05-14 08:12:09 +00:00
Stephen Adams c75cbdff05 [dart2js] unreachable-throw experiment
Make functions that are unreachable throw if entered.
Use like this:

DART_VM_OPTIONS='-Dunreachable-throw=true' dart2js ...

TBR=sigmund@google.com

Change-Id: Ia4ebab797143886f87f36bc696accfb65b36f478
Reviewed-on: https://dart-review.googlesource.com/54740
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-11 23:27:42 +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 ca7a70ff41 Omit type-bound checks on type parameters when '--omit-implicit-checks' is enabled
Change-Id: Idd721d4b36a04afc5b855e280f8494367e97430f
Reviewed-on: https://dart-review.googlesource.com/54627
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-05-10 20:48:15 +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 b294e48bdf Hack to fix sort order
TBR=sigmund@google.com

Change-Id: I3771405638f85d2f6d3b3a883d00b88114fc49d3
Reviewed-on: https://dart-review.googlesource.com/54525
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-05-09 21:10:57 +00:00
Stephen Adams e5820f7e94 Place generator body in same unit as entry
Change-Id: I897bf8011bde7fcc1acb081c75f17429b948e109
Reviewed-on: https://dart-review.googlesource.com/54524
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-05-09 20:45:47 +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 df9af04061 Remove CompilerOptions.useKernel
Change-Id: I9ea69addeb18e061280329c233a110fe2d8ca763
Reviewed-on: https://dart-review.googlesource.com/54240
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-09 10:13:32 +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
Lasse Reichstein Holst Nielsen 862a894de6 Make cast do the same things as retype.
Deprecate `retype` and forward it to `cast`.

Change-Id: Ie17ffdd1eef0d3f19582bf638c5349927c7b5ebd
Reviewed-on: https://dart-review.googlesource.com/53802
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-05-09 08:00:08 +00:00
Sigmund Cherem 3beb7fe860 Fix how we pass the type-parameter to StreamIterator in for-in
Change-Id: If2b33bc9bbee93e67f6da621db0287730b61b223
Reviewed-on: https://dart-review.googlesource.com/54311
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-05-08 23:01:58 +00:00
Johnni Winther 51fa3f3b0c Decouple HNode from TypeMask
Change-Id: Ie13d928d51ad7e080ad13402bed3c974da66a2c4
Reviewed-on: https://dart-review.googlesource.com/54020
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-05-08 11:20:44 +00:00
Johnni Winther d3c7df35b4 Revive AbstractValueDomain
- to decouple inference results from TypeMask.

Change-Id: Ibe2ec234e84262c5bff169ec7068ca1419706029
Reviewed-on: https://dart-review.googlesource.com/53942
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-08 11:20:44 +00:00
Johnni Winther 4b53f7e0d2 Remove useOldFrontend testing from TypeEnvironment
Change-Id: I0d62b83073ce5c7008f85c0c32b74c9b70cc4eb0
Reviewed-on: https://dart-review.googlesource.com/53960
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-08 08:31:43 +00:00
Johnni Winther 27ae11e4d8 Filter instantiation stubs
Closes #32992

Change-Id: Ib0521f24eb734b42a1a55663119204220f263265
Reviewed-on: https://dart-review.googlesource.com/53740
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-05-08 07:46:33 +00:00
Sigmund Cherem 2e1c17e5c1 Revert "dump-info: Use relative paths for library canonicalUri..."
This reverts commit 7fe8659613.

Reason for revert: we decided to take an alternative approach to solve the problem.

Original change's description:
> dump-info: Use relative paths for library canonicalUri...
> 
> ...if they are within the working directory
> 
> Makes output from dump-info more stable, especially with pkg:build
> 
> Change-Id: I3e6c444a0aa7df55c10e1bdff4b59ef035d2acc3
> Reviewed-on: https://dart-review.googlesource.com/53168
> Reviewed-by: Harry Terkelsen <het@google.com>
> Commit-Queue: Kevin Moore <kevmoo@google.com>

TBR=kevmoo@google.com,het@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I701847cf8879599c3d129a83809b8fe1c9d9d172
Reviewed-on: https://dart-review.googlesource.com/54141
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-05-08 02:00:52 +00:00
Johnni Winther add1e67295 Include generic type arguments in deferred load computation.
Closes #33046

Change-Id: I1273b631e3f5b5aca8d4042b0afd972709a00068
Reviewed-on: https://dart-review.googlesource.com/53805
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-07 09:21:48 +00:00
Stephen Adams e5e4871a04 Simplify 'this' caching in constructors.
Change-Id: Ibf8659ac8f354a8cd8f6b69819b6f1154fa2227e
Reviewed-on: https://dart-review.googlesource.com/53694
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-05-03 23:33:34 +00:00
Johnni Winther d13bf49870 Check type-variable bounds on generic methods
Closes #32711

Change-Id: I86c123f5a8b9eda393b276248cdd27d1b109354b
Reviewed-on: https://dart-review.googlesource.com/53201
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-03 09:36:58 +00:00
Johnni Winther 2a8c3515b2 Avoid strong+checked mode: strong mode supersedes checked mode
Change-Id: Ic68f429ec06d583a9e60b6ace1ec88ee83a4be5f
Reviewed-on: https://dart-review.googlesource.com/53202
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-02 08:33:28 +00:00
Harry Terkelsen f8bea2a7e6 dart2js: Register inlined native methods for dump info
Change-Id: I362b56c70bff7a0afcec3374882c973ff879d48e
Reviewed-on: https://dart-review.googlesource.com/53061
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Harry Terkelsen <het@google.com>
2018-05-01 18:22:25 +00:00
Kevin Moore 7fe8659613 dump-info: Use relative paths for library canonicalUri...
...if they are within the working directory

Makes output from dump-info more stable, especially with pkg:build

Change-Id: I3e6c444a0aa7df55c10e1bdff4b59ef035d2acc3
Reviewed-on: https://dart-review.googlesource.com/53168
Reviewed-by: Harry Terkelsen <het@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
2018-05-01 16:47:26 +00:00
Johnni Winther 8351dd4928 Support constant instantiation
Closes #32774

Change-Id: I88090246d3fb39e3d3a1f9c3fdcc3b6fd6e0fa4f
Reviewed-on: https://dart-review.googlesource.com/53022
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-01 12:59:18 +00:00
Johnni Winther d85c175a22 Register deferredLoadlibrary as backend impact
Closes #32998

Change-Id: If2a0a948f1209652925be360f7f145ebfdb3d60d
Reviewed-on: https://dart-review.googlesource.com/53008
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-01 11:05:31 +00:00
Johnni Winther 54b8ebd992 Support js-interop classes that implement generic types in Dart 2
This adds a special RTI representation for a type argument of a
(supertype of a) js-interop class, which effectively is the Dart 1
`dynamic` type.

Closes #32969

Change-Id: Ifd92b3fc6779d96d354ad929bd7c07a349299ae6
Reviewed-on: https://dart-review.googlesource.com/53002
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-01 08:37:11 +00:00
Johnni Winther 20c7725954 Handle deferred constant instantiations
Closes #32997

Change-Id: I31661bb223ca9d9bdee2e7cabe4e62bf18e87509
Reviewed-on: https://dart-review.googlesource.com/53007
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-01 08:31:01 +00:00
Stephen Adams d6a3b85ed2 Use factory methods for async/sync*/async* transforms
The static methods allow type parameters to be registered,
but this means that the type parameters will be dropped unless in strong mode.

Change-Id: I91c1977c287c14742df7d59b988e64ddc46f794d
Reviewed-on: https://dart-review.googlesource.com/52870
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-04-30 22:32:56 +00:00
Sigmund Cherem 3c9d0858b0 dart2js: turn on sync-async by default
Closes https://github.com/dart-lang/sdk/issues/32869

Change-Id: I79b2d02d13adccdfbbd3a78158805244aceff7de
Reviewed-on: https://dart-review.googlesource.com/52061
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-04-27 19:48:46 +00:00
Johnni Winther 93511d523c Track RTI for noSuchMethod
Change-Id: I1fd66c48061556f8950bad471744eab4e2f40eb7
Reviewed-on: https://dart-review.googlesource.com/52560
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-04-26 08:07:02 +00:00
Johnni Winther 5e72411c5c Add InstantiationConstantExpression/Value
Change-Id: I2f471560a076e79f944fa70000de4be50385ae18
Reviewed-on: https://dart-review.googlesource.com/52443
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-04-25 09:37:29 +00:00
Stephen Adams 405dd275e9 Add --benchmarking-production flag
Adding the flag to dart2js means we can change the 'best' set of flags
without updating the benchmarking insfrastructure.

Change-Id: I7b4015819fab8c79ae5736c76c3cb5eda94b57f5
Reviewed-on: https://dart-review.googlesource.com/52523
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-04-24 22:13:08 +00:00
Johnni Winther e5a2fe6435 Update jump, side effect and inlining tests to test strong mode
Change-Id: I0c8073f5bc72fae63b012033dc23b15c1913fec7
Reviewed-on: https://dart-review.googlesource.com/52223
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-04-24 08:37:24 +00:00
Stephen Adams bcc5e6ed42 dart2js: Fix Iterable<T> type check
Bug: https://github.com/dart-lang/sdk/issues/32810
Change-Id: I0d34185725bd9cbd627a5da66d3ef5eea5b7e4dd
Reviewed-on: https://dart-review.googlesource.com/52402
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-04-24 04:51:54 +00:00