Commit Graph

4835 Commits

Author SHA1 Message Date
Johnni Winther 898a1ae1aa Handle synthesized multiple inheritance
The reuse of mixin applications employed by kernel introduces unneeded
multiple inheritance (the same class implemented with different type arguments).
The type system in dart2js does not support multiple inheritance and flags such
cases as compile-time errors.

With this CL such synthesized cases are bypassed, while regular cases are still flagged.

Change-Id: Ieb07d2b6559e15a7b745baeddc80c07acff7a3d1
Reviewed-on: https://dart-review.googlesource.com/15886
Reviewed-by: Emily Fortuna <efortuna@google.com>
2017-10-23 18:04:22 +00:00
Johnni Winther 9bf7fc9130 Add test of index operations
Change-Id: I34e5cf8ba7bdd38a2b4094c71bc0e71c4a68c613
Reviewed-on: https://dart-review.googlesource.com/13802
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-23 08:26:43 +00:00
Johnni Winther 222af2dd08 Compute side effects during inference.
Change-Id: Iad5567cb76c8725b19446b6a802e6e704d42e99e
Reviewed-on: https://dart-review.googlesource.com/13800
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-23 07:37:18 +00:00
Johnni Winther b2e7058747 Specialize list constructors in inferrer
+ handle native methods and js-interop constructors

Change-Id: I901301bf6d4926e6ecb1e427e3d16e512d888aab
Reviewed-on: https://dart-review.googlesource.com/13722
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-23 07:29:51 +00:00
Emily Fortuna ba3cc12592 Entity-ify trustType in type_builder.
Bug:
Change-Id: Ie58b98f5a23268e97d2730f4f694d125ae9baf93
Reviewed-on: https://dart-review.googlesource.com/15060
Reviewed-by: Stephen Adams <sra@google.com>
2017-10-19 17:15:20 +00:00
Harry Terkelsen f36b1f49d6 Only set model.scopeInfo for the outer member, not nested closures
Change-Id: I848e18e1000158b4a198782227bfb2524104e805
Reviewed-on: https://dart-review.googlesource.com/14700
Reviewed-by: Emily Fortuna <efortuna@google.com>
2017-10-18 21:00:06 +00:00
Emily Fortuna 2b33f79dd1 Update localsMap when inlining or looking at super constructors.
Bug:
Change-Id: I60b2d0d87d84901817d7d03b685a068c9d2f6100
Reviewed-on: https://dart-review.googlesource.com/14621
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2017-10-18 17:58:32 +00:00
Emily Fortuna af3bbc194b Fix up dart2js argument passing of 'platform-binaries' so that it actually recognizes the flag.
Bug:
Change-Id: I632dc8ea1e1c145cbb93a8cb7ba061c0d2ebc948
Reviewed-on: https://dart-review.googlesource.com/14508
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Emily Fortuna <efortuna@google.com>
2017-10-17 21:02:31 +00:00
Peter von der Ahé 6cc2014b3d Fix computePlatformBinariesLocation for Windows.
Change-Id: Ic64e9c7a10923fe2e3f99ef708c2f19bb9ae802e
Reviewed-on: https://dart-review.googlesource.com/14420
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2017-10-17 12:46:10 +00:00
Peter von der Ahé b96ac4520a Update most clients to use computePlatformBinariesLocation.
Change-Id: I6e6960c471b2fab3f0cd8a672da05d7699217410
Reviewed-on: https://dart-review.googlesource.com/12291
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-17 10:48:40 +00:00
Emily Fortuna e3d0a7093c Test TypeVariables in isTest correctly (and non-type variables) in Kernel.
Bug:
Change-Id: I624e7a111841bcab77d370163ac21d2c5cc3010a
Reviewed-on: https://dart-review.googlesource.com/13681
Reviewed-by: Stephen Adams <sra@google.com>
2017-10-14 00:20:44 +00:00
Harry Terkelsen cbfb3b642d Treat async-for-in statements as if they are wrapped in a try-finally
Change-Id: Ide40e69f93db199e2b452a4ee5acbbabe331bcbf
Reviewed-on: https://dart-review.googlesource.com/13921
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
2017-10-13 22:19:46 +00:00
Johnni Winther f80860ddbd Track exposure of this in inferrer
Change-Id: I07d899ed59fd28ffe258c518743c66aa20fa0540
Reviewed-on: https://dart-review.googlesource.com/13480
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-13 07:50:35 +00:00
Brian Wilkerson a22c8dc958 Recover when enum constants have metadata
Change-Id: I1432c3b2d4ce63c5520087c79dd33e48c57cee5b
Reviewed-on: https://dart-review.googlesource.com/13102
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-10-12 20:50:31 +00:00
Johnni Winther 99af2fef35 Handle initializers in inferrer.
Change-Id: I0f21682448da8e427a73b849c8e6c8cc523c8201
Reviewed-on: https://dart-review.googlesource.com/12940
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-12 08:08:03 +00:00
Johnni Winther 0daecdf552 Skip captured variables in refinement.
Change-Id: Iad54833db0dbdc683790fccec3dca4f5cf435657
Reviewed-on: https://dart-review.googlesource.com/12442
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-12 07:59:13 +00:00
Sigmund Cherem 606e8502f8 fix recovery on ||= and &&= in dart2js
Bug: https://github.com/dart-lang/sdk/issues/31061
Change-Id: I3f8667d5dab92d256122484a6fc83b3527228085
Reviewed-on: https://dart-review.googlesource.com/12760
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-10-11 22:37:17 +00:00
Harry Terkelsen d62eb05435 Search for members in superclasses when searching for a class member
This changes 'hasConcreteMatch' to search the superclass chain in the
kernel implementation. This matches what the Element model does.

Change-Id: I6a0ab69bc7e6fe705139d6fa69fffc2346582702
Reviewed-on: https://dart-review.googlesource.com/12843
Commit-Queue: Harry Terkelsen <het@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-10-11 22:07:11 +00:00
Paul Berry 7df0fb6c28 Add type propagation support for conditional expressions.
This required adding a few extra parser events to allow the type
propagator to update its state when the `?` and `:` are encountered
(similar to what was done for `if`).

Fixes #30620.

Change-Id: I0d3ede8056fd8bab01ead5b242d00803286c9373
Reviewed-on: https://dart-review.googlesource.com/13182
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-10-11 20:21:22 +00:00
Emily Fortuna a40fd8b507 Fixed up JS Interop, correct "native" detection, and made HN angular app run!
Bug:
Change-Id: Iea339d62d891661d6d1415424b12ac3f914b046e
Reviewed-on: https://dart-review.googlesource.com/12460
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-10-10 18:26:54 +00:00
Sigmund Cherem ec49b67b19 Split init.metadata by deferred chunk
Bug: http://dartbug.com/30002
Change-Id: I532f122a9b10054a51e40c49b3759c0af471370e
Reviewed-on: https://dart-review.googlesource.com/9140
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Florian Loitsch <floitsch@google.com>
2017-10-09 19:41:15 +00:00
Harry Terkelsen 954aa98da5 Use the RHS as the return value for super set exprs
Change-Id: If456ee64873354cd0cfb61024982e35ce5e97149
Reviewed-on: https://dart-review.googlesource.com/12241
Commit-Queue: Harry Terkelsen <het@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-09 18:53:55 +00:00
Peter von der Ahé 2080faff8c Remove stale references to patched_dart2js_sdk/platform.dill.
Change-Id: I8b7b4274ef64f0b6f6c5a31ba654e8fb44843161
Reviewed-on: https://dart-review.googlesource.com/12283
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-10-09 14:36:55 +00:00
Johnni Winther da3eff3cbf Handle if-null and conditional access in inferrer
- including refinement of locals

Change-Id: I0a77f406ae734fc7823832e1835a8454c975cc85
Reviewed-on: https://dart-review.googlesource.com/12140
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-06 20:49:16 +00:00
Johnni Winther a6bc13adb9 Refine locals in inferrer.
Change-Id: I3d43f739e680bba7b08f0cf004745a03e52c2f30
Reviewed-on: https://dart-review.googlesource.com/11923
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-06 20:14:51 +00:00
Johnni Winther a39a5729b2 Handle optimizer hints in inferrer.
Change-Id: I2daac411c59a491a8860e6bfc1c85a653816d411
Reviewed-on: https://dart-review.googlesource.com/11920
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-06 20:05:38 +00:00
Johnni Winther 9e1532121e Handle await, await for, and yield in inferrer.
Change-Id: Idd3c86a095493ca37997388f4e531d7cb5e0a772
Reviewed-on: https://dart-review.googlesource.com/11900
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-06 19:59:24 +00:00
Harry Terkelsen f690f6225e Use the validating constructor when creating a Symbol.
Change-Id: Iae150ad036f8a72dcc853b86ecd01c569d28bd0b
Reviewed-on: https://dart-review.googlesource.com/11963
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-06 19:54:47 +00:00
Peter von der Ahé fa08584fe6 Pass dart2js verbose flag to Fasta.
Change-Id: I96cae3c752dd42888108d0893f1200aa06da8f4b
Reviewed-on: https://dart-review.googlesource.com/11660
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-10-06 15:35:43 +00:00
Peter von der Ahé 16aa720d27 Remove compiling platform.dill from patch_sdk.dart
This separates compiling platform.dill files from the patch_sdk.dart
script. The motivation for that is that I'm working on reading patch
files directly from Fasta, so we can completely remove the build step
for generating patched_sdk and dart2js_patched_sdk.

Short-term this should allow Paul to add a strong-mode version of
platform.dill without causing to many conflicts with my work on
patches.

Change-Id: I1150845b2986348d4fffe27092701d8a9b57ea54
Reviewed-on: https://dart-review.googlesource.com/11506
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-10-06 15:34:37 +00:00
Harry Terkelsen 52208dd84d Report error if const constructor has a non-const field
Change-Id: Ifa3a000210752a1ec389b28c290900d05244fee5
Reviewed-on: https://dart-review.googlesource.com/11243
Commit-Queue: Harry Terkelsen <het@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-10-05 19:53:26 +00:00
Johnni Winther 02d63285ab Handle switch in inferrer
Change-Id: I4e226b1bf15d3fdcd04edba08433298f0b2147e3
Reviewed-on: https://dart-review.googlesource.com/11060
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-05 08:45:23 +00:00
Johnni Winther 42c6bea376 Handle break, continue and labeled statements in inferrer
Change-Id: I16968260e774c9cb8a002fd1f027dcef2db605fe
Reviewed-on: https://dart-review.googlesource.com/10882
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-05 08:19:13 +00:00
Johnni Winther d2bb9ed06c Handle asserts in inferrer
Change-Id: If0d5eb8a15d5378a05a269aef976c914c21bb517
Reviewed-on: https://dart-review.googlesource.com/11000
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-05 07:50:19 +00:00
Johnni Winther 693cce1387 Handle as and rethrow in inferrer
Change-Id: I2528939c8e76e4445a434e48967187666356a049
Reviewed-on: https://dart-review.googlesource.com/10881
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-05 07:33:51 +00:00
Johnni Winther 85e77d5a8c Remove Rasta and friends
Change-Id: Ifb14444673c31f4e337fd4d3a2639938fc9e68dc
Reviewed-on: https://dart-review.googlesource.com/11040
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-05 07:03:55 +00:00
Johnni Winther 717b5aac61 Remove --use-kernel-in-ssa option
Change-Id: I3bfc78903cbdb6b15f428bd32d8074b5b9eb5156
Reviewed-on: https://dart-review.googlesource.com/10862
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-05 06:54:16 +00:00
Dan Rubel efeaa0eab3 Class header recovery
This updates the fasta parser to handle out of order clauses
in the class header similar to analyzer.

Also:
* Fix parseTopLevelDeclaration in parser test proxy
* Fix parseStuff to correctly update token stream
* Extract skipUnexpectedTokenOpt
Change-Id: Ic20c0ab1355e866aa241c591ceeada390890c46a
Reviewed-on: https://dart-review.googlesource.com/9880
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-10-04 21:33:09 +00:00
Emily Fortuna 0eca8a1748 Add RTI while walking closure info.
Bug:
Change-Id: If1b33706d3b7a784f292a9f133779109109d8d25
Reviewed-on: https://dart-review.googlesource.com/8321
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-04 19:24:31 +00:00
Sigmund Cherem 64fa2ad383 Delete the lazy emitter
Change-Id: I6aff22c1106ee03604c888226e961e208b621de4
Reviewed-on: https://dart-review.googlesource.com/10802
Reviewed-by: Emily Fortuna <efortuna@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-10-04 19:23:55 +00:00
Johnni Winther 9f9b7bf520 Handle super get/set/invoke in inferrer
Change-Id: I4c3cd2ae4d99abb4de4edffc644e646f6eeca029
Reviewed-on: https://dart-review.googlesource.com/10460
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-04 08:07:46 +00:00
Johnni Winther 8b96d1be59 Handle throw and enums
Change-Id: If7a957630f50a225422aaa233e3cb3ef2a005025
Reviewed-on: https://dart-review.googlesource.com/10400
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-04 07:52:42 +00:00
Johnni Winther 6f24e3d7db Handle static get/set in inferrer
Change-Id: I12566847ba34abfac8550a2ffd5df4a730a8644c
Reviewed-on: https://dart-review.googlesource.com/10360
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-04 07:31:27 +00:00
Harry Terkelsen 9e1bb63a2f Report invalid symbol constructor invocations
Change-Id: I03fe476639414969b831e93ed3461445cca89156
Reviewed-on: https://dart-review.googlesource.com/10801
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Harry Terkelsen <het@google.com>
2017-10-03 23:43:02 +00:00
Sigmund Cherem d96b29378a Delete use of rasta and dartk from perf.dart scripts.
Change-Id: Id8cd7f01c68dbcb6f814ef51627a2f4b377f6819
Reviewed-on: https://dart-review.googlesource.com/9790
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2017-10-03 23:12:21 +00:00
Harry Terkelsen dfb71004c7 Register seen classes as part of the impact.
This allows us to construct the class hierarchy from the impact results.

Change-Id: Id10a197eb80e60d5e25e093ffdadf8d0af092ecf
Reviewed-on: https://dart-review.googlesource.com/10208
Commit-Queue: Harry Terkelsen <het@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-10-03 21:36:33 +00:00
Brian Wilkerson b4d179e58a Recover from missing identifiers
Change-Id: I3c7a908449861eeed0915c4d74b10f4d1e46fde4
Reviewed-on: https://dart-review.googlesource.com/7558
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2017-10-03 13:41:02 +00:00
Florian Loitsch c0145281c0 Use function.name, instead of copying it into a new property.
This relands https://dart-review.googlesource.com/c/sdk/+/8221 with a small fix in the emitter.

Change-Id: I49f517c367a4f1ff3dcb942d899c84507e5f5b20
Reviewed-on: https://dart-review.googlesource.com/10100
Commit-Queue: Florian Loitsch <floitsch@google.com>
Reviewed-by: Florian Loitsch <floitsch@google.com>
2017-10-03 08:29:48 +00:00
Johnni Winther dfb749b7c9 Handle try in inferrer
Change-Id: Ia58e9efcea893f9c0ba591a9b8e80ada9a27eca7
Reviewed-on: https://dart-review.googlesource.com/10080
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-03 07:54:43 +00:00
Johnni Winther 083e1e52ab Handle do/for statements in inferrer
Change-Id: I22e0e0feb3bf6f5a440a7dab95af9944040329b0
Reviewed-on: https://dart-review.googlesource.com/10020
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-10-03 07:46:17 +00:00