Commit Graph

24364 Commits

Author SHA1 Message Date
Dmitry Stefantsov f21d521d0e [cfe] Fix pre-inference set/map disambiguation
Closes #36377

Bug: http://dartbug.com/36377
Change-Id: I0a486f467bdc999e6188fb3206f4eed1d8ffb67a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98341
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-03-29 17:18:55 +00:00
Dmitry Stefantsov 6b19aa821b [cfe] Do type checks on spreads during inference
Change-Id: I9eb72681a5a019ff7f7e030cf5f500144293bd4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98180
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-03-29 17:18:55 +00:00
Dmitry Stefantsov 1a5ed8247f [fasta] Fix typos and copy-paste errors in a test case
Change-Id: I5d65f4ec44cb358767b1a8902d862dba1be1bb6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98019
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-03-29 17:18:55 +00:00
Dmitry Stefantsov 584affcffa [cfe] Add initial support for 'for' and for-in elements in maps
Change-Id: I9fade4b8ac193f4d9a4df33c71447c0cb5fc3590
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98015
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-03-29 17:18:55 +00:00
Dmitry Stefantsov fa7e0c7531 [cfe] Add element type checks in spreads
Closes #36348

Bug: http://dartbug.com/36348
Change-Id: I2952e4430409bc84a97e611b43cf8885a5f5a6f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98003
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-03-29 17:18:55 +00:00
Brian Wilkerson 1b2a4b8eb1 Convert some tests to DriverResolutionTest
Change-Id: I0fdccb13b95b6e5047030ba084d4358c65a8e72f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98303
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-03-29 17:11:38 +00:00
Aske Simon Christensen fb58826aa3 [CFE] Compensate for lowering and desugaring in spread.
This fixes a problem where a set or map in a spread would not be
properly recognized by the constant evaluator when compiling for a
VM target.

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

Change-Id: I01efc932994c143fa5a5a2fbacda21fe9206e3e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98330
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-03-29 16:59:06 +00:00
Johnni Winther 7ef28f0b03 Handle constant field init registration correctly.
+ avoid side-effects of checking enqueuer invariants

Change-Id: Id327371bc70e4b1b5fd4d326b8c8cf8caf50ea0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98142
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-03-29 16:44:15 +00:00
Johnni Winther da0de0a867 Handle native field impact correctly from ir constants
Change-Id: I0393fd57b78c7cb417888ec3e0ff139b888bf3a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98322
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-03-29 16:41:55 +00:00
Brian Wilkerson 0560014c79 Remove unused error codes
Change-Id: I47daa6dab610af657ca781db5ca88438988c3c87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98162
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-03-29 15:37:26 +00:00
Konstantin Shcheglov e8b56268ef Resolve constructor initializers and redirections.
R=brianwilkerson@google.com

Change-Id: I296fb2a7b47846481f99b5478a6cd4e383112c5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98264
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-03-29 15:31:55 +00:00
Jens Johansen 4fe2f6f349 Add more tests to the incremental compiler
Add a test that reproduces a error we had in flutter code when
for instance 51da94da76 was HEAD.

Add a test for constant sets.

Change-Id: Ibae4891623bb23b93473aae6b29387cfcb66bf3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98340
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-03-29 12:20:12 +00:00
Jens Johansen b7f69e24a2 dartdevc and bazel worker can use incremental compiler
This allows dartdevc and the bazel worker to user
the incremental compiler with kernel.
Use --reuse-compiler-result --use-incremental-compiler to run in this mode.

Change-Id: I9189ce5f1a51320d9d96e071f8c95c80fe6fca84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95386
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2019-03-29 12:07:42 +00:00
Konstantin Shcheglov 9b77e4c507 Include constructors into available suggestions.
R=brianwilkerson@google.com

Change-Id: I44a9ad96f40ff1c5bd42f41bdf03defae7608360
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/94980
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-03-29 01:26:39 +00:00
Brian Wilkerson edf470bf83 Initial sketch of dartdoc support
Change-Id: I1250bfd56075d6575c0f268b4e335445b13b4605
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97443
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-03-28 20:52:29 +00:00
Konstantin Shcheglov 1b643e5c1f Support for mixins.
R=brianwilkerson@google.com

Change-Id: I35e37863ed6ab68756669829f6ae8461e56485cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97782
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-03-28 19:31:13 +00:00
Brian Wilkerson 4c50d06ac5 Handle inconsistent analysis exception during a refactoring (issue 36149)
Change-Id: I94f5d16d7a3cbcf4a33892428f0dc8056dbdd318
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98200
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-03-28 18:33:05 +00:00
Brian Wilkerson d07e33e11f Convert more comments from block to line style
Change-Id: Ib1b2b1f6858c3c7503fd7a701b9badb9cfbfe8d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98050
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-03-28 17:54:00 +00:00
Brian Wilkerson 926a6c0958 Convert more comments
Change-Id: I6e198ee0809ee352038e2014a983d43b0c29101f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98048
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-03-28 17:52:05 +00:00
Konstantin Shcheglov 1926f69e4d Include available classes when includeConstructorSuggestions is true.
R=brianwilkerson@google.com

Change-Id: I333ac2d1e19c077f31f02b2504b3041fd04acf7b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98161
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-03-28 17:26:55 +00:00
Brian Wilkerson d0fda82493 Clean up some of the unused task model support in test code
Change-Id: I2a70070866e38377a4dd149b6407942e3f81c92d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98049
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-03-28 17:13:45 +00:00
Ben Konyi ac2c934563 Reland "[ VM / dart:isolate ] Added ability to set names for spawned isolates."
This reverts commit 638f13ff3d.

Change-Id: Ib5015539b1c93791c2469be6995789f8f0362806
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97845
Commit-Queue: Ben Konyi <bkonyi@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-03-28 16:39:50 +00:00
Aske Simon Christensen f0027dfea3 [CFE] JS number semantics for constant subtype checks.
Change-Id: I7c12ec41ac6bab6318f4ff52201bdf333a6b81e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98141
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-03-28 15:00:58 +00:00
Aske Simon Christensen 018fd36557 [CFE] Handle spread and if in const map literals.
Change-Id: I5250a115c1c98849a695e1d159532a49605c7caf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98014
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-03-28 15:00:58 +00:00
Aske Simon Christensen b5be157e09 [CFE] Handle spread and if in const set literals.
Change-Id: I7db79282c1caafb2f8f07cd676e4bbe0941cd264
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98009
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-03-28 15:00:58 +00:00
Aske Simon Christensen 0b57b67ecb [CFE] Move const set desugaring to constant evaluator.
To properly recognize control-flow constructs in sets, the constant
evaluator needs to get un-desugared set literals. This commit skips the
desugaring of const set literals if the constant evaluator is enabled
and adds a similar desugaring in the constant evaluator.

Doing the desugaring in the constant evaluator (which can be called
independently of Fasta) necessitates that dart:collection is indexed
in CoreTypes. We can remove this indexing again when the VM gains
native support for set constants.

Change-Id: Ibddafdcb182e4471012801745b51b529805b7b9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98008
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-03-28 15:00:58 +00:00
Aske Simon Christensen 102b1fa39e [CFE] Handle spread and if in const list literals.
Change-Id: I534dcd2e02d8d70b83b55a4890fb1a6e1bf6170d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97307
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-03-28 15:00:58 +00:00
Aske Simon Christensen 665d2d0003 [CFE] Leave const collections to the constant evaluator.
Change-Id: Ib828bfa7f5695657e9e5ca67f7a9c3868a2a8fa1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97936
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-03-28 15:00:58 +00:00
Jens Johansen a977273262 Re-allow the incremental compiler to load modules
This reverts commit 4d43abdd9f2f3026ccfabaa5495499b3ea220430 and adds a
fix.

Change-Id: Id80186aba02dd80171aac3843d63aa4f42c5ca17
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98017
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-03-28 12:53:01 +00:00
Dmitry Stefantsov 7b33a8fdc4 [cfe] Fix type inference in map literals with spreads
Closes #36223

Bug: http://dartbug.com/36223
Change-Id: Id274361628f5b769609ca9c9513e48dbfaa42374
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97963
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-03-28 12:30:41 +00:00
Dmitry Stefantsov 864b22d3ce [cfe] Add inference and type checks to if-elements in maps
Change-Id: I3cacaee173320dd52bead6688fac24e4e4a01f0f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97962
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-03-28 12:30:41 +00:00
Johnni Winther 05f3b12960 Add test for native declarations
Change-Id: Iea9d8d27e6fdefa6f47471a459cdb4363aab65e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98011
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-03-28 10:29:11 +00:00
Johnni Winther b978fdd142 Move experimental flag defaults to CFE
Change-Id: I9f1890f349fb19bbd792af071adc14ad4e50c364
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98010
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-03-28 10:19:51 +00:00
Jens Johansen 3e4a1de6e9 Use dart:foo-patch import uri for patches; remove VM workaround for sdk uris
Closes #32087.

Change-Id: I93a757125bf29bc283bf6536fa5e53a4f9334891
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97311
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-03-28 10:00:51 +00:00
Jens Johansen cf768254fd Temporarily disable 'Allow the incremental compiler to load modules'
Caused weird test failures. Disabling while investigating.

Change-Id: I566a209175a1ad6a4384ee815f54ba04bdb75570
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98120
Reviewed-by: Jens Johansen <jensj@google.com>
2019-03-28 09:59:29 +00:00
Johnni Winther 7baae76480 Always use ir constants in annotations when constant-update-2018 is enabled
Change-Id: Ib5ba6a908904c36a8580f6f47424b6982800dddd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98002
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-03-28 09:34:21 +00:00
Johnni Winther 10abacba10 Use hasOnlyNonDeferredImportPathsToConstant to add deferred constants
Change-Id: Ifd8b733c526fe4e7ae837a7d17c682e91717feb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98013
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-03-28 09:17:31 +00:00
Jens Johansen 32a5fa0a83 Allow incremental compiler to just create outline
Change-Id: I996787821f01f21bb41be837e6d4c25a2114e017
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95384
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2019-03-28 08:44:56 +00:00
Jens Johansen 83e6e9f8e6 Allow the incremental compiler to load modules
Change-Id: I63bbbdfc94ac6ab0b7b8cce104fe38c4ba592f34
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95382
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-03-28 08:39:41 +00:00
Jens Johansen ef168de000 [vm/kernel] Index all source and line starts before using them (2nd try)
By indexing all sources in a concatenated dill file and then using that
index to find the sources and line starts we can fix missing information
(leading to crashes when collecting coverage) in for instance circular
instances.

This reverts commit 57321c1590 and adds a
fix.

Change-Id: I7a91801fb318cad0218cf3101d6a15f1ec929175
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98006
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-03-28 08:36:51 +00:00
Brian Wilkerson 3364df5050 Fix a bug that led to a divide-by-zero exception
Change-Id: Ia5ba4a2e24108d2017ea3ed2a8a2a56cdd9c110e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98042
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2019-03-27 23:41:19 +00:00
Stephen Adams f226f4ff24 Improve type of typed-array load
- Typed array elements are never null, but type inference sometimes
  thinks they are.

- Annotated isNan and isFinite as pure.

Change-Id: I5fffd237374444db27665009cf550b26563bcf55
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98046
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2019-03-27 23:22:50 +00:00
Alexander Markov 0d93a85916 [vm/bytecode] Clean component metadata except bytecode when dropping AST
Change-Id: If0a7894406458b0cb6f4e1c5e4d60a6377b2459b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98044
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-03-27 21:07:50 +00:00
Bob Nystrom ffee99d79b Add asyncExpectThrows<T>() to async_helper.
This lets you test that a callback returns a Future that completes to
a given error. Like Expect.throws(), but async.

At first, I added support for this directly to Expect.throws(), but I
think it's better to minimize the amount of dynamic logic going on in
the language test framework.

I was worried about having to duplicate all of the Expect.throws___()
convenience functions but now that we have generic methods, those
functions aren't that much more convenient.

Change-Id: I8b288945611fa16f8d27056f3cf79181fc22d256
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97881
Reviewed-by: William Hesse <whesse@google.com>
2019-03-27 18:26:15 +00:00
Brian Wilkerson 4555cf788d Convert one more set of tests
Change-Id: I4854985bd475d95c17be83e648bf5716d6156fbd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98020
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-03-27 17:37:41 +00:00
Nicholas Shahan a9ee08051d [dartdevc] Remove redundant parameters from helper methods
These were added to unify code paths between SetLiteral, MapLiteral and
SetOrMapLiteral visitors. SetLiteral and MapLiteral nodes have been removed
so elements can be accessed safely through the node parameter.

Change-Id: Ib42cc85d2a2307115618601359e573a15a3d3f1b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97944
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2019-03-27 16:17:49 +00:00
Mike Fairhurst 1bbd282d65 Make analyzer/tool/summary/generate.dart take an IDL path
Change-Id: I919b6d92342076ed4420dcc4a5ee94853a35ed41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96240
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-03-27 16:08:47 +00:00
Johnni Winther 8a92d2a8d9 Collect types deeply for deferred loading
Change-Id: I7bbd9499975c78fcdcfa88ceba31cb2e8e5a7cc6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97639
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2019-03-27 11:08:37 +00:00
Brian Wilkerson 45c367d8e8 Add plugin performance data to the server status pages
Change-Id: Id890366462f94204d349ff625516354d09d50b53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97943
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-03-26 22:27:10 +00:00
Keerti Parthasarathy 57321c1590 Revert "[vm/kernel] Index all source and line starts before using them"
This reverts commit a7ab99dd84.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> [vm/kernel] Index all source and line starts before using them
> 
> By indexing all sources in a concatenated dill file and then using that
> index to find the sources and line starts we can fix missing information
> (leading to crashes when collecting coverage) in for instance circular
> instances.
> 
> Change-Id: I454cff57f84f21de72f6486e1cecf15d1389a498
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96901
> Commit-Queue: Jens Johansen <jensj@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>

TBR=vegorov@google.com,jensj@google.com

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

Change-Id: Iea75c9dd56e74fa0e98c90ea6841ed66b39d40cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97941
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2019-03-26 22:13:10 +00:00