Commit graph

25455 commits

Author SHA1 Message Date
Dan Rubel 4a27605fdc generate kernel experimental flags
Change-Id: I9430d95c012b752bc4ca0530d79252b8b032a26b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104841
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
Auto-Submit: Dan Rubel <danrubel@google.com>
2019-06-06 14:03:29 +00:00
Brian Wilkerson 3894b0896e Add partial code tests for extension methods
Change-Id: I5886c275383302566e997cb2f7e968c446b79369
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105160
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-06-06 12:41:19 +00:00
Brian Wilkerson 7e933abe68 Convert more tests to include diagnostic location information
Change-Id: If0d0dec8839fd6f836cff2b5f021cc8c40969b0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105140
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-06-06 12:40:39 +00:00
Aske Simon Christensen c8ee114beb [cfe] Pass triple-shift flag to scanner.
Fixes https://github.com/dart-lang/sdk/issues/37082

Change-Id: I3aead7432b64433a040d4586623e13d8ac5388ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104004
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2019-06-06 12:00:24 +00:00
Jens Johansen 1e6f08d41c Fix crash when non-class is given as supertype
Before this CL this code would crash fasta:
```
class A extends Function() {}
```

Now it produces a compile time error instead:

```
t.dart:1:7: Error: Can't use a function type as supertype.
class A extends Function() {}
      ^
```

(technically it already issued it, but crashed before doing so).

Bug: #36824

Change-Id: Iaeb9dc8390d4a9ab7b473848c3311f08a4dbba6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101283
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-06-06 11:33:24 +00:00
Jens Johansen b4d190f5cd [incremental compiler] Streamline processing of reused/removed builders
Suprisingly this doesn't seem to affect performance, but doing basically
the same thing in two different ways is suboptimal.

Change-Id: I1cc52bceb05a0af4d0e0d0574c3599c063cf42a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105242
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-06-06 11:31:55 +00:00
Jens Johansen 5eff2a0374 Split CanonicalNameError, no warning if CanonicalNameSdkError
Prior to this CL, we would issue a warning whenever a CanonicalNameError
was encountered.
This is in principal a good thing, but because we currently have no way
to detect if the sdk we get is the one we expect
(by any other measure than when it issues a CanonicalNameError) we often
issue these warnings for no "real reason" whenever, for instance,
the flutter sdk changes.

This CL splits the CanonicalNameError in two such that errors with
references to the sdk ("dart:" libraries) issue CanonicalNameSdkError
instead, an we then handle that differently. Namely we silently ignore
the error (i.e. don't issue a warning) and just don't initialize from
dill.

This should remedy the situation and be strictly better than to always
swallow CanonicalNameErrors.

Bug: 36032
Change-Id: Idbae0b5ee5b9843a5dbeb49b3c65ae25f5962e36
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105240
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-06-06 10:10:46 +00:00
Brian Wilkerson 0c1c0afba3 Fix the documentation for ElementVisitor (issue 37151)
Change-Id: I03fbcb022bc92aaa88f65aeb895cad5de0b38e6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105100
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-06-06 01:31:04 +00:00
Konstantin Shcheglov cabd3237f5 Build new elements for GenericFunctionType in DeclarationResolver.
It seems that we don't really need to have the same elements for them
for resynthesizing element model and resolved AST.

R=brianwilkerson@google.com

Change-Id: I05efdf90671f596f2f8b85a3808eb2c4c87ea8c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105003
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-06 01:09:50 +00:00
Stephen Adams 237d3ca398 dart2js: Add skeleton dart:_rti libary
- Skeleton Rti type
- Skeleton test
- Add dependency on command-line flag to get dart:_rti into platform dill

Change-Id: Idf383269c66c9951e23fd70a45ce65c54a973586
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104921
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2019-06-06 01:02:20 +00:00
Brian Wilkerson 9efd0fa899 Use the right type provider based on the feature set of the library
Change-Id: I82a22cef142b89579c19e2063fb888e2827f2bb8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104362
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-06-05 21:36:51 +00:00
Jaime Wren bbf0055a28 Follow up on recent computer_hover.dart changes, the containingLibraryName should not include relative paths from /.
Change-Id: I0fa25196e60eac694a09f3c71c36b2c09563c789
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104660
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-05 21:35:03 +00:00
Alexander Markov 86ea9ad1e7 [vm/bytecode] Add source positions for more bytecode instructions
Also, correct source position for CheckStack instruction in the prologue of
a closure.

Change-Id: I175e5398296f17a1f67a223d45725206e65e0e8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105040
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-06-05 21:06:56 +00:00
Nicholas Shahan 9cfe9bd34e [analyzer] Fix runtime error when creating SDK manager
Caused by a ternary operator with differently typed branches.

Change-Id: I5f9cfc28c274c125db0a999237f81dc3523896cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104240
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-06-05 20:44:56 +00:00
Paul Berry 9a061448a5 Migration: support assignment to index expressions.
Change-Id: I7f295247d059f532cabd24518f5009f017a34fd7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104946
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-05 19:58:07 +00:00
Johnni Winther 74636a5777 Generate more fine-grained timing of the emission
+ emit a bit more progress info with -v

Change-Id: I60e44b2a383c8f55ef57c2a4cca98340baa66a01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104001
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-06-05 18:44:02 +00:00
Dan Rubel 487326eef4 fix AstTextPrinter
This fixes a bug found in
https://dart-review.googlesource.com/c/sdk/+/105000

Change-Id: I9d2e12557ad506a1b5a433cdae35229c04affed4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105001
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-06-05 16:52:54 +00:00
Dan Rubel 9b22dd8e92 remove hard coded feature index
Change-Id: Ib01f2c9b1516987ec39591a5a320bab81138718d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104786
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-06-05 16:49:24 +00:00
Brian Wilkerson 37976dd26d Improve test so that snippet is displayed when an exception is thrown
Change-Id: Ib5a7ed985df42b7d56dd98e104a145fddc895599
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105020
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-06-05 16:44:52 +00:00
Brian Wilkerson 788dcf681e Set or map literals can be ambiguous in invalid code
Change-Id: Ic17f5b80836bdf1891065af97adf5e9a5e021995
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105021
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-06-05 16:30:12 +00:00
Danny Tuppeny 94968f9bae Correct LSP completion relevance to add maximum boost instead of all boosts
Equiv change to https://github.com/JetBrains/intellij-plugins/pull/660.

Change-Id: I93192588de11afc1828b1f26e8f14f9b836cfd19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104982
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-06-05 15:24:22 +00:00
Paul Berry 42688f9d28 Migration: add support for reads from fields.
Change-Id: Iaa74a0d5d730df0a5ad57de839de01f1b54c1240
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104807
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-06-05 14:25:50 +00:00
Paul Berry 2cd86030a5 Fix return value in GraphBuilder.visitVariableDeclaration.
This method should return `null`, since it doesn't visit an expression.

Change-Id: I018241c0d2e9b9f00bfe293352cf2707551c81e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104881
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-05 14:24:20 +00:00
Dan Rubel 9197b34a0e generate analyzer experimental flags
Change-Id: I7dc2be03e7266b6ef0a936269a2dbe584096e3db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104785
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-06-05 14:17:35 +00:00
Dan Rubel 4181185070 parse nullable function typed formal parameter
Change-Id: I502d4c6649a8974883b9ded038ce8927d34eea10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104940
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-06-05 13:37:01 +00:00
Johnni Winther 682ffb6e7a Handle unevaluated constants in annotations
Change-Id: Icbcdac10ea5aabedbeebd7953134d297ab6c1d32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104561
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-06-05 13:05:00 +00:00
Paul Berry 79989d2627 Migration: recognize /*?*/ as expressing nullability.
Change-Id: I132d15775bb55ca4772a7b48f6a85c12c930a498
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104880
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-06-05 12:41:41 +00:00
Paul Berry 4402fbe672 Migration: support index expressions.
Change-Id: Ie43b5045df75b325a74243a8ae8801387c73c64a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104883
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-05 11:49:52 +00:00
Danny Tuppeny a684f2051b Reduce JSON for LSP completions by moving edits to resolve
See https://github.com/dart-lang/sdk/issues/37163.

Change-Id: I336245590560f7b30315a1dbda59ea56e5e9e043
Bug: https://github.com/dart-lang/sdk/issues/37163
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104862
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-06-05 06:47:51 +00:00
Danny Tuppeny 2f0c9904ee Remove docs from LSP (suggestion set) completions and provide during resolve
Change-Id: I1e3c99e3076e829822b418ffaf19dcb891e93f81
Bug: https://github.com/dart-lang/sdk/issues/37163
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104861
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-05 06:47:51 +00:00
Danny Tuppeny 91b3281531 Reduce LSP completion JSON by removing optional fields set to defaults
This addresses some of the things mentioned in https://github.com/dart-lang/sdk/issues/37163 but doesn't entirely solve the issue (for example it doesn't touch docs yet).

Change-Id: Ib0a094695905120ac5e222dae52165b9a5f9a825
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104860
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-05 06:47:51 +00:00
Brian Wilkerson 6031ca4116 Remove an unused import from the LSP support
Change-Id: I7fc72f249c18688cd8262f73ccd9c14aea45f908
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104943
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Danny Tuppeny <dantup@google.com>
2019-06-05 06:47:21 +00:00
Konstantin Shcheglov 37b714401d Add AvailableSuggestion.declaringLibraryUri
We need this to support existingImports filtering, because filtering
is done on suggestion basis, not on the whole suggestion set basic,
because of re-exports.

R=brianwilkerson@google.com

Change-Id: Id97cb122fa6e3c5c62e367098e1917eba997a76f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104808
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-05 01:20:51 +00:00
Konstantin Shcheglov cf4a9f4f75 Revert "Restore explicit SimpleIdentifier."
This reverts commit bb6e558534.

I found a problem with --use-summary2 in DAS.
When we implement actual API signatures, changes in bodies
change offsets for nodes, but summary2 also includes offsets,
and they don't match. So, DAS crashes. I will need to rework
offsets and other @informative data storage, so its turns
out that we cannot pretend so use real SimpleIdentifier(s)
anymore.

R=brianwilkerson@google.com

Change-Id: I1193cc3f6fd25aea1c39531e8a685b60b347166e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104949
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-05 00:34:22 +00:00
Brian Wilkerson f7526daebd Fix a hint in the migration engine
Change-Id: I119c44b30a1d3c6fb0d725ddb546cd3dcb31dab1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104809
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-06-04 22:18:43 +00:00
Paul Berry fa19cd7bb8 Migration: handle simple assignment expressions (x = y).
Change-Id: I580b902e83325a7a0a85686ebf7393993e531446
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104803
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-04 17:12:01 +00:00
Paul Berry 74b7165cc8 Migration: support references to local variables.
Change-Id: I43c4e2882c003b9cb219406c2aaac507b7f63979
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104802
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-06-04 17:03:56 +00:00
Danny Tuppeny 64a9253763 Add LSP method to fetch super method/class for a position
Change-Id: If8f28a708312113916cc9cecd75e768f7fec393b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104823
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-06-04 16:05:15 +00:00
Paul Berry 15c0315e8e Migration: add support for local variable declarations.
Change-Id: Ifead9354c583a070a7240d158823eafe1be3d875
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104840
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-06-04 15:53:25 +00:00
Paul Berry 46dd19609e Migration: recognize /*!*/ as expressing non-null intent.
Change-Id: Ic9f0b3f560df00adf5e7cbab71b3380f6c43c0aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104801
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-04 14:54:29 +00:00
Paul Berry 53de6054d9 Add a missing migration test case for binary expression
Change-Id: I996976d2247b3b19670f02dd9d3577cc7d8c1fdc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104800
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-04 13:49:29 +00:00
Vijay Menon 3b5a187726 [dartdevc] move ddc internal libraries under sdk
Note, this has the effect of including all DDC Dart sources with the
shipped SDK: we ship everything under sdk/lib.

This should enable https://github.com/dart-lang/build/issues/2262

Change-Id: If66bc7c620034e7f2acf7d2c3e9524a408417681
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104383
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-06-04 13:47:29 +00:00
Danny Tuppeny 9a3478ac20 Add support + tests for closing labels
Change-Id: I415a352010044d3b4aeb156d9d11dbbd94e86461
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104782
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-04 13:35:57 +00:00
Danny Tuppeny 0200a1e7b2 Extract LSP initializationOptions into a class
Change-Id: I50402bb75f51a771931d9b5255b7b9207d0f316b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104761
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-06-04 13:35:17 +00:00
Kevin Millikin bd60fa1ad5 [cfe] Write constant field initializers into outlines
For constant field initializers, compile the initializer expression
to Kernel, perform local type inference, and perform necessary
rewrites during outline construction.  This will support constant
evaluation during separate compilation.

Change-Id: I65fe601595c04c45d586d0bac97c2ade6ab15a90
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104564
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2019-06-04 13:14:29 +00:00
Jens Johansen 422553798e [incremental compiler] Don't process dill libraries twice
An internal benchmark via kernel worker of lots of outline
calculations in worker mode with reuse and the incremental compiler
(and lots of dill loaded dependencies) goes from ~160 seconds to ~150 seconds.

Change-Id: I80afa10caacef5e14e569928a1d421bd3e8ab342
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104003
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-06-04 11:33:29 +00:00
Paul Berry 0779751b82 Fix implementation of isDartCore and isDartAsync.
It's not sufficient to check the name of the library, since a
user-provided library could always name itself `dart.core` or
`dart.async`.

Change-Id: Id99cfc1ec89c5941e16b556e3c4dd175875a673f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104580
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-06-04 03:12:28 +00:00
Konstantin Shcheglov d24b407568 Add --use-summary2 flag to AnalysisServer.
So that we can start dogfooding it.

I noticed that we logged too much data, so I reworked what we
log in LibraryContext.

Currently performance will be subpar, due to using content hash as
file's API signature. So, any change to a file, even in a method
body will cause the whole library cycle (and everything that depends
on it) invalidation. I will implement computing API signatures for
parsed unit (hopefully reusing something already existing) in a
following CL.

R=brianwilkerson@google.com, paulberry@google.com

Change-Id: Ifb77e29188484b6784edbaa6a6d5daca6800ef2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104603
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-04 02:58:29 +00:00
Mike Fairhurst 55d3bbf13f Promote parameter of == to nullable when invoked.
This is required because otherwise

Object() == null

requires the type signature of Object.operator==(Object o) to be
changed to Object.operator==(Object? o). Which I don't think is the
behavior we want.

Confirmation that this CL is correct has been sent to the language
team. I recommend we land, which will unblock my subtyping CL, and
roll back/readdress later if need be.

Change-Id: I498f9870e7128b2cac3012fff0cb1ab50fcc8df7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104344
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-06-04 00:36:24 +00:00
Nate Bosch 0241e40c15 Track Library URI for classes
Closes #36771

- Add getLibraryUri and setLibraryUri runtime utility.
- When emitting classes add a statement to set the library URI.

Change-Id: I8974c7fdd4d9986f27a35f116d9881af043c0c9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104641
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2019-06-03 21:47:17 +00:00
Vijay Menon 69063ab552 [dartdevc] automatically find d8 in ddb
Also remove stale files

Change-Id: Ie3004a3c7f30148459caa1a4b08d909c08484eca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104420
Commit-Queue: Vijay Menon <vsm@google.com>
Auto-Submit: Vijay Menon <vsm@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-06-03 20:02:46 +00:00
Sigmund Cherem 1045ef1ceb Use generic test runner to log data using the test infrastructure jsonl format
Mostly this is adding an abstraction so we can produce the jsonl files that will
allow us to track the status of each test individually.

On a separate CL I'll be moving the tests out of the current unit tests into
their own step in the test matrix.

Change-Id: Id4537db1458949370195124164b120b49a7a526c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104384
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-06-03 19:16:49 +00:00
Brian Wilkerson 34a45de500 Add support for representing nullable function-typed parameters
Change-Id: Ia667236d5d60bb5c1aca7fc0747702f244182a19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104621
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-06-03 19:06:09 +00:00
Konstantin Shcheglov c54eac55ad Reuse field tails/offsets in VTable instances.
So, that we don't have to allocate these lists for each instance.
This makes it cheaper to have serialize more objects.

In a synthetic performance test, where we turn IDL builders into
bytes 100 times, this improves time to bytes from 45 to 34 seconds.

R=paulberry@google.com

Change-Id: Ie8c9a8ed01b4c0d4abeba96ed5e99bd430f9309d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104600
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-03 18:28:19 +00:00
Mike Fairhurst 15e6c0bca9 Fix Never? in two ways: print ? in diagnostics, and don't set on element.type
Change-Id: I3f846f18c2c52d459c6876de108e9228f1082747
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104341
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-06-03 18:01:38 +00:00
Konstantin Shcheglov d63466041c Issue 131596231. Suggest names for SimpleFormalParameter(s).
R=brianwilkerson@google.com, jwren@google.com

Change-Id: I9074ef1a5aaeee32303dcf247c2be86f9c173d14
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104460
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Jaime Wren <jwren@google.com>
2019-06-03 17:34:18 +00:00
Konstantin Shcheglov bb6e558534 Restore explicit SimpleIdentifier.
It does not look that using name/nameOffset saves us much.

R=brianwilkerson@google.com

Change-Id: I00c297d64399ad1027a5ff0c2b8d7c757b190b78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104520
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-03 17:01:51 +00:00
Konstantin Shcheglov ef62349c6d Turn on useSummary2 in build mode only temporary when computing errors.
We don't want to keep it on while building summary1, because there
are changes in type manipulations that depend on it.

R=brianwilkerson@google.com

Change-Id: I4f84860ec197eb8f40dba80ecb51868f3d48e5e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104421
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-03 16:13:44 +00:00
Paul Berry 578629ad26 Add migration support for property accesses.
Also made some minor improvements to the handling of method calls.

Change-Id: I8728a7901cfe61f88563b71e290e9d5b303afda1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104486
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-03 14:51:34 +00:00
Paul Berry b1e28691d1 Only create hard edges for local variable/parameter references.
Exception: also create hard edges for the relation between a type
argument and the corresponding type parameter bound, because that
can't be fixed by a null check.
Change-Id: I71b21ddb11c1bb1060cb6f13efde13855770e2b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104485
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-06-03 14:51:34 +00:00
Paul Berry 8776bdbf42 Rename migration visitors to reflect terminology in the design doc
Change-Id: I9e554356032700bbbac93df4e754fa1fc1c67041
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104484
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-06-03 14:51:34 +00:00
Kevin Millikin 907f31e6de Reland "[cfe] Build some annotations during outlining"
Reland the change to build some annotations during outlining, with a
bug fix.  Annotations from patch classes and procedures were not
applied to the actual class or procedure, which is fixed.

The original commit was reviewed at
https://dart-review.googlesource.com/c/sdk/+/103806

The revert was reviewed at
https://dart-review.googlesource.com/c/sdk/+/104220

The original commit message was:

    During the outline phase, after top-level type inference, compile
    annotations for libraries, classes, fields, procedures, and
    constructors.

Change-Id: I836160ddad4114ded72701e8a3938f703228931c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104560
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-06-03 10:20:15 +00:00
Paul Berry e31af09992 Remove NullabilityMigrationAssumptions class.
This was a lot of bookkeeping for very little added value.  If we want
to experiment with changing the behavior of the migration tool in the
future, we should experimentally change it and see whether the quality
of the migration improves; it's not worth speculatively keeping
multiple behaviors around while the tool is being developed.

Change-Id: I9a59e2626be7e9e84a937e287421abcdc971aba5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104482
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-06-03 02:20:26 +00:00
Paul Berry 709df79404 Clean up logic to decide whether to create hard edges
Previously we were creating hard edges for the default values of
optional parameters.  This was incorrect; we don't want a hard edge
because we don't want evidence of non-nullability to propagate
upstream from an optional parameter to the const expression that sets
its default value.

Change-Id: I44e12ae96987fd7a9defc538b0704cf76262473f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104500
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-06-03 02:20:26 +00:00
Paul Berry 01694dcca1 Handle nullability nodes for dynamic types more cleanly.
Rather than use an edge from `always` to ensure that these nodes are
nullable (which is error prone since it could be overridden by an
assertion), we simply place these nodes in the ordinary nullable state
at the time they are created.

As a side effect we can reduce the amount of code we have to plumb the
nullability graph through.

Change-Id: I46cf5b2026aeb2917cb35a7ad0d36a0a0562ecc5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104481
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-06-03 02:20:26 +00:00
Paul Berry 9aa88b1168 Add a const bool to make it easy to enable dumping the nullability graph
Change-Id: I6fc5c5f78cf1665f2551206979ebb5246f03c998
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104480
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-06-03 02:20:26 +00:00
Paul Berry c229555d87 Rework the graph representation for the migration tool based on the design doc.
Change-Id: I1777042926f83cd2f95da6c6db315a8d49c64df1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104422
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-06-03 02:20:26 +00:00
Paul Berry ca84a69609 Modify NullabilityNode to allow the 4 possible states from the design doc.
Change-Id: Ic28867227ad6080d693eff7576335e0a15bbe178
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104440
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-06-03 00:00:05 +00:00
Konstantin Shcheglov 2c4a2237d2 Disable search.getDeclarations with summary2.
It is unlinked summary based, we don't support it with summary2.
So, to not crash we return the empty list.

R=brianwilkerson@google.com

Change-Id: Ic220ae3526a3a3e2f06c60b4e25d7e7cef69af60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104201
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-01 18:21:48 +00:00
Konstantin Shcheglov 519ddc1ac4 Document that AVAILABLE_SUGGESTION_SETS also turns on existingImports.
R=brianwilkerson@google.com

Change-Id: I053c68eb541358f0bbd891ca16f1c5628e701096
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104342
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-01 17:27:03 +00:00
Konstantin Shcheglov 577ab8d631 Issue 37129. Check for missing importedLibrary.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/37129
Change-Id: I60f5c1382cdb19988e786fff81e8450a6de3888c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104360
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-06-01 17:26:41 +00:00
danrubel 6f2f92f578 improve extension method declaration recovery
Address comment in https://dart-review.googlesource.com/c/sdk/+/103580

Change-Id: Ie92e4fa752eaf851fec9465565d640524b569760
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104320
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-05-31 23:30:25 +00:00
Régis Crelier cddf2bbdfe [vm/debugger] Support debugging of interpreted frames.
Change-Id: Iaf59e6ed887ed973fcfc7f1c414ad52ef98f01d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100270
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-05-31 21:40:32 +00:00
Mike Fairhurst c5e03e5cce Fix tests that assign null to non-null locations
Change-Id: I3cda901d3645f162ddc60e071b0eaa46d06c356b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104284
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-05-31 18:57:35 +00:00
Konstantin Shcheglov 9d4649a44c Set context type for downward inference in constants.
R=brianwilkerson@google.com

Change-Id: Ifca9953d970906c7291c32f8db6f4d294429cce9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104283
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-31 18:31:44 +00:00
Konstantin Shcheglov b3f262298c Fix recording covariance for default parameters.
R=brianwilkerson@google.com

Change-Id: If904634685a223713e467fc93c0e04afd1378ce0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104280
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-31 16:56:44 +00:00
Danny Tuppeny 190599de78 Skip LSP cancellation handling for Notification requests
Change-Id: I0edf6206db66ed07390dafcd5ea72bb2397468fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104300
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-05-31 14:45:24 +00:00
Johnni Winther edae8c474c Fix _createSdkModule for Windows
Change-Id: I3392742a80a3f27062e0d48c02f58b4ddf20c376
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103810
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-05-31 14:20:24 +00:00
Johnni Winther a620c56e8d Ensure output unit data for late members
+ assert classes and members have an output unit

Change-Id: I69749d54d79a66fea4947034458295010f83c0cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103805
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-31 14:20:24 +00:00
Brian Wilkerson abc8195541 Add more failing tests for downward inference in nnbd
Change-Id: I67225cd56c3ecf23cf7e03860aa750e7f951dcb8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104188
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-05-31 13:24:44 +00:00
Dan Rubel 2938630937 update parser to handle "!." in nnbd expressions
Fix https://github.com/dart-lang/sdk/issues/37111

Change-Id: I6e156a804085c9be12e5e7a0d0019cfeb77c9128
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104187
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-05-31 11:37:44 +00:00
Stephen Adams a25f927ba9 Split HTypeConversion
Introduce HPrimitiveCheck for checking the receiver or argument of
primitive operations. These will eventually go away with NNBD since it
will be a call-site type error to invoke `+` with a null receiver or
operand.

Change-Id: I54bf64f8231a234341c1ddf5ad4dba26909d613d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104185
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-30 23:38:25 +00:00
Nicholas Shahan c4a1ca903f [dartdevc] Cleanup violations of unrelated_type_equality_checks lint
These violations look like actual bugs and were not simply mechanical fixes.

Change-Id: I69ae67751e48829fc4733dcb327ba0aa52602c91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104063
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2019-05-30 21:35:25 +00:00
Konstantin Shcheglov e34d63bd11 Visit return types of functions/methods to consumer GenericFunctionType(s).
R=brianwilkerson@google.com

Change-Id: I8f57065a6c54afc749168e02966f46a93ec0307d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104261
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-30 21:22:42 +00:00
Alexander Markov 372b02d97f [vm/bytecode] Add information about local variables to bytecode
Change-Id: I22bbd3b7ea0cccc0a8d721c3766a80ae1c72060d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/87701
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-05-30 21:21:44 +00:00
Konstantin Shcheglov 0a66b3e644 Fix scopes for resolving class / mixin headers.
R=brianwilkerson@google.com

Change-Id: I981fc1b76435d2a7e2ae1045f49ade12febafa01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104186
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-30 21:13:15 +00:00
Brian Wilkerson d51d41b109 Add some failing tests for downward inference in nnbd
Change-Id: I8ae6924ef22efffc0ff5b42c45864eedf75e7c0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104184
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-05-30 19:27:16 +00:00
Brian Wilkerson 556c9134ac Update the SDK version associated with constant update hints
Change-Id: Id082dcfbbbf19672c8bc036161326a15c8f9d9f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104260
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-05-30 18:22:16 +00:00
Konstantin Shcheglov 7c956f4387 Make it possible to consume summary2 in build mode, but don't turn it on yet.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: Iad4d625217e3eeb6d8e5142825224dc0b2dcf8bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104121
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-30 16:49:04 +00:00
Konstantin Shcheglov 13ff60ec02 Use Substitution for typeAfterSubstitution with summary2.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: If8c4a4ad7db406fa4af9f22456ec40d153588db9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104183
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-30 15:33:17 +00:00
Konstantin Shcheglov dad211bfca Store offset for ConstructorDeclaration.
R=brianwilkerson@google.com

Change-Id: I49ee91ee44b01f320b0e1d8b87ccaafe9774ded1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104200
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-30 15:25:22 +00:00
Konstantin Shcheglov 47ed7f737a Resolve default values in mixin method parameters.
R=brianwilkerson@google.com

Change-Id: Ie31fa9f484a0810731a08907fbb8a7725ca21115
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104165
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-30 15:25:14 +00:00
Vyacheslav Egorov 39ec9fc4f3 Revert "[cfe] Build some annotations during outlining"
This reverts commit 1df5fb3d57.

Reason for revert: large regressions on Flutter microbenchmarks. Reverting to prevent this reaching Flutter.

Original change's description:
> [cfe] Build some annotations during outlining
> 
> During the outline phase, after top-level type inference, compile
> annotations for libraries, classes, fields, procedures, and
> constructors.
> 
> Change-Id: I95ca65fd58ad88d9452a28d5a0652bee44aeda3a
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103806
> Commit-Queue: Kevin Millikin <kmillikin@google.com>
> Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>

TBR=alexmarkov@google.com,dmitryas@google.com,askesc@google.com,kmillikin@google.com

Change-Id: I67c0719f9175c1bd75b609d7d5c0cea5c294bd6d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104220
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2019-05-30 08:46:55 +00:00
Kevin Millikin 1df5fb3d57 [cfe] Build some annotations during outlining
During the outline phase, after top-level type inference, compile
annotations for libraries, classes, fields, procedures, and
constructors.

Change-Id: I95ca65fd58ad88d9452a28d5a0652bee44aeda3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103806
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-05-30 07:29:12 +00:00
Brian Wilkerson 0325ba4b4a Update test framework to uniformly use NNBD in type strings
Change-Id: I060ec6491c2100982a701a51f89af0f55ef8d706
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104162
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-05-30 04:04:02 +00:00
Nate Bosch 2958e80671 Refactor to conditional and spread elements
Change some of the straightforward collections to use spreads, for
elements, and conditional elements. Many of the patterns in this file
can't be translated because they are more complex - keep the simple ones
with a declarative structure so that it is more clear when there are
extra computations or side effects that are meaningful.

Change-Id: I135b10641f61fc43ebbc4bbd7196c315339c3ee8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104103
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2019-05-30 01:12:12 +00:00
Konstantin Shcheglov 5352c67478 Tweaks for 'Import Library' quick fixes to better reflect the expected behavior.
R=brianwilkerson@google.com

Change-Id: Ifdeb775636322382a40c800dc02d6f980e309369
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104061
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-30 00:56:09 +00:00
Konstantin Shcheglov 2ef2eb14d5 Fix FixesTest on Windows.
R=brianwilkerson@google.com

Change-Id: Ie56b0f876895f559f019b311be6460f95f7e37e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104140
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-30 00:19:49 +00:00
Nate Bosch 475d68527c Add types on overridden method signatures
We were inconsistent about using return and argument types with
overridden methods. It is technically safe to omit them since they'll be
inferred from the super class - but it's more explicit and readable to
repeat them here. We were already using types on some of the overrides -
add them to the remainder.

Change-Id: Id8529e40a80c8ff3d5feb231a37a12d3d6487b4d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104160
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2019-05-30 00:18:09 +00:00
Sigmund Cherem d99d83ea09 Add ddc modular test suite and single test
The test is failing, for now I plan to just land the test in its failing test and change the status once it starts passing.

Change-Id: I305c32cc7a163e280bdb766f29835264c331c9ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103680
Reviewed-by: Vijay Menon <vsm@google.com>
2019-05-29 22:24:21 +00:00
Mike Fairhurst 2268c65cbe First subtyping rules for nullable types
Change-Id: Ibaaea75f8b5e83f1fb7039332093121854108da8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103548
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-05-29 22:13:11 +00:00
Vijay Menon dd5530a73e [dartdevc] make ImmutableSet private
Patch files should not add public members to the underlying library.

Siggi was hitting this when wiring up modular testing for DDC:
https://dart-review.googlesource.com/c/sdk/+/103680/3/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart#544

The ddk builder appears to have be swallowing this error - not yet sure why.

Change-Id: I86098b25a344b2bb8b69fe3dc386d01f6f7cb309
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103740
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-05-29 20:04:24 +00:00
Sigmund Cherem 4c9bf5479f Extract generic runner logic, now dart2js modular test is mostly dart2js specific
Change-Id: I73f1a5590681871a54c5bc8dc1ad0d7d0f71024e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103660
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-05-29 19:23:33 +00:00
Konstantin Shcheglov 76750c58f2 Issue 35553. Report WRONG_TYPE_PARAMETER_VARIANCE_IN_SUPERINTERFACE.
Locally I see that out of 198 language_2/superinterface_variance/ tests:

* With summary2 we pass 197, and fail 1 test.

* With summary1 we pass 165, and Crash in 33 tests.

R=brianwilkerson@google.com, paulberry@google.com

Bug: https://github.com/dart-lang/sdk/issues/35553
Change-Id: I79b5d7d2931c2d0c42ae6f12c19324deb7af784f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103960
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-29 17:13:30 +00:00
Brian Wilkerson 98a4dba4b3 Update Element.appendTo to more closely match Dart syntax
Change-Id: I74bf13f3b072c734b018517e6d06e182a0736bb9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103961
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-05-29 17:06:40 +00:00
Nicholas Shahan 694699c6e4 [dartdevc] Improve NSM errors when making dynamic calls
Add specific error text for the dynamic call failure cases:
* Calling null.
* Calling an object instance with a null `call()` method.
* Passing too few or too many arguments.
* Passing incorrect named arguments.
* Passing too few or too many type arguments.
* Passing type arguments to a non-generic method.

This does not address the issue of a missing name. The errors still just
reference 'call'. Tagging a name could be added in a future change.

Issue: #36165
Change-Id: I21592ef506908559da0bfe9aac5ed5bae7fcb84e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103645
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-05-29 16:57:30 +00:00
Konstantin Shcheglov a332c414f1 Switch server to using DeclarationsTracker for 'Import Library' quick fixes.
We need this to stop using UnlinkedUnit with summary2.

R=brianwilkerson@google.com, paulberry@google.com

Change-Id: Iaca2f19e6a168818e171f09e6eeda71a75854232
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103921
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-29 16:45:32 +00:00
Brian Wilkerson d74d49e748 Convert more diagnostic tests to include location
Change-Id: Ie7b31b09969acba5efbf9f27008ec805da15a8cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104060
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-05-29 16:28:20 +00:00
Danny Tuppeny fca2c82be0 Add support for cancelling requests in LSP server
Change-Id: I2a651b1e4f8509c7f10d245b2369aab842d08041
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103845
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-29 14:52:40 +00:00
Vijay Menon 47e63b0eee [dartdevc] encode part file metadata
Fixes https://github.com/dart-lang/sdk/issues/37074

Hand-tested on flutter gallery.  E.g.,:
> dart.getParts('package:flutter_web_ui/ui.dart')
(15) ["src/ui/canvas.dart", "src/ui/compositing.dart", "src/ui/debug_canvas_reuse_overlay.dart", "src/ui/geometry.dart", "src/ui/hash_codes.dart", "src/ui/initialization.dart", "src/ui/lerp.dart", "src/ui/natives.dart", "src/ui/painting.dart", "src/ui/pointer.dart", "src/ui/semantics.dart", "src/ui/browser_location.dart", "src/ui/text.dart", "src/ui/tile_mode.dart", "src/ui/window.dart"]

Change-Id: Ied734d9f3739886d6679a9a9bbeae854e432bc52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103602
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-05-29 14:48:40 +00:00
Aske Simon Christensen d5405d06f4 [cfe] Allow local const variables as annotations.
Fixes https://github.com/dart-lang/sdk/issues/37065

Change-Id: If902bd22fc6e0925c361a31e22b32d046ea4754e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103628
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2019-05-29 09:21:39 +00:00
Alexander Thomas 182d55dfda [dart2js] Add support for BabelJS to test.py
This adds support for BabelJS to test.py's dart2js compiler
configuration. When --babel is specified directly or through a named
configuration, test.py will run an additional step after dart2js that
post-processes the javascript output by running it through BabelJS with
the specified Babel configuration. BabelJS is added to the DEPS in its
standalone form. d8 is used to run BabelJS standalone to avoid adding
a dependency on NodeJS. d8 can only write to stdout but not to files or
stderr, which makes it necessary to change the test_runner to handle
commands that expect their output to be piped to a file.

Changes:
* Add --babel option to test.py.
* Add babel option to pkg/smith.
* Switch IE11 builder to use babel transformation.
* Fix option list comparison bugs in pkg/smith.
* Change dart2js compiler configuration to generate files using the
  test name rather than just "out.js" (update test that relied on this).
* Remove runtime_configuration dependency on test_suite.
* Remove obsolete blocks adding --preview-dart-2 dart2js arguments.
* Make dart2js' compiler configuration more like DDC's.
* Remove createCommand method that is no longer used.
* Remove support for "OtherResources" which was only used for
  dart:isolate tests on dart2js and DDC.
* Skip co19_2 tests that are slow to transform with babel.
* Simplify the timeout handling in the test runner with Future.timeout.

Change-Id: I32e4917b2a57ecbe684538e40d744f0101c552a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/90402
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-29 08:39:44 +00:00
Konstantin Shcheglov b1d3a212a7 Fill references to dynamic/Naver in LinkedElementFactory.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I85f61c6322a6332ac6b095aaf8cf4203460babc3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103940
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-29 01:20:42 +00:00
Stephen Adams f9bf379ae1 Move BOOLEAN_CONVERSION_CHECK to separate HInstruction
The new HBoolConversion instruction can be removed after the NNBD transition is complete.

Change-Id: I136c23f10440cb2414db32e5054b743714f7116b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103681
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-05-28 21:23:06 +00:00
Brian Wilkerson 2e51423c3d Convert the way function types are displayed to better match the syntax of Dart
Change-Id: Id5068bd52b3a35c70cb0d2ccc735469e2f8a0d3b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103701
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-05-28 20:48:51 +00:00
Konstantin Shcheglov da3ead02c1 Issue 3446. Recurse into attributes to find children widgets.
R=brianwilkerson@google.com, devoncarew@google.com

Bug: https://github.com/flutter/flutter-intellij/issues/3446
Change-Id: Ifa83367c68b406b342e0f99195015d98eaedb049
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103900
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-28 20:09:25 +00:00
Paul Berry 9556a95038 Fix string->bytes encoding in overlay_file_system
Change-Id: I2777c09908172c282f59cb2bf0ed5bd208442dd4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103920
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-05-28 20:01:05 +00:00
pq fc17a90bed assist for sorting child properties last
Change-Id: Ia39f5b170858789897579f952ece03dcf6765e3f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103860
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-28 20:00:05 +00:00
Alexander Aprelev b0a11c9d25 [vm] Fix kernel list loader so that files are relative to the list.
Fixes https://github.com/dart-lang/sdk/issues/33952.

Change-Id: I95325217601dd6a25a058e36d359014eab7e61bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103901
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2019-05-28 19:42:45 +00:00
Vijay Menon 96c2d3c303 [dartdevc] enable testing of ddc internals
Change-Id: I8f4753a9a1f2f9f61df0d045adf07ff75fe32907
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103820
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-05-28 19:33:05 +00:00
Ryan Macnak af93ebcf4c [vm] Direct generation of ELF shared libraries.
Change-Id: I41c9911f33490e504f4852f15695ca4c3f32a77f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/81323
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-05-28 18:48:57 +00:00
Vijay Menon 834587a78c [dartdevc] fix import/export declarations for es6 to add extension
d8 assumes a '.js' extension - e.g.,:
```
import { core, dart, dartx } from 'dart_sdk.js';
```

Note: this will enable Siggi's modular compilation framework to run DDC tests on d8.

Change-Id: I1167a36e1454950149fecb8abc793728a16e4591
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103780
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-05-28 18:48:55 +00:00
Nicholas Shahan d06592b532 [dartdevc] Add details to failed assertion messages
* Source file location
* Assertion source code

This change embeds the information as strings into the compiled source. In the
future we could reconstruct the source file location at runtime from the stack
trace.

In tests with various large applications this added roughly 1MB (0.1MB
compressed) or less to the compiled file size.

Fixes: #36995
Change-Id: I2634f7eab6e54eec209094b52429987dd62c0828
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103568
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-05-28 18:03:38 +00:00
Konstantin Shcheglov 03781b9402 Build also summary2 in build mode.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I172612fd50c1cb50dfad8b5dc2807f744cf973b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103760
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-28 17:44:48 +00:00
danrubel fee615c5a5 consolidate multiple modifier error codes
This consolidates the following error codes into MODIFIER_OUT_OF_ORDER

* COVARIANT_AFTER_VAR
* EXTERNAL_AFTER_CONST
* EXTERNAL_AFTER_FACTORY
* EXTERNAL_AFTER_STATIC
* STATIC_AFTER_CONST
* STATIC_AFTER_FINAL
* STATIC_AFTER_VAR

Change-Id: I3f8c41bacc65ebc5d9255806cbee89cddb5ffeb1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103880
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-28 17:01:16 +00:00
Todd Volkert 6aee4f390b Make analyzer's File.readAsBytesSync() impls return Uint8List
As part of the rollout plkan for https://github.com/dart-lang/sdk/issues/36900

Bug: dartbug.com/36900
Change-Id: Ic56cc1054ebae5967a1273b19f886a5e41b9460b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103060
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Todd Volkert <tvolkert@google.com>
2019-05-28 15:02:16 +00:00
Danny Tuppeny 85c28b804d Check LSP support for workspace/applyEdit before giving CodeActions that require it
Change-Id: I88af71be9788bd417a1f739f0f3e0efe930c2cd0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103842
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-05-28 14:10:26 +00:00
Dmitry Stefantsov 39dbaecfc1 Remove tests relying on contravariant uses of varaibles in supertypes
Change-Id: Ie614d8f96bbe534117f83528b41fe63fdfa9c9c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103525
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2019-05-28 09:56:43 +00:00
Dmitry Stefantsov e6e2020fb2 [fasta] Allow only covariant uses of type parameters in supertypes
Closes #35792.

Bug: http://dartbug.com/35792
Change-Id: I1c647c74e1e8f8892fd76b735085b457e770f5b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103521
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-05-28 09:56:43 +00:00
Konstantin Shcheglov 527c165426 Deprecate 'abstract' setter in elements, replace with 'isAbstract'.
I deprecated 'abstract', but I don't see any uses of it outside of
analyzer, which I have fixed. So, maybe we should remove them right now?

R=brianwilkerson@google.com, paulberry@google.com

Change-Id: Ifd86a6b0148be49df6455672742f825ffd50f661
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103661
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-05-28 04:16:43 +00:00
Konstantin Shcheglov d368bb8ecd Make some fields in LinkedNode informative.
R=brianwilkerson@google.com

Change-Id: I76eef7f07678723944e221d65936864d400b561f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103720
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-27 21:25:36 +00:00
Danny Tuppeny e4362612b0 Add support for dynamic registration for LSP
Change-Id: I55c7b2f7d683acab0f6aa4bdbcba3b155d2de32c


Change-Id: I6a0b13856053bd86e77637b9664c7fe41194c5f3


Change-Id: I7472cf93efc29585ccbcbd1e6c7b9f703872b3c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103532
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-05-27 17:36:20 +00:00
Aske Simon Christensen 1025c5bebb [DDC] Only inline textually small constants.
Fixes https://github.com/dart-lang/sdk/issues/36535

Change-Id: I62ad6d6f7390284d0a7a52d0d4b31e57ea1fbea6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103623
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2019-05-27 11:45:08 +00:00
Aske Simon Christensen 25033cee32 [CFE] Control inlining of const variables from backend.
Needed for https://github.com/dart-lang/sdk/issues/36535

Also preserve StaticGet of unavailable constants not in const context,
rather than wrapping it in an unevaluated constant.

Change-Id: Ifac6f251ea9a90a17d06014be12c0d387a32d757
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99020
Reviewed-by: Vijay Menon <vsm@google.com>
2019-05-27 11:45:08 +00:00
Jens Johansen ae944a68ed [Incremental compiler] Only re-check package-uris if base-uri changed
When the .packages file has changed we need to re-check all package-uris
to see if we need to invalidate the builders (if the file uri for a
package uri library (e.g. if the package was upgrade) has changed we
have to invalidate it).
This translation is semi-expensive though, so if we can avoid it that
would be a good thing.

This CL caches the "base URI" for packages from the previous run,
so we can start by comparing the base-URIs: If the base-uri for a
specific package hasn't changed, nor will the actual translation.
Only if the base uri has changed we do the actual translation,
and thus save many package-to-file-uri translations.

An internal benchmark via kernel worker of lots of outline
calculations in worker mode with reuse and the incremental compiler
(where the .packages file change every time and we have lots of
package-uri libraries) goes from ~185 seconds to ~162 seconds.

Change-Id: I3ed48b23a590dbf66f8a2379bb88e1b177f1f034
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103804
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-05-27 10:46:18 +00:00
Jens Johansen d911d9b5ff Cleanup "libraries" field in DillTarget when their invalidated
Before this CL we removed from from the builders map, but left them in
the libraries list.
When using the incremental compiler via kernel worker (where we
continually replace dill builders) that meant that this list would just
keep growing.

This CL cleans it up and the builders map and the list should now be
in sync

An internal benchmark via kernel worker of lots of outline
calculations in worker mode with reuse and the incremental compiler
goes from ~215 seconds to ~185 seconds.

Change-Id: I254558d517f544fe31b5673e0dc8748048f0c5ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103630
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-05-27 10:46:18 +00:00
Jens Johansen eb131c3d68 [kernel worker] Don't do unnecessary computeCanonicalNames
This was a left-over from when unbinding, and should no longer be needed.
An internal benchmark of lots of outline calculations in worker mode with
reuse and the incremental compiler goes from ~248 seconds to ~215 seconds.

Change-Id: Iedb6a3fb11504610c061503efb741e35919f0d32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103629
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-05-27 10:46:18 +00:00
Johnni Winther 0e5ebcaa96 Add InlineData and InlineDataCache
Merges InlineWeeder and InlineReductive into one visitor and computes
an InlineData object from which all decisions can be made.

Next step is to compute InlineData in the scope visitor (the first visitor
of the first modular phase).

Change-Id: I0c435ae1b3d7afdff1cee7abac657c9362995a67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103632
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-05-27 09:01:25 +00:00
Johnni Winther 508a9fa6b0 Work-around called-once imprecision
This avoids (yet another) inconsistency from the imprecision of
called once. In this case the inlining of some methods that are
called once is dependent on whether we meet their call-site directly
or indirectly first, effectively making the inlining decision subject
to the enqueuing order.

Change-Id: I8d6b9c18fdb82f6d1b566e6bb58344211678daf2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103631
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-27 09:01:25 +00:00
Régis Crelier 735669190e [corelib BigInt] Fix implementation of BigInt.modInverse (fixes issue #37008).
A negative result was wrongly returned as a positive value.
Since positive values are preferred, the implementation now adds the modulus
enough times to make the result positive.

Change-Id: I87a2ceb359345846740a749ab6b46b1d45e7ba21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103664
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2019-05-25 22:05:51 +00:00
pq 5b200ea3dc remove unused import
Change-Id: Ib4b92a3cf453ed4f8945f62bf4213f03ceb8910d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103700
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2019-05-25 15:33:35 +00:00
Robert Nystrom 70bd05e662 Stop ignoring runtime cast failures on function types.
Change-Id: Id3485e04aafea988604663e893818672d98dc8b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103662
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2019-05-24 23:52:08 +00:00
Konstantin Shcheglov eff6e95385 Improve code generation for variant classes.
Change-Id: Iabaceebdf6efbec80d0026b74f71eac45b742760
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103600
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-24 21:55:16 +00:00
Jaime Wren 03e415a4e8 Update the hover 'containingLibraryName' to not include the 'file:///' prefix.
This is a follow up on a comment in the previous change https://dart-review.googlesource.com/c/sdk/+/103481/.

Change-Id: I0f377d6c7d68d55464a4e111a6a65715a82e0591
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103546
Reviewed-by: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2019-05-24 21:54:56 +00:00
Konstantin Shcheglov 4979a51a9c Add information about existing imports to completion response.
This adds quite a lot of information though, because we send many
strings.

Before: 20686 characters.
After:  55345 characters.

Theoretically we could do better, and send information about existing
imports only once as well, so when the user continues typing in a
single file, without touching imports, we don't send any new data
about imports (maybe just a confirmation that it is still the same).
But I'm not sure if this is a worthwhile optimization.

Actually, even included suggestion sets have similar property - they
don't change for a given file, unless there are changes to other
libraries which we might want to include.

R=brianwilkerson@google.com

Change-Id: I2f55e2dc85508849146aa39eb279beabaec937c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103561
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-24 21:35:06 +00:00
Brian Wilkerson e43d81af5f Folders containing overlayed files should exist even if they do not exist on disk
Change-Id: I511b5075cb10b2594dce9dc33f165b64d9527043
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103565
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-05-24 20:47:46 +00:00
pq e42d4a1d89 fix missing returns in lambdas
Change-Id: I5005ffc057749468844d47e8e5c195871586bd57
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103601
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2019-05-24 19:24:02 +00:00
Sigmund Cherem baa721ba23 Add an sdk module to the modular_test pipeline
+ and use it in the dart2js modular tests

Change-Id: I66cf29dcea7fb705135049e7a6ea4eb17052f3d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103575
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-05-24 19:09:12 +00:00
Sigmund Cherem 64ed4bf664 Changes to bazel worker to support modular testing.
This includes:
 * accepting null values like sdk-summary or .packages (which are not used when building kernel for the sdk itself)
 * allow enabling language experiments
 * only exclude-non-sources on the non-incremental code path if that's requested

Change-Id: I08eeb643676f1f1406f0f3030c341d68179d42a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103574
Reviewed-by: Nate Bosch <nbosch@google.com>
2019-05-24 19:09:12 +00:00
Dan Rubel f4f2c77d4a improve missing body error messages
This builds on the prior CL to improve the error messages
for missing switch statement body, missing finally clause body,
and others.

Change-Id: Ia2def1f3a75d5581356c12aee4705ef21870f749
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103571
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-05-24 17:03:25 +00:00
Dan Rubel ec1ddcdb83 improve extension message missing body error message
This improves the missing class, mixin, and extension method body
error messages and lays the groundwork for improving other
missing body error messages such as switch statement, finally clause,
and others.

Change-Id: I0a4d1338fe91eee3cfe7d61652e168df1302d212
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103570
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-24 17:03:25 +00:00
Devon Carew 9081f28fbb [analyzer] fix a copy paste doc issue and 2 unused imports
Change-Id: I20f4ae5454c2bceafd3b86e279357dee3b321006
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103644
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2019-05-24 16:31:25 +00:00
Paul Berry 3c34c8fa2f Fix type substitution of "star" types.
When performing type substitution, there are three types involved, the
substitution site (`this` in TypeImpl.substitute2), the type we are
replacing (`parameterType` in TypeImpl.substitute2), and the
replacement type (`argumentType` in TypeImpl.substitute2).

Previously, we only handled the nullabilities of `this` and
`argumentType`.  This CL adds support for the possibility that
`parameterType` might have nullability "*".  This happens because
TypeParameterElement.type returns a star type, so for instance when
subsituting `int` for `T` in `List<T>` to form `List<int>`, we are
actually substituting `int` for `T*` in `List<T*>`.

Change-Id: I0a61fdc47ec8aa205dc0c539c49ea7799ed4ac05
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103542
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-05-24 15:43:45 +00:00
Vijay Menon 77f2603052 [dartdevc] preliminary nnbd support
For analyzer backend only:
* Implements `x!`
* Uses non-null type info where possible to elide null checks.
* Does not yet reify.

No hurry on this - starting to look at what's there.  Some notes:
* NNBD doesn't seem to be exposed directly on DartType yet.
* x!.y doesn't seem to parse - need to write (x!).y.
* Can't run existing tests yet - `package:expect`, etc., have NNBD errors.

Change-Id: I58c24c950d00f3a40d789d4a7adf049786977c50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103040
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-05-24 15:04:25 +00:00
Paul Berry 0e5d18f281 Ensure that nullability promotion of the Null type yields Never.
Change-Id: I2232f80bbf5c8a9e51f305a603c06ca2b3ad8aea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103573
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-24 14:57:15 +00:00
Paul Berry 5278d4059a Sort non_nullable_test.dart
Change-Id: I356b49fb64daf4245f936d795ccaad5b0588a408
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103550
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
2019-05-24 14:53:45 +00:00
Kevin Millikin 0fb0185df0 [cfe] Extract field initializer tokens from the token stream
During outline building the token stream was split after every field
initializer needed for top-level type inference.  Since the token
stream is a doubly-linked list it's also necessary to split the token
stream before the field initializer in order to possibly collect the
unnecessary tokens.

Change-Id: Iafac8eee1eb87d43458f66ef08f6398634ded5df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103622
Auto-Submit: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2019-05-24 14:18:08 +00:00
Kevin Millikin 10692669e3 [cfe] Add flags for new experimental features
Add flags for extension-methods, non-nullable, and triple-shift.

Change-Id: I42d2afbe1b3353a18da8cdfec1fded3ad6694e3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103620
Auto-Submit: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2019-05-24 13:54:18 +00:00
Johnni Winther 052272d998 Avoid dependency on file system order in modular_test/loader_test
Change-Id: Ic7d5197c9d914998dcd761c42763d9e9e36ad507
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103624
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-05-24 11:52:32 +00:00
Kevin Millikin c20802ce16 [cfe] Introduce a Kernel annotation builder
Introduce an annotation builder that will eventually be used to
compile Dart annotations to Kernel in outlines.

Change-Id: If882ce27b6012001c04257b867b5dcc596a72105
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103621
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Auto-Submit: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-05-24 09:33:59 +00:00
Lasse R.H. Nielsen eca6c8953f Allow async as an identifier everywhere.
Fixes #37063

Bug: http://dartbug.com/37063
Change-Id: I2253c3088fbe33eca1072f2480cf0cf3cc363362
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103524
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2019-05-24 08:21:14 +00:00
Kevin Millikin dbd70dd214 [cfe] Simplify metadata builders
These builders have some unused generality: they have an unnecessary
type parameter and the implementation classes have unused fields.  As
currently used, they could be replaced with an int but the class is
kept in anticipation of adding behavior (compiling annotations).

Change-Id: I068cb483a19b3f7eae846c212cbdbb29ca77973d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103529
Auto-Submit: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2019-05-24 07:51:03 +00:00
Johnni Winther 9f9f10ad97 Use cached serialization of source-information
This reduces the size of the serialized codegen data by 20-25%

Change-Id: I85424576d68b72a56c3c924fe704a086000bc926
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103534
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-24 07:38:13 +00:00
Johnni Winther 4ff89f880d Move registrations on OutputUnitData to the impact transformer
Change-Id: I8060149b217d3222c7e784aafe9724e5ef6a7bde
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103530
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-24 07:38:13 +00:00
Johnni Winther 7580e77ef2 Support modular code generation
Change-Id: Id5511296eb0b6acf812bc464d71efa4019f211d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103523
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-24 07:38:13 +00:00
Samir Jindel 225a301637 [vm/ffi] Re-land "[vm/ffi] FFI callbacks on X64."
There are minor fixes for dartkb and windows.
The original revision is in patchset 1.

Change-Id: I9ab6e5fdb33fb4e84ea520c283fe94323616a8ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103129
Commit-Queue: Samir Jindel <sjindel@google.com>
Auto-Submit: Samir Jindel <sjindel@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2019-05-24 02:39:13 +00:00
Sigmund Cherem edadc9c881 Add support for caching results of shared modules.
This is important as we will soon add support for compiling the sdk as a
module and we would like to only compile it once when running a suite of
tests.

+ also enable caching in the dart2js pipeline test.

Change-Id: Ic9043f868123164f3ab425ba73f7428416b05fc0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103485
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-05-24 01:27:13 +00:00
Konstantin Shcheglov 8208e872f8 Refactor summary IDL generator.
I need to make changes to 'collectApiSignature' and 'flushInformative'
to support variants, and we have lots of code around already.

R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I9ba3b61a22b9e9e2c547e97d5c5adaa07443b24a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103552
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-24 00:30:49 +00:00
Paul Berry 22c086fbe5 Remove unsafe uses of TypeImpl.withNullability (use TypeSystem instead).
Change-Id: I5df47ca582aa5583055d3700668de992676bc42a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103541
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-05-24 00:21:29 +00:00
Mike Fairhurst 704446d159 Disable implicit casts but keep dynamic casts when NNBD enabled
Change-Id: Ia0a3271c9137bc8c7fa4cdbd469cf93d9453b69c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103405
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-05-23 23:41:52 +00:00
Stephen Adams cc2fac57f3 Remove HBoolify
HBoolify was used in Dart1 unchecked mode.

Change-Id: I1cdbff515fc7446c67fc255bb9599dee79dfd242
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103569
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-05-23 22:54:55 +00:00
Dan Rubel dfbc3923e4 add default CompilerContext in analysis server
This should uncover the underlying error occurring in
Fix https://github.com/dart-lang/sdk/issues/37055

Change-Id: I633da211b943e5c4262a2f3d83ef0a2217c5b8a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103562
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-05-23 22:46:15 +00:00
Dan Rubel 1ffcccd9cc add extension method header parser recovery
Change-Id: Ia7424a467014471c01eb30604a062430de42f84d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103580
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-05-23 21:43:29 +00:00
Konstantin Shcheglov c4d691064a Remove unused methods from LinkedUnitContext.
R=brianwilkerson@google.com

Change-Id: I5acc7ab0381ac8912b3d4ba6bec89d7554aea43b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103547
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-23 20:42:20 +00:00
Konstantin Shcheglov 5822645e66 Support for 'Wrap with Xyz' for expressions in ExpressionFunctionBody.
R=brianwilkerson@google.com

Bug: https://github.com/flutter/flutter-intellij/issues/3500
Change-Id: I9e14d6cd1a79070fd489740a881199707be83e90
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103563
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-23 20:00:26 +00:00
Konstantin Shcheglov 4b7c05f2ce Remove LinkedNodeVariablesDeclaration.
We don't need it anymore - we can go up the AST hierarchy to the
enclosing TopLevelVariableDeclaration.

R=brianwilkerson@google.com, paulberry@google.com

Change-Id: Iadc9985bb5bcaa465c3505794ceac51e7b06a930
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103564
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-05-23 19:39:00 +00:00
Jaime Wren cd2188f2f5 DAS change in hover behavior- the containingLibraryName now returns the URI of the containing library instead of the (possibly non-existent) library name
Change-Id: Ief2a7615b92ca635c696d48f907677bae538577b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103481
Reviewed-by: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-23 19:06:19 +00:00
Danny Tuppeny 4fc86d726f Fix some lints in LSP tests
Change-Id: Iff7e69d5d452a7bd405b727ab4966e1d71a89bda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103531
Auto-Submit: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-23 17:54:03 +00:00
Paul Berry 7bbd8ea29d Introduce a representation of the type Never?.
This type is equivalent to the existing type `Null`, but we need it
anyway because `Null` can only be accessed via the type provider, and
there are circumstances where we need to create this type and don't
have access to the type provider.

It also may prove beneficial to be able to distinguish between `Null`
and `Never?` in diagnostic messages.

Change-Id: I6118e87c8c4736a508a3f366f2762a96198db7ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103540
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-23 17:15:21 +00:00
Brian Wilkerson 28f701982b Add diagnostic location info to more tests
Change-Id: Id5d0e617a55abc2e1ed3d0bac7ae56544aa348e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103543
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-05-23 16:18:50 +00:00
Brian Wilkerson 1993669102 Clean up examples in analyzer docs that were using deprecated APIs and add a test to catch future breakages
Change-Id: I74bdb4c7474d130ae87e7cdc5991d7fadc79e453
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103465
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-05-23 13:15:36 +00:00
Johnni Winther 181aeb30e7 Don't use OneShotInterceptorData during codegen and remove SuperMemberData
Change-Id: I9e7f869c4f639404b6b016c1d3dff2dad4555dcc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103133
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-23 10:58:56 +00:00
Dan Rubel d92341be08 first cut parse extension methods
This is an incomplete parser implementation of extension methods.
Subsequent CLs will flesh out the details.

Change-Id: I8c891827e97b451388cadc9cedea3afb7a8cf922
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103464
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-23 10:54:34 +00:00
Dan Rubel 0c891451a8 cleanup parser forwarding and test listeners
Change-Id: I593f8bf862179684a031c9538def62c8415c0d77
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103483
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-05-22 22:11:40 +00:00
Dan Rubel 6edefda065 cleanup token rewriter and clients
Change-Id: I05f3549c37abccaa7ce7119c0b9d3a084a381f80
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103500
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-22 22:11:40 +00:00
Konstantin Shcheglov 4ccf7b865e Don't set type for StringLiteral(s) in directives.
R=brianwilkerson@google.com

Change-Id: Ie34d481c5ef07008d38aee1e89f1beb8a313590a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103460
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-22 20:37:31 +00:00
Vijay Menon caac50d7ff [dartdevc] Fix metalet regression
Hitting this when compiling the analyzer with DDC.  I thought this was exercised
when training the DDC snapshot (it compiles itself), but it seems not.

Lost the assignment here on the recent implicit cast removal.

Change-Id: Id1a74999c75b2a36071bac3692c2022e7ad7eefe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103482
Commit-Queue: Vijay Menon <vsm@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Auto-Submit: Vijay Menon <vsm@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2019-05-22 19:12:10 +00:00
Alexander Markov ec4d48e241 [vm/bytecode] Add starting and ending source positions for closures
Issue: https://github.com/dart-lang/sdk/issues/36427
Change-Id: Ib2f55504f9238036a9700f1e2672b4641536ab7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103480
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-05-22 19:02:40 +00:00
Vijay Menon efde7dd642 [dartdevc] fix assert
Hitting this when compiling the analyzer with ddc.  Should sanity check that our bots are
running with assertions enabled.

Change-Id: I1276b936162f3adc830a79d1f014c6dccd80de86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103461
Auto-Submit: Vijay Menon <vsm@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2019-05-22 19:00:40 +00:00
Sam Rawlins b22cd05c51 Reland fix for #28233: add hint for missing returns to function expressions
The bulk of this change is actually correcting missing returns in the Dart SDK.

Bug: https://github.com/dart-lang/sdk/issues/28233
Change-Id: I52bcbc6c6f4a129d3fc22003f4448a7c3d4487ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100301
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-05-22 18:12:30 +00:00
Nate Bosch e15a98c4f2 Tighten types for runtimeStatement and runtimeCall
Only ~29/100 calls for runtimeCall and ~2/31 calls for runtimeStatement
were using the single value option. Change to take a `List<Object>`
always and add list literals to those calls which were previously only
passing one value.

Update pubspec SDk constraint so that the analyzer will allow the `..?`
syntax.

Change-Id: Ib8eb8eb854a8aa04e36dc5cc713016a43b8e9325
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103361
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2019-05-22 17:38:15 +00:00
Nate Bosch c86c277c0f Reapply "Use the full URI for DDK library debug names"
This reverts commit 3bc0ad4ee3.

Fixes #36736

The problems with hot reload are fixed in
https://github.com/dart-lang/build/pull/2280

Change-Id: I12de170423c6bfe73816172959e4bc624d9b0f13
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103362
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2019-05-22 16:52:27 +00:00
Brian Wilkerson 7d1b54bd47 Add a minimal implementation of ExtensionDeclaration
Change-Id: I5a556ea1819b38a3130e801a3cbc4bcbad98dcdd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103380
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-05-22 12:43:02 +00:00
Kevin Millikin 07a45e9d4c [cfe] Transform collections before set literals
The VM uses the collection and set literal transformations.  The set
literal transformation assumes that collections have already been
transformed.  This was not done correctly when translating a
list (e.g., constructor initializers).

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

Change-Id: If7a6bda55f8cf0efd761fd8932d3a9e2c60db19b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103134
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Auto-Submit: Kevin Millikin <kmillikin@google.com>
2019-05-22 07:30:46 +00:00
Johnni Winther bbd22cb8ff Changes that slipped through rebasing
Change-Id: I7d40fe0c5bc360fb154d3490e134125265ab366d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103132
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-05-22 06:32:26 +00:00
Konstantin Shcheglov 4317c5ff3f Don't set elements and types during AstRewriteVisitor.
Resolution is incomplete at the time when we perform rewriting.
For example, in `C<int>` the type of `int` is not set, so we get
incomplete InterfaceType of `C` with `null` as the type argument.
This was crashing summary2 in one situation internally.

R=brianwilkerson@google.com

Change-Id: Ifcff68f007a90b5694cf3e4e4d3825309c04e2b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103382
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-22 03:29:17 +00:00
Mike Fairhurst 6457ac1d4b Test potentially-nullable access errors
Change-Id: Ia166dbb6fb353120e30555f60b7bea186537b05b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102242
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-22 03:17:00 +00:00
Nate Bosch 2bbb2f3c1f Disallow implicit casts
Explicit casts make it easier to confidently navigate the code base and
apply refactorings which tighten types. This change exposes a number of
places where types can be tightened, but only the most trivial were
applied. For most places I added the explicit cast that would have
happened anyway and so behavior shouldn't be changing.

- Add the configuration which disallows implicit casts in the analyzer.
- Add explicit casts in almost all instances.
- Where the implicit cast was due to a local variable type on the left,
  change it to a `var` so the type is not repeated.
- In a few places add argument types where they were already applied on
  the parent type, and the subclass was unnecessarily loosening argument
  types to dynamic.
- In a few places where a method was defined with an implicit dynamic
  return but had an obvious and consistent return type, annotate the
  method instead of casting after calls to that method.

Change-Id: I90e11b1cc08ce69967ea5705b507d5758a8f668f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103381
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-05-22 00:33:39 +00:00
danrubel add95652d2 fix AstBuilder invalid getter recovery
This fixes the Astbuilder recovery when encountering "get <identifier> :"
in a class body to build a method node rather than a constructor node.

Fix https://github.com/dart-lang/sdk/issues/36961

Change-Id: I48242838d72c3a6c18e78a469b6e07fd1481d0c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103260
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-05-22 00:28:55 +00:00
Mike Fairhurst 27e1c91c39 Add src/diagnostics test for assert(bool?)
Change-Id: I152e279db363ceb0efdb71d5741ada4a5341b8fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102521
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-21 22:17:15 +00:00
Konstantin Shcheglov e20da9c220 Fix order of resolving / writing / reading of function / method declarations.
Now that we assign indexes to occurred GenericFunctionType nodes, we
need to make the order consistent across all visitors.

R=brianwilkerson@google.com

Change-Id: Ifc9c7bfa35612cef235f000f30130d36116067e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-21 19:40:17 +00:00
Konstantin Shcheglov cfdcfe2bfe Update DeclarationsTracker when a context options change.
E.g. when .packages changes, we want to re-scan the context for new
available libraries. We also don't want to discard all context, and
resend everything.

R=brianwilkerson@google.com

Bug: https://github.com/Dart-Code/Dart-Code/issues/1723
Change-Id: I19ee71c1d021fb9bcda9d02d86b7cbb078704aa7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103320
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-21 18:43:36 +00:00
Konstantin Shcheglov 181685b852 Allow disabling individual server features.
Change-Id: I4d06eaf76300c6784b88bd64ad322c306a276488
Bug: https://github.com/dart-lang/sdk/issues/36881
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103182
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-21 18:40:26 +00:00
Mike Fairhurst 2b6b0e00d9 Fix resolveToBound for nullability
Change-Id: I510c349251588356677d52574f259706ec2047e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103183
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-05-21 17:58:56 +00:00
Brian Wilkerson 7c7738a9c7 Proposed AST interface for extension methods
Change-Id: I7c85a642eeaa862ecf9c6837c0a488938e8d97e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101225
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-05-21 17:16:38 +00:00
Danny Tuppeny 88f139db68 Fix NPEs when processing unknown kinds in LSP
Fixes https://github.com/dart-lang/sdk/issues/37016.

Change-Id: I72eae50a03bb2c73678b65a07e6924a2a53d137e
Bug: https://github.com/dart-lang/sdk/issues/37016
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103131
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2019-05-21 13:30:10 +00:00
Dmitry Stefantsov f62ab5ed3d [fasta] Allow super-bounded types as bounds of type variables
Change-Id: If1f10d8e5b6d6288696926dc3cab6ad8a3b8d446
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/79701
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-05-21 12:25:10 +00:00
Aske Simon Christensen c4e8cf469a [CFE] Clean out spread and if support from constant evaluator.
Change-Id: I01ab65980662183c94df3345796bafad2a335043
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103125
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2019-05-21 11:07:26 +00:00
Aske Simon Christensen f051cd5b4d [CFE] Transform spread and if in const collections early.
This makes sure that the AST before constant evaluation only contains
official kernel nodes.

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

Change-Id: Ic4e8e15adeaea8ad4700d6feb67e31f5f0a54f7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103123
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-05-21 11:07:26 +00:00
Jens Johansen 2bbb6aae9b Fixes to incremental DDK/blaze
This CL fixes a number of issues:
* Semi-leaking old components when starting over
  (i.e. when loading a new sdk)
* Setting new filesystem not really working because the old one was
  cached in the ProcessedOptions
* Leaking old state because of an apparent VM bug (http://dartbug.com/36983)

Change-Id: Ib124257c456b019941e253409c1ef56eedcf66b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103121
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-05-21 09:10:58 +00:00
Jens Johansen 7f67e83e36 Add sanity check assert int class hierarchy
Change-Id: Iddcf2b64f745bb9385fb5b1621afa68056da89a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103127
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-05-21 08:23:08 +00:00
Jens Johansen 6b730e8203 [bazel/kernel_worker] Only workers use incremental compiler; require digest
Change-Id: Iff4b45ffba79a05ce829ed73d952937ae55624d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101282
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2019-05-21 08:13:58 +00:00
Jens Johansen 099af47a69 [kernel] add ability to disable offsets for bazel worker to use
This is a lightly modified version of Jennys CL @
https://dart-review.googlesource.com/100275

Change-Id: I46a1665d84d04602af1f338cf963bc25b4e6b25c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101280
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-05-21 07:55:10 +00:00
Sigmund Cherem 0c2738f616 Allow steps to declare more than one result
Change-Id: Ifd2a19f8ff771d464737bb27e22cf05a43cc2a9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103020
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-05-20 23:25:22 +00:00
Sigmund Cherem 84fd1254ec Add tests for only-main behavior
+ move computeTransitiveDependencies to a shared location

Change-Id: I9bfad3d1799df2be36f28fac1a6ea9a8b4c4b023
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102225
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-05-20 23:25:22 +00:00
Jacob Richman e2976acd22 Add --track-widget-creation flag to frontend_server.
This is needed to activate the kernel transformer embedded with the kernel package from the flutter engine.

Change-Id: I3253e01723b662eb48b4b3743ac5bcc1b44c7d46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102920
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Jacob Richman <jacobr@google.com>
2019-05-20 22:47:28 +00:00
Nicholas Shahan 2fd1021326 [dartdevc] Turn on lints and cleanup violations
Working towards turning on all lints from package:pedantic. This change includes
the lints that needed cleanup and don't change any behavior.

Applied cleanup:
* Don't explicitly initialize variables to null.
* DO use curly braces for all flow control structures.
* Use `.isEmpty` instead of `.length == 0`.
* Use `.isNotEmpty` instead of `.length > 0` or `! .isEmpty`.
* Use `=` to separate a named parameter from its default value.

The remaining lints from package:pedantic will require cleanup that is less
automatic and will be addressed in later changes.

Change-Id: Ie4c3ba685f8a559209dd14ac037203ecd16252c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103086
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-05-20 20:20:47 +00:00
Nate Bosch 9adc5be551 Dartfmt all of DDC with the latest
Some changes in indentation for adjacent string literals and a case of
formatting inside string interpolation.

Change-Id: I30eb9b9e891a11a54f89351e0f2d4c0172e69066
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103161
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2019-05-20 19:14:37 +00:00
Nate Bosch e9b5c9ce8b Ignore todos in DDC
These aren't useful to see cluttering up diagnostic lists - they can be
found easily enough in other ways.

Change-Id: I34b800c1145ae476822afddff558d62c4ffb9b2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103141
Reviewed-by: Mark Zhou <markzipan@google.com>
2019-05-20 17:39:42 +00:00
Nate Bosch 04e329b6ed Add override annotations across DDC
Previously 36% of overrides were annotated, including inconsistent
annotations within a single class.

- Add annotations on remaining overridden methods.
- Add linter section to `analysis_options.yaml` so that missing
  annotations are visible while editing.

Change-Id: Ief1a6d5b8da6f4b630a6cfc72a6ed67db346c081
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103140
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2019-05-20 17:31:26 +00:00
Konstantin Shcheglov 959e7df20e Remove 'await null' in build mode.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I903a389ab15d45cc18d3678bc44ff8d78ffba683
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103083
Reviewed-by: Paul Berry <paulberry@google.com>
2019-05-20 16:58:35 +00:00
Konstantin Shcheglov 59381cd8d0 Fix summary2 linking when using API summaries, which don't include line starts.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: Iee403b154e4ca546ee69ae7cf0a8764d48ac7d34
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103081
Reviewed-by: Paul Berry <paulberry@google.com>
2019-05-20 16:58:12 +00:00
Konstantin Shcheglov 59bcb38db7 Report the missing library in LinkedElementFactory.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I0e949f853f90f676f0184acd511ddde880d87a02
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103082
Reviewed-by: Paul Berry <paulberry@google.com>
2019-05-20 16:57:56 +00:00
Danny Tuppeny 022adc5bc3 Implement using suggestion sets for LSP completions
Change-Id: I66d725c09492040be5e621d80270b12a21bb8192
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102704
Commit-Queue: Danny Tuppeny <dantup@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-20 10:09:41 +00:00
Danny Tuppeny 0f24e4b277 Wire up LSP completion resolution provider + sendWorkspaceEdit command
Change-Id: I424b4d9bbc64f6fea7a4d9b06e2180b3fbd21f86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102703
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-20 10:09:41 +00:00
Danny Tuppeny b6ce27a141 Add LSP tests for suggestion sets (marked failing)
Change-Id: Iab8f632038f136963ea2e02fa9e9d76c66e32845
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102702
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-20 10:09:41 +00:00
Danny Tuppeny 7be23977f1 Minor LSP tweaks in preperation for included suggestionSets
Change-Id: I9dff56139754b8a182e906d64dd0bcc009c4b6fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102701
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-20 10:09:41 +00:00
Johnni Winther 09b46aa084 Support in-memory CodegenResult serialization/deserialization
The serialization/deserialization is performed in test-mode.

Change-Id: I90f31a6a88dbdf2c38beb9b5409ce3c52557e227
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102740
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-20 08:57:39 +00:00
Johnni Winther c69d0c6e30 Flatten DynamicUse and StaticUse class hierarchies
Change-Id: Ib325425dfab7d7001a1a6133df1d50dddfadcbab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102700
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-20 08:57:39 +00:00
Johnni Winther 6757d0c6d9 Use ModularNamer/ModularEmitter to generate code separate from codegen enqueuing
Change-Id: I35dc4c0370622c63f2100e22517149cb0629423e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102367
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-20 08:57:39 +00:00
Johnni Winther a9827a0c05 Refactor OneShotInterceptorData to prepare for modular codegen
Change-Id: I52d47c28978c0d935d07b438520728a304d311d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102365
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-20 08:57:39 +00:00
Johnni Winther c0b967d7da Refactor Namer and ConstantEmitter to prepare for modular compilation
Change-Id: I2fa8928d7c7d845df2507c9ad034107ec4bc21de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102364
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-20 08:57:39 +00:00
Johnni Winther 670ac1aca8 Prepare js_ast for more advanced use of DeferredExpression
Change-Id: I008dc7ce21437475c2fa1d5505b42f9d4a4aa166
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102363
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-05-20 07:46:58 +00:00
Konstantin Shcheglov e13b1b6e0c Build summary2 for SDK.
Note, that this will start building it always, regardless of the
state of the useSummary2 flag.

Summary1: 4892680 bytes.
Summary2: 7105744 bytes.
Both:    10748992 bytes.

Time:
Summary1: 2550 ms.
Summary2: 2750 ms.
Both:     4000 ms.

Change-Id: If81367c24654c1d57a4dcdbd42f76d80ae8c4b39
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102540
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-19 20:05:01 +00:00
Konstantin Shcheglov 58cf83df4d Don't crash on during indexing references to named parameters of a generic function types.
R=brianwilkerson@google.com

Change-Id: I0da0b1785d7dab2c7c84527317e542b7ef718bd3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103080
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-19 19:08:31 +00:00
Konstantin Shcheglov 5e5b03881c Fix for exporting setters.
R=brianwilkerson@google.com

Change-Id: Ie67834547a94a480e8ed86df430c40bcb36e37e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103024
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-19 17:50:09 +00:00
Konstantin Shcheglov 234103f9d4 Fix for hasImplicitReturnType.
R=brianwilkerson@google.com

Change-Id: I94e1e0f8246f3ff0d284ef7b1de6f618ad464592
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102984
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-19 17:50:07 +00:00
Paul Berry 2d8fc016b9 Sort declarations in resynthesize_common.dart
Change-Id: Iec0312bf5dc0abdbe9729c90bebade65b2ba3c74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102982
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-05-18 15:47:46 +00:00
Samir Jindel ed169c4bb0 Revert "[vm/ffi] FFI callbacks on X64."
This reverts commit be209f7846.

Reason for revert: failures on dartkb and windows bots

Original change's description:
> [vm/ffi] FFI callbacks on X64.
> 
> For context on the design, see go/dart-ffi-callbacks
> 
> Change-Id: I2482e3c932e73f9a4c00fa7e218ff85f9328fc51
> Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-debug-simdbc64-try, vm-kernel-linux-release-simdbc64-try, vm-kernel-mac-debug-simdbc64-try, vm-kernel-mac-release-simdbc64-try, vm-kernel-reload-mac-debug-simdbc64-try, vm-kernel-reload-mac-release-simdbc64-try, vm-kernel-linux-debug-ia32-try, vm-dartkb-linux-debug-simarm64-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100240
> Commit-Queue: Samir Jindel <sjindel@google.com>
> Reviewed-by: Daco Harkes <dacoharkes@google.com>

TBR=sjindel@google.com,ajcbik@google.com,dacoharkes@google.com

Change-Id: I4cb3d93675d68a51ac9e125ad1d572c47e8b5903
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-debug-simdbc64-try, vm-kernel-linux-release-simdbc64-try, vm-kernel-mac-debug-simdbc64-try, vm-kernel-mac-release-simdbc64-try, vm-kernel-reload-mac-debug-simdbc64-try, vm-kernel-reload-mac-release-simdbc64-try, vm-kernel-linux-debug-ia32-try, vm-dartkb-linux-debug-simarm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102983
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-05-18 15:29:19 +00:00
Paul Berry f930d674ca Restore old nullability behavior of TypeParameterElement.type.
It doesn't work to make TypeParameterElement.type choose
nullability/non-nullability based on the enclosing library, because
for type parameters of synthetic function types, there is no enclosing
library.

Change-Id: Ic74cc639534e3c03f3c46e7eacfb5655ca74019a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102981
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-18 15:05:26 +00:00
Brian Wilkerson ce62987c9d Remove DynamicState and make NumState an abstract class
Change-Id: I6c3ec94a26f6522d24cf964823b739dfe2c42c62
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103021
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-05-18 14:18:46 +00:00
Samir Jindel be209f7846 [vm/ffi] FFI callbacks on X64.
For context on the design, see go/dart-ffi-callbacks

Change-Id: I2482e3c932e73f9a4c00fa7e218ff85f9328fc51
Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-debug-simdbc64-try, vm-kernel-linux-release-simdbc64-try, vm-kernel-mac-debug-simdbc64-try, vm-kernel-mac-release-simdbc64-try, vm-kernel-reload-mac-debug-simdbc64-try, vm-kernel-reload-mac-release-simdbc64-try, vm-kernel-linux-debug-ia32-try, vm-dartkb-linux-debug-simarm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100240
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2019-05-18 06:15:46 +00:00
Konstantin Shcheglov 9b1c8fca91 More fixes for GenericFunctionType.
1. Read GenericFunctionType fully, but in two steps to avoid recursion.
   We need to read it fully, because it might be a part of a const
   initializer, so the client might request the initializer expression,
   and there is no way to him to finish reading. Amnd in general, we
   don't read expressions lazily.

2. For consistency we need to set identifiers for all GenericFunctionType
   nodes that we want to store. So, DeclarationResolver should be updated
   to move the identifier number even though we don't use the same
   mechanism for building elements ininitializers, as we use for type
   annotations outside expressions.

R=brianwilkerson@google.com

Change-Id: I58faa5408bff5250a8c775249438def7f742594b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102840
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-05-18 00:20:36 +00:00
Konstantin Shcheglov cf15dc17e0 With summary2 FunctionTypedFormalParameter has type parameters.
This re-applies changes to tests from https://dart-review.googlesource.com/c/sdk/+/100620

R=brianwilkerson@google.com

Change-Id: If6721d2febb39b52277fdb39845bb2486cb6eb47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102860
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-05-17 23:31:16 +00:00
danrubel 7983fac33b add "extension" built-in keyword for extension methods
Change-Id: I6529fff31f681fd24c22f8c7579d2a35097f4d07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102940
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-05-17 22:24:15 +00:00
Sigmund Cherem 475f55d46b Add dart2js modular test suite under a unit test.
At this time this only compiles to .dill and then compiles from multiple modular
dill files.

Next steps: add the global split and add the modular data bits

Change-Id: I3399776dbd5187ddb0a3e2fdd307622a736570c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102126
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-05-17 22:21:05 +00:00
Sigmund Cherem 1f409716d6 Add packageBase to simplify how we build packages files and how we process
package import uris

THis is not actively used in the loader unit tests yet, but will be in the
dart2js pipeline.

Change-Id: Ie0db6243c735e2fba396f2a5a156d52ea1e53bbe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102125
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-05-17 22:21:05 +00:00
Paul Berry 8d52c0d08e Store library nullability status in LibraryElement; adjust TypeParameterElement.type based on it.
Change-Id: I0a9673b3b2f46bbf5c3aea429e90c6ddafa978e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102224
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-05-17 21:27:21 +00:00
danrubel c33f1a079e revise scanner api so that error tokens are always prepended
This CL revises the scanner API so that tokens are always prepended
to the beginning of the token stream. This allows the parser handling
of error tokens to be simplified. Any clients using the scanner directly
rather than through the scanner API should call scannerRecovery
if the scanner has detected errors in the content.

Change-Id: I32510da10205bd964f80898a238489d1508733e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102680
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-05-17 20:59:51 +00:00
Paul Berry 42334a7f67 Infer when the bound of a type parameter needs to be nullable.
Change-Id: I6c500318a66e05a0b3d10c85f07660dfe37339ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103000
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-05-17 20:41:11 +00:00