Commit graph

18697 commits

Author SHA1 Message Date
Johnni Winther 220a91122a Add --strong-mode flag to dart2js
+ move generic methods tests into a subfolder.

Change-Id: I00cde6a7dc7d6ff1677a8ca60f3a243f065e3765
Reviewed-on: https://dart-review.googlesource.com/31782
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-01-02 08:42:21 +00:00
Konstantin Shcheglov 9b54b25f3e Fix error reporting when it makes tests behave differently in checked and unchecked modes.
R=brianwilkerson@google.com

Bug:
Change-Id: Ib5f7b3c531bfd767e5640ff45e1ad9e7ef0148a9
Reviewed-on: https://dart-review.googlesource.com/31882
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-01-02 05:01:34 +00:00
Brian Wilkerson 1d8a5d77c1 Convert more tests to use ResourceProviderMixin
Change-Id: Ia4cce51e33c79c82a989bfda9b8303dfaa72e103
Reviewed-on: https://dart-review.googlesource.com/31880
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-01-02 00:47:34 +00:00
Brian Wilkerson 98e0c26a89 Convert several test classes to use ResourceProviderMixin
Change-Id: I1c85c6f29ae74cca0b594fc1f9ddae098b815e72
Reviewed-on: https://dart-review.googlesource.com/31860
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-01-01 16:21:02 +00:00
Brian Wilkerson 706d3382ed Extract common test utilities into a mixin and use them in one class
Change-Id: I4f4b0cc29854b9a5168bf861667a9d87c5be7966
Reviewed-on: https://dart-review.googlesource.com/31821
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-30 19:50:40 +00:00
Konstantin Shcheglov 990dba4e08 Apply resolution to import prefixes.
R=brianwilkerson@google.com

Bug:
Change-Id: I9598e11b21ea714f06ce33706c467a161091675a
Reviewed-on: https://dart-review.googlesource.com/31840
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-12-30 19:32:19 +00:00
Konstantin Shcheglov 4c71074fb8 Fix for annotation resolution and test.
R=brianwilkerson@google.com

Bug:
Change-Id: I08cdbfb2c2dec9264fc0afcba83d9f76406d5400
Reviewed-on: https://dart-review.googlesource.com/31820
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-12-30 04:12:55 +00:00
Konstantin Shcheglov b8ff3ae081 Record invocation type arguments, and apply to explicit nodes.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: Iccd71aafb4baa2c384e43511527f503003ea7e85
Reviewed-on: https://dart-review.googlesource.com/31760
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-12-29 20:31:05 +00:00
Johnni Winther 50c0c38a60 Move unittests, #12 of ?
Change-Id: I218d69ecdefc7580ab192eb1aa36a0f000427c92
Reviewed-on: https://dart-review.googlesource.com/31485
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-29 13:02:07 +00:00
Johnni Winther e2b377c73f Move unittests, part #11 of ?
Change-Id: Id45adc172695b71716d5ef7019d688641ca828c4
Reviewed-on: https://dart-review.googlesource.com/31483
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-29 12:35:22 +00:00
Johnni Winther 399f0326c9 Move unittests, part #10 of ?
Change-Id: Ia346ac44c75b349b61c35e2e9816a7f3d92f04b4
Reviewed-on: https://dart-review.googlesource.com/31481
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-29 12:15:06 +00:00
Johnni Winther f6e69b1681 Port unittests, #10 of ?
Change-Id: Ic9b8f26d2d08b640a4e06653a1ea8f0623a406b5
Reviewed-on: https://dart-review.googlesource.com/31480
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-29 11:58:19 +00:00
Johnni Winther 410c3c4a69 Move unittests, part #9 of ?
Change-Id: Ief32bb619da08133a4247b2e4f80cad592f18d77
Reviewed-on: https://dart-review.googlesource.com/31423
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-29 11:40:45 +00:00
Johnni Winther 9c954eb0ee Port unittests, part #8 of ?
Change-Id: I04b456d2a7c7d7ce0ad58546f2592d7ae852bf36
Reviewed-on: https://dart-review.googlesource.com/31420
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-29 10:33:42 +00:00
Johnni Winther 7fd07aa6a2 Sort emitted instance members
- and include injected members in ElementEnvironment.forEachLocalClassMember

Change-Id: I90afacf62177fcc5dfd57f23ccc6a7bb5ca4ef37
Reviewed-on: https://dart-review.googlesource.com/31342
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-29 10:15:23 +00:00
Sigmund Cherem 1ddb7db237 Add support for deferred globals in kernel.
Change-Id: I24adb7e4c67b7c1d077efd6705b9bce92406deac
Reviewed-on: https://dart-review.googlesource.com/31680
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
2017-12-29 07:17:53 +00:00
Konstantin Shcheglov fa6f91999c Resynthetize FunctionType(s) with synthetic element.
Use actual element for typedef(s).

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

Bug:
Change-Id: I01163de0a8a3c776e8bdd1bd0973962e687cfbac
Reviewed-on: https://dart-review.googlesource.com/31580
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-12-28 20:47:26 +00:00
Emily Fortuna fa9e576a40 Adjust importsTo so that you can get the import chain for entities other than memberEntities.
Also added some more tests to the deferred equivalence test.


Bug:
Change-Id: Ia5ca50728a96020ff76b7b519558cdb5847d598e
Reviewed-on: https://dart-review.googlesource.com/31600
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-28 19:31:13 +00:00
Brian Wilkerson 09edf6b3fe Remove an unused import
Change-Id: I67c1b7a1bf24fcfb83d7ceb4be60d1492c6c54af
Reviewed-on: https://dart-review.googlesource.com/31405
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-28 16:41:13 +00:00
Stephen Adams f937039bd6 Remove unused JS_BUILTIN
Became unused at:
1ae1ec7df4
Change-Id: I92c167dc2a071a45b2635b9b1d907015043d60ab
Reviewed-on: https://dart-review.googlesource.com/31560
Reviewed-by: Emily Fortuna <efortuna@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2017-12-28 01:16:02 +00:00
Sigmund Cherem 80a74e6bff Revert "Support module names in DDK" and "Do not assume file-uris in other parts of DDK"
This reverts commits e122f48257 and b2b902f55a.

Reason for revert: broke ddk in windows, need to investigate proper fix

Change-Id: I5c03bae406f57570cc465aad32610c19ac385944
Reviewed-on: https://dart-review.googlesource.com/31541
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-27 23:35:14 +00:00
Sigmund Cherem b2b902f55a Do not assume file-uris in other parts of DDK
TBR to make the bots green again.

TBR=jakemac@google.com

Change-Id: I5057e41f1974e6a790a37aee4bda00bb6e118f4c
Reviewed-on: https://dart-review.googlesource.com/31520
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2017-12-27 22:33:12 +00:00
Sigmund Cherem e122f48257 Support module names in DDK
This adds the basic support for using the path to the .dill file as a module
name. The main difference between this and Jake's original CL is that we now
hide the multi-root as an implementation detail.

Change-Id: If24af1aaefa5c1445c7c84bd9ff4a7a4d738a320
Reviewed-on: https://dart-review.googlesource.com/31283
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2017-12-27 17:52:22 +00:00
Konstantin Shcheglov 0c48a11635 Check for 'null' in 'LocalElement.visibleRange'.
I was not able to reproduce this :-(

R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/31712
Change-Id: I14bdc02b6d766af00f97bc663e2acfe214529339
Reviewed-on: https://dart-review.googlesource.com/31460
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-12-24 21:29:51 +00:00
Brian Wilkerson 4ecd8f7213 Enable the analysis of pubspec.yaml files in server
Change-Id: I97c66b357d624cdcd6259c099b6421eb87c317c5
Reviewed-on: https://dart-review.googlesource.com/31404
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-24 17:20:42 +00:00
Stephen Adams 7fbacb037d Add comment on external dependency
TBR=sigmund@google.com
Bug:
Change-Id: I61a5a6d53921168c31118b42901a64015f5426bc
Reviewed-on: https://dart-review.googlesource.com/31402
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2017-12-22 22:04:14 +00:00
Dan Rubel 1231e90fee Code complete identifiers not directly referenced by the analyzer AST
The fasta parser sometimes "drops" unexpected tokens during recovery.
When this happens, the dropped or skipped token is not reported to
the listeners, and thus does not become part of the analyzer's AST.
These tokens are still in the token stream, but will not be found
by the existing CompletionTarget mechanism.

For example, the fasta parser parses
'if (v i) {}' as 'if (v) {}' and drops the 'i' token.

This CL introduces a new CompletionTarget.droppedToken field.
If a keyword or identifier has been dropped by the parser,
but overlaps the code completion offset, then that token
is placed into this new field.

In the example above, when code completing the 'i',
the CompletionTarget will now be
containingNode = '(v)'
entity         = ')'
droppedToken   = 'i'

Change-Id: I15e43529ab4a72de9500c521be278fa13ae68d99
Reviewed-on: https://dart-review.googlesource.com/31285
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2017-12-22 21:55:35 +00:00
Emily Fortuna 21891a965f Do id equivalence testing for deferred imports.
Also allows us to more generally compare annotations in multi-file tests.

Bug:
Change-Id: I2f4ac34b918cc80400ebc417dfcc2caf56457ac2
Reviewed-on: https://dart-review.googlesource.com/30923
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-12-22 20:04:44 +00:00
Brian Wilkerson ad59598a94 Fix tests to pass on Windows
Change-Id: I37cb7e9772a636015b001d634474764bea140cc5
Reviewed-on: https://dart-review.googlesource.com/31360
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-22 16:18:01 +00:00
Karl Klose 38c4eff017 Add dart2js target to fasta CLI
Change-Id: I28cbfcebb75f698493cba64d1dfa6484832ed70d
Reviewed-on: https://dart-review.googlesource.com/31300
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Karl Klose <karlklose@google.com>
2017-12-22 12:13:52 +00:00
Johnni Winther 9fe7c0e806 Port unittests, part #5 of ?
Change-Id: I58c9deea426072907a5d02f61f23f138b1f50c1d
Reviewed-on: https://dart-review.googlesource.com/31101
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-22 12:11:47 +00:00
Aske Simon Christensen de2ce48e17 Finish type variables earlier so their bounds are available when building the program.
Check bounds in verifier.
Fixed an inconsistency in the printing of parent nodes in the verifier.

Closes https://github.com/dart-lang/sdk/issues/30838
Closes https://github.com/dart-lang/sdk/issues/31213
Closes https://github.com/dart-lang/sdk/issues/31700

Change-Id: I328ca2c5bfa01a6753a806abd2510c98fa2b7cfe
Reviewed-on: https://dart-review.googlesource.com/22500
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-12-22 11:06:52 +00:00
Bob Nystrom 0e2ca151e0 Disable analyzer warning on special 'dart:_internal' import.
Change-Id: Ic8c2519555dd0159ff85581d1669cdf0703332ca
Reviewed-on: https://dart-review.googlesource.com/31242
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2017-12-21 23:21:04 +00:00
Sigmund Cherem f404b59d1f Disable multi-inheritance error when using the kernel FE
Workaround for Issue #31118

Change-Id: I1d19eb1adeb7236501c276eeee5446ada36115a3
Reviewed-on: https://dart-review.googlesource.com/31240
Reviewed-by: Emily Fortuna <efortuna@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2017-12-21 21:33:03 +00:00
Brian Wilkerson 48eb23149a Attempt to fix Windows bots (TBR)
Change-Id: Ieccd570d9472a457a7fa0acece121eba6bfa71e7
Reviewed-on: https://dart-review.googlesource.com/31241
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-21 21:02:08 +00:00
Sigmund Cherem 4dfa6a4b9c Add flag to truncate summaries.
Also remove "trimDependencies".

For context: see issue #31704 (https://github.com/dart-lang/sdk/issues/31704)

Change-Id: Iedce40fac9ed974850b41145e531d08aeccee87b
Reviewed-on: https://dart-review.googlesource.com/30963
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-12-21 20:00:21 +00:00
Brian Wilkerson 4f20827afb Class to analyze the contents of a pubspec file
Change-Id: Ia45e1c4ad63cd7a72d623f586760c1928e4ac9b8
Reviewed-on: https://dart-review.googlesource.com/31220
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-21 19:56:31 +00:00
Sigmund Cherem 22298629e8 Add unstable API for bazel summary worker and move the actual worker out of package:front-end
Bug:
Change-Id: I0a64d3de46ef55e8185e723d6111fa315ad286ca
Reviewed-on: https://dart-review.googlesource.com/30621
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2017-12-21 19:09:11 +00:00
Brian Wilkerson c2f029ccf9 Remove another unused parameter and cleanup TODOs
Change-Id: I5f8e62abf2cd476ce026c4fdde45755de0c79cc6
Reviewed-on: https://dart-review.googlesource.com/31180
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-21 18:10:21 +00:00
Aske Simon Christensen 43b1c68803 Error on super as expression
Report error when super is used as an expression outside
an initializer. Consolidated some error messages.

Change-Id: Iafaeeeff8a4b72f941925cefcbc832ba47f02a79
Reviewed-on: https://dart-review.googlesource.com/23360
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-12-21 17:25:51 +00:00
Dan Rubel 63fa6f24a5 Add fasta parser for statement var recovery
Change-Id: I58b54e757e9deede69ecba5a5d4fa200efdb09fa
Reviewed-on: https://dart-review.googlesource.com/30920
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2017-12-21 16:55:01 +00:00
Dan Rubel 3392f32e50 Update code completion of async keywords
This updates the KeywordContributor for use with the fasta parser
and cleans up several code completion tests by introducing
a 'usingFastaParser' flag.

Change-Id: Ife2d945065c23ccd9f2d8e85e5c24a6b956c75ae
Reviewed-on: https://dart-review.googlesource.com/30902
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2017-12-21 15:36:11 +00:00
Brian Wilkerson d5d43e23c5 Add more partial code tests
Change-Id: Ie4d2b9957a355dd2555f9258649bb7091449bf8f
Reviewed-on: https://dart-review.googlesource.com/30962
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-21 15:27:42 +00:00
Brian Wilkerson fe031dea8e Remove support for generic comment syntax from fasta parser
Change-Id: Ic9d61a19d03ff537d58fa378d992e02de903bad8
Reviewed-on: https://dart-review.googlesource.com/30921
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-21 15:18:11 +00:00
Johnni Winther 2a06996361 Fix printer_callback_test
Change-Id: Ib2f71309ae0b5eee1a3c2df757d7f2c3fe77e144
Reviewed-on: https://dart-review.googlesource.com/31121
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-12-21 14:30:49 +00:00
Samir Jindel 7a9ec34310 [kernel] Fix Procedure constructor.
Change-Id: I640fb932f16d45f3ec97d2c498a32ac16b466df7
Reviewed-on: https://dart-review.googlesource.com/31060
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2017-12-21 14:19:17 +00:00
Johnni Winther a521c7f255 First step debugging tests.
Change-Id: I8a947999778f851ed38c1a9fb518af00664f19ec
Reviewed-on: https://dart-review.googlesource.com/30740
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-21 14:03:51 +00:00
Johnni Winther 6d40c7629e Move unittests, part #4 of ?
- add 'deferred' folder for deferred load tests

Change-Id: I60b07b09df80bf6c8d3df6dcec9bce12bdcbafb8
Reviewed-on: https://dart-review.googlesource.com/30862
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-21 10:24:49 +00:00
Sigmund Cherem 22d3af523c Add worker support to DDK
Change-Id: I0ae333f1bd6776840b1377579377695a582c46ef
Reviewed-on: https://dart-review.googlesource.com/30623
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2017-12-20 21:16:46 +00:00
Alan Knight 19ac7a0df3 Add withCredentials: true to the SDK request in DDC web compilation
Bug:
Change-Id: Ica9e3e9f6160562090a62f584a5c9b2d851edf36
Reviewed-on: https://dart-review.googlesource.com/30628
Reviewed-by: Jacob Richman <jacobr@google.com>
Commit-Queue: Alan Knight <alanknight@google.com>
2017-12-20 19:05:42 +00:00
Ben Konyi c8ae685d0c Added flag --suppress_cfe_warnings to suppress warnings generated by the common front end. Fixes issue #31552.
Bug:
Change-Id: Ia025fa2feaec20cbada1596fb022b70e69501ede
Reviewed-on: https://dart-review.googlesource.com/30385
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2017-12-20 19:01:02 +00:00
Alexander Markov 12086506f8 [vm/kernel] Refactor devirtualization to allow other implementations
This is a pure refactoring which extracts the base class for
Devirtualization transformation. It is needed to add a new implementation
of devirtualization later, in addition to the current CHA-based
implementation.

Change-Id: Ifbc6160150a842f5322cf5aea13a7c2180507c96
Reviewed-on: https://dart-review.googlesource.com/30620
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-12-20 18:43:12 +00:00
Alexander Markov 4ace8d42c0 [vm/kernel] Run global transformations only if there are no errors
Change-Id: Ia3b059e75f36488f1ec4ee8ef49037d66f22612c
Reviewed-on: https://dart-review.googlesource.com/30469
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2017-12-20 18:36:52 +00:00
Brian Wilkerson 705904befd Replace parseLiteralStringOrRecoverExpression with ensureLiteralString and remove unused methods
Change-Id: I8ffeff26114132c31a9f677be5654f25455db197
Reviewed-on: https://dart-review.googlesource.com/30882
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-20 18:29:23 +00:00
Alexander Markov 07829bb52a [CFE] Correct error message for large integer literals
Error message is corrected to reflect move of BigInt class
from dart:typed_data to dart:core.

Issue: https://github.com/dart-lang/sdk/issues/31339
Change-Id: Ia959b940dd6443b071642d26d33055c836f16ad7
Reviewed-on: https://dart-review.googlesource.com/30622
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-12-20 18:13:02 +00:00
Alexander Markov b6276eb3d5 [VM] Enable --limit-ints-to-64-bits in Dart 2.0 precompiler, v3.
* Enable --limit-ints-to-64-bits for CFE when it is used to generate
  kernel for VM as CFE relies on int.parse being able to parse correct
  literals and reject incorrect.

* Pass --limit-ints-to-64-bits to gen_kernel via environment
  variable to support batch mode compilation.

Issue: https://github.com/dart-lang/sdk/issues/31339

Re-landing https://dart-review.googlesource.com/29941 with the fix:

* Use checked-in SDK to avoid timeouts on SIMARM bots.
  Checked-in SDK was updated and now includes necessary fixes.

Change-Id: I4a5a99455b60204572f3d619d7eb374035b03e40
Reviewed-on: https://dart-review.googlesource.com/30640
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2017-12-20 18:04:42 +00:00
Brian Wilkerson 294e8a1ac1 Create a recovery method in ClassMethodModifierContext
Change-Id: I3e721995efd71f9905fd9dc001b05148fd48973b
Reviewed-on: https://dart-review.googlesource.com/30883
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-20 17:57:13 +00:00
Leaf Petersen 36057d82fa Add stubs for new Dart 2.0 Iterable methods to Link.
See https://github.com/dart-lang/sdk/issues/31664 for more detail on
the core library changes.

Bug:
Change-Id: Id67b60b12a1a47f121ca40f7ee146516a4ac51ee
Reviewed-on: https://dart-review.googlesource.com/29940
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Leaf Petersen <leafp@google.com>
2017-12-20 17:08:02 +00:00
Brian Wilkerson 55d13097e0 Unify skipFormals and skipFormalParameters
Change-Id: I495b33b283aec848b6089619ad5632632e1df60d
Reviewed-on: https://dart-review.googlesource.com/30881
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-20 16:56:13 +00:00
Brian Wilkerson 0eea09056d Remove an unused parameter from parseClass
Change-Id: I0bef7350e76dcdcf336d0602622e781b485fe722
Reviewed-on: https://dart-review.googlesource.com/30880
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-12-20 16:28:02 +00:00
Peter von der Ahé d1543b3986 Don't include .dill artifacts in delta program
Change-Id: Ibbcb490cdaca57c600bcf4b9783d889644e8af00
Reviewed-on: https://dart-review.googlesource.com/30822
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2017-12-20 15:58:02 +00:00
Johnni Winther a671328de3 Merge instance and static member usage maps.
Change-Id: I2c4802b946af162be2257a10502b2c8f823786d1
Reviewed-on: https://dart-review.googlesource.com/30448
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-20 14:52:59 +00:00
Peter von der Ahé ac068b3cb4 Use options.input if entryPoint is null
Change-Id: Ia7ce42d2caa025b0e1a31872f23bd0364d6cf5f7
Reviewed-on: https://dart-review.googlesource.com/30820
Reviewed-by: Jens Johansen <jensj@google.com>
2017-12-20 12:49:28 +00:00
Peter von der Ahé 2eab494036 Don't add dynamic to a reused dart:core library.
Change-Id: I6e4b5bef9e6cd244b7dd59d1be676e47358ec9b8
Reviewed-on: https://dart-review.googlesource.com/30453
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2017-12-20 11:05:55 +00:00
Peter von der Ahé 3b6e403f1b Support compiling the SDK from source
Change-Id: Ib5df97ef143c2cf98fc3d92a81d0f6b2f4cb1224
Reviewed-on: https://dart-review.googlesource.com/30452
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2017-12-20 09:37:55 +00:00
Johnni Winther f2c2c99714 Adjust inlining heuristics for in-loop calls
Change-Id: Ifaa1e3ac5405cb9159fd2e6c462e076d9f48b120
Reviewed-on: https://dart-review.googlesource.com/30444
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-20 08:20:03 +00:00
Johnni Winther 12ee4edbb8 Implement inlining heuristics on conditional expression.
Change-Id: I183b6345e29d6c00f140dcbd1ffff05faf0e781f
Reviewed-on: https://dart-review.googlesource.com/30442
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-20 08:02:14 +00:00
Stephen Adams 72736aff0d Avoid introducing js.Parameters in constructor body
Use the Parameter name in the template so that it is converted into a
VariableUse.

This change fixes some double-counting in the function parameter /
local variable minifier which made the --fast-startup constructors
'miss' using some minified names.

I believe the 'missed' names is a regression.

Saves 50k (0.4%) on one large app.

Change-Id: Ib7597f5c474ef285b082697e368667dbac23931b
Reviewed-on: https://dart-review.googlesource.com/30720
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2017-12-20 06:09:25 +00:00
Dan Rubel 4e8c6e7862 Add more fasta parser field recovery
Change-Id: I8a63e04c80931d2b2e8b24a547cc845837dee5d8
Reviewed-on: https://dart-review.googlesource.com/30625
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2017-12-20 00:38:38 +00:00
Sigmund Cherem b280922064 Fix patch location for isolate library
Change-Id: Ie1f0913eb61dfd77e73d483fd48f235c58ded523
Reviewed-on: https://dart-review.googlesource.com/30626
Reviewed-by: Emily Fortuna <efortuna@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2017-12-20 00:15:43 +00:00
Leaf Petersen 1ed4096b4e Remove generic comment syntax from pkg/dev_compiler.
Bug:
Change-Id: Ifc823c2b703ec70cd97981f08b29396de516f678
Reviewed-on: https://dart-review.googlesource.com/30382
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Leaf Petersen <leafp@google.com>
2017-12-19 22:03:43 +00:00
Sigmund Cherem a6b28dfee6 Move the use of 'multi-root' out of the FE
Change-Id: If26e4da18d4379041927e100e471a381f5979126
Reviewed-on: https://dart-review.googlesource.com/30600
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2017-12-19 22:00:43 +00:00
Dan Rubel 166cc11a64 Add fasta parser function expression recovery
Change-Id: Id5e27b8f186da23fd141fda12621f1ae3bcd1f8c
Reviewed-on: https://dart-review.googlesource.com/30580
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2017-12-19 20:57:43 +00:00
Sigmund Cherem 414bad86df Directly create dart2js platform files using its patch files
Change-Id: I1c7d59968bfafeeb5a8b5252fa2d47e3c05b893e
Reviewed-on: https://dart-review.googlesource.com/27404
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
2017-12-19 20:31:57 +00:00
Brian Wilkerson cf0b75bc1d Rename parseStatementOpt to parseStatement
Change-Id: I0016bfb44843b6cd6dd36bef724fe25e93630224
Reviewed-on: https://dart-review.googlesource.com/30560
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-19 20:23:54 +00:00
Brian Wilkerson 032cc33fd5 Rename parseAsyncModifier to parseAsyncModifierOpt
Change-Id: I1cc4ad97566bcaeebf16be65ba1e8972a526daef
Reviewed-on: https://dart-review.googlesource.com/30468
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-19 20:22:54 +00:00
Brian Wilkerson f52274630e Disable a flaky test until it can be investigated
Change-Id: Icabacb7c41fe7727757989e3508dc707a8ddb792
Reviewed-on: https://dart-review.googlesource.com/30466
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-19 19:40:43 +00:00
Brian Wilkerson d086c7fb30 Add more partial code recovery tests
Change-Id: I876458a500bd83132e945a4d14d46d5f842acd86
Reviewed-on: https://dart-review.googlesource.com/30464
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-19 19:38:43 +00:00
Brian Wilkerson 4288625d53 Rename parseClassHeader to parseClassHeaderOpt
Change-Id: If488545e2a13ba1f452bdd17321c6065345475e5
Reviewed-on: https://dart-review.googlesource.com/30540
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-19 18:54:46 +00:00
Brian Wilkerson 710b866cce Rename parseStuff to parseStuffOpt
Change-Id: I7f663bf8d7f0b08093bc173638f9f3e036cb277f
Reviewed-on: https://dart-review.googlesource.com/30541
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-19 18:43:34 +00:00
Kevin Moore 11a1cd5ccc Remove version from unpublished packages
Helps with tooling – and helps avoid accidental publishing

Change-Id: I0aaa029ba737adf9a7eda565a9e620d423427fb0
Reviewed-on: https://dart-review.googlesource.com/30465
Reviewed-by: Jake Macdonald <jakemac@google.com>
2017-12-19 18:26:05 +00:00
Brian Wilkerson 3438b33745 Rename parseConditionalUris to parseConditionalUriStar
Change-Id: Iae15de8658f40b355b545b148d0e74358a9d32e1
Reviewed-on: https://dart-review.googlesource.com/30500
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2017-12-19 18:17:23 +00:00
Brian Wilkerson d973fb3bca Rename parseCombinators to parseCombinatorStar
Change-Id: I5caac387a90c9a103182901ac8a1d2a3283e6440
Reviewed-on: https://dart-review.googlesource.com/30501
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-19 17:37:16 +00:00
Sigmund Cherem 3c74884ebb Use the enclosing builder fileUri when creating classes.
This fixes a subttle bug with patching: we were incorrectly storing the origin
uri on a private class that was only defined in a patch file (it was not a
patched class).

Change-Id: I183b8240be2f452f05bc956642363e9d125d2552
Reviewed-on: https://dart-review.googlesource.com/30387
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2017-12-19 17:09:14 +00:00
Dan Rubel 63392bdb36 Add fasta parser import uri recovery
Change-Id: If88a4273866ef80f16f2f3fb561dc929c9b16772
Reviewed-on: https://dart-review.googlesource.com/30462
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2017-12-19 17:00:24 +00:00
Brian Wilkerson 5c43484947 Unify three very similar methods into one
Change-Id: I18fbef8abcc8192f4eb287606ff004ae824dbb5c
Reviewed-on: https://dart-review.googlesource.com/30461
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-19 16:39:44 +00:00
Dan Rubel c2ae2137c9 Improve code completion suggestions in argument lists
This updates keyword code completion to suggest 'async', 'async*',
and 'sync' in new situations. This is necessary given that the fasta
parser recovers in a slightly different way than the analyzer parser.

Change-Id: I44cb42bc02874811df94a6586c7b9c9b5d7574c9
Reviewed-on: https://dart-review.googlesource.com/30460
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2017-12-19 16:06:52 +00:00
Peter von der Ahé 0fb21eec2f Tweak and document compile-time constant for enabling Fasta's incremental compiler
Change-Id: Icb45e579233f567319439623d67d2a683fb13514
Reviewed-on: https://dart-review.googlesource.com/30447
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2017-12-19 15:23:43 +00:00
Brian Wilkerson dfc356eb0a Re-order some parameter lists
Change-Id: I1b9235653d0b8f3e2cd79cf254daecaaea27d083
Reviewed-on: https://dart-review.googlesource.com/30323
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-19 14:06:04 +00:00
Brian Wilkerson 45eb92988c Clean up one use of previous in commitType
Change-Id: I7ba3095e4bc846e20cf621a5f6f7f6a2a3423438
Reviewed-on: https://dart-review.googlesource.com/30322
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-19 14:06:02 +00:00
Peter von der Ahé 8a68b7d91d Reuse Ticker instance
Change-Id: Iced3191870e83b3962937d967e2bea6a80187aa3
Reviewed-on: https://dart-review.googlesource.com/30446
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2017-12-19 13:53:24 +00:00
Peter von der Ahé 51d4803855 Add onProblem to provide more flexible error handling
Change-Id: Iafd73e0a065a357170ec8836360644ecfef944b5
Reviewed-on: https://dart-review.googlesource.com/30443
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2017-12-19 12:06:44 +00:00
Johnni Winther d3f6ce4c42 Use _MemberUsage for tracking static use in resolution
- in preparation for tracking unused optional arguments of static methods

Change-Id: Iba4d8aff488f6c366b587d543b063ae742494b15
Reviewed-on: https://dart-review.googlesource.com/29981
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-19 11:12:02 +00:00
Johnni Winther 66398a511a Store CallStructure in StaticUse
- in preparation for tracking unused optional arguments of static methods

Change-Id: I8a9b1d0d9acd57256d383f880b9c602d91804486
Reviewed-on: https://dart-review.googlesource.com/29801
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-19 10:21:08 +00:00
Peter von der Ahé 8e127b4e53 Average incremental_perf benchmark over 8 loops
Closes https://github.com/dart-lang/sdk/issues/31675

Change-Id: Ida8d1b626cc4e3375f8f9f1d5b4626756ff16edc
Reviewed-on: https://dart-review.googlesource.com/30181
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2017-12-19 08:52:52 +00:00
Vyacheslav Egorov 0dc324a68d Revert "[VM] Enable --limit-ints-to-64-bits in Dart 2.0 precompiler, v2."
This reverts commit 2a3f00a179.

Reason for revert: SIMARM bots are timing out.

Original change's description:
> [VM] Enable --limit-ints-to-64-bits in Dart 2.0 precompiler, v2.
> 
> * Enable --limit-ints-to-64-bits for CFE when it is used to generate
>   kernel for VM as CFE relies on int.parse being able to parse correct
>   literals and reject incorrect.
> 
> * Pass --limit-ints-to-64-bits to gen_kernel via environment
>   variable to support batch mode compilation.
> 
> * Use current Dart SDK instead of checked-in Dart SDK to run CFE
>   in gen_kernel as checked-in Dart SDK is old and it doesn't have
>   int.parse fix yet.
> 
> Issue: https://github.com/dart-lang/sdk/issues/31339
> Change-Id: Iaba2a7945a3faa9427f9aab1e9f2b907fa2246a3
> Reviewed-on: https://dart-review.googlesource.com/29941
> Commit-Queue: Alexander Markov <alexmarkov@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

TBR=vegorov@google.com,kustermann@google.com,alexmarkov@google.com,zra@google.com,asiva@google.com

Change-Id: Iecf26953bc6ae95c3bf0d1142bb89fb51cb0aaee
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Issue: https://github.com/dart-lang/sdk/issues/31339
Reviewed-on: https://dart-review.googlesource.com/30440
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2017-12-19 08:52:25 +00:00
Alexander Markov 2a3f00a179 [VM] Enable --limit-ints-to-64-bits in Dart 2.0 precompiler, v2.
* Enable --limit-ints-to-64-bits for CFE when it is used to generate
  kernel for VM as CFE relies on int.parse being able to parse correct
  literals and reject incorrect.

* Pass --limit-ints-to-64-bits to gen_kernel via environment
  variable to support batch mode compilation.

* Use current Dart SDK instead of checked-in Dart SDK to run CFE
  in gen_kernel as checked-in Dart SDK is old and it doesn't have
  int.parse fix yet.

Issue: https://github.com/dart-lang/sdk/issues/31339
Change-Id: Iaba2a7945a3faa9427f9aab1e9f2b907fa2246a3
Reviewed-on: https://dart-review.googlesource.com/29941
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2017-12-18 21:43:06 +00:00
Sam Rawlins b32a56235e Analyzer: fix 'ignore:' comments at the end of a line.
'//ignore:' comments that sit next to code should not invalidate errors on the
next line.

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

Bug: https://github.com/dart-lang/sdk/issues/28467
Change-Id: I15b1787e5fe4dadcdc72c18409e0b82df11060af
Reviewed-on: https://dart-review.googlesource.com/29548
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-12-18 20:07:56 +00:00
Dan Rubel b04e75d2bf Add fasta parser top level variable recovery
Change-Id: I211519f62c5934fca581a8981db2805362bbecd2
Reviewed-on: https://dart-review.googlesource.com/30324
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2017-12-18 20:06:06 +00:00
Sam Rawlins 3bc3ab979e Fix IMPORT_INTERNAL_LIBRARY error location
Fixes #31682

Bug: https://github.com/dart-lang/sdk/issues/31682
Change-Id: Id4f52006aa7ca3e5fb0ecce61c0393310f18764f
Reviewed-on: https://dart-review.googlesource.com/30260
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-18 18:22:46 +00:00
Dan Rubel 76f30b99f5 Add fasta parser interpolation expression recovery
Change-Id: I45942cf29a86feadcd15fe61432681903658f945
Reviewed-on: https://dart-review.googlesource.com/30360
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2017-12-18 18:04:46 +00:00
Dan Rubel 51162efc45 Add fasta parser missing switch block recovery
This adds fasta parser recovery for missing switch blocks
and removes some redundant error checking code.

Change-Id: I92b875d31f0ada50586f5bd81e5e1c51e0c2ceec
Reviewed-on: https://dart-review.googlesource.com/30321
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2017-12-18 17:32:36 +00:00
Brian Wilkerson d6fdf00f7b Rename a test file, add some tests to the renamed file, and add two missed suites to test_all
Change-Id: I3adf6809b781bd839f0dbff7110eca2f5957590b
Reviewed-on: https://dart-review.googlesource.com/30320
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-18 17:30:26 +00:00
Vyacheslav Egorov 5ed9895488 [vm/kernel] gen_kernel should not report all errors twice
Bug:
Change-Id: Ib389e053571fa4fe235448fb33f15e5f3b659cdc
Reviewed-on: https://dart-review.googlesource.com/29594
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2017-12-18 16:49:31 +00:00
Sam Rawlins b50319ca9f Fix RETURN_OF_INVALID_TYPE for anonymous closures
The displayName of an anonymous closure is a blank String, resulting in messages like:

    [error] The return type 'String' is not a 'int', as defined by the method ''.

After this change, an error might instead look like:

$ xcodebuild/ReleaseX64/dart-sdk/bin/dartanalyzer --strong 26056.dart
Analyzing 26056.dart...
  error • The return type 'String' isn't a 'int', as defined by anonymouse closure at 26056.dart:6:28 • return_of_invalid_type
  1 error found.

Bug: https://github.com/dart-lang/sdk/issues/26056
Change-Id: I4003eea22cb23e0b06479482c06d5ce8a936c756
Reviewed-on: https://dart-review.googlesource.com/28382
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-18 15:33:06 +00:00
Dan Rubel ad9ea873c7 Add fasta parser switch case error checks
This refactors fasta parsing of switch statements so that it can
detect `case` statements after `default` statements
and duplicate `default` statements.

Change-Id: If9d2590a3563d0fe8940e9f3ed45375f2bebfa24
Reviewed-on: https://dart-review.googlesource.com/30240
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2017-12-18 15:21:36 +00:00
Florian Loitsch c0e4c30adb Mark minimal_incremental_kernel_generator_test as slow.
Change-Id: I3f32dc82c146071ff14ba3345f4ba733b46bc56d
Reviewed-on: https://dart-review.googlesource.com/30220
Reviewed-by: Florian Loitsch <floitsch@google.com>
2017-12-18 13:54:55 +00:00
Dan Rubel fd8c3f8436 Add more fasta parser switch statement recovery
This updates the fasta parser to gracefully recover
when a 'case' or 'default' keyword is not followed
by a colon.

In addition, the analyzer error code associated
with the fasta ExpectedButGot error template
has been changed
from UNEXPECTED_TOKEN
to EXPECTED_TOKEN.

Change-Id: Ic1cc01362b2ed796c0a0817504ac6aa9294fa9b3
Reviewed-on: https://dart-review.googlesource.com/30160
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2017-12-18 12:23:38 +00:00
Brian Wilkerson 7ed0bccca8 Add a README file to the meta package
Change-Id: Id8e9587a0a0f3573dcc713c9244c11d0d142a494
Reviewed-on: https://dart-review.googlesource.com/30140
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-17 21:53:17 +00:00
Samir Jindel 075720c352 [kernel] Add flag on Procedures for forwarding semi stubs.
Change-Id: I6e39557e9ed2e636a8f43e8835ae797e3fd8b0c2
Reviewed-on: https://dart-review.googlesource.com/29721
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2017-12-17 04:12:15 +00:00
Konstantin Shcheglov 31a0fe292d Remember import prefix name for static references.
Bug:
Change-Id: Ib71a9cc8e6c65d597f24c20c0260f7f37ef3674f
Reviewed-on: https://dart-review.googlesource.com/28541
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2017-12-16 05:09:35 +00:00
Brian Wilkerson 439dfe0c29 Revert "Produce an error if there would be an exception thrown by an assert in an initializer list"
Change-Id: I21553a5a3bf12b7636d9ef507092d0e19f9c0d57
Reviewed-on: https://dart-review.googlesource.com/30041
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-16 01:44:13 +00:00
Dan Rubel 028773e032 Add fasta parser missing switch case recovery
Change-Id: I102586df07cf9178e47b5bb05e8b27af57f393c5
Reviewed-on: https://dart-review.googlesource.com/29920
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2017-12-16 01:34:53 +00:00
Sam Rawlins 0d876c60ad Add a changelog entry for meta 1.0.5
Bug: https://github.com/dart-lang/sdk/issues/29220
Change-Id: I980fd5820d94803862aadd7c53a97daf864736d2
Reviewed-on: https://dart-review.googlesource.com/29180
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2017-12-15 23:40:03 +00:00
Brian Wilkerson 71dd8acda1 Produce an error if there would be an exception thrown by an assert in an initializer list
Change-Id: Ia95b2e09c64846d319d940e29c422355ab972da6
Reviewed-on: https://dart-review.googlesource.com/29700
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-12-15 23:03:15 +00:00
Paul Berry f52cc1b382 Get rid of the clumsy while loop in inferInvocation.
See discussion in
https://dart-review.googlesource.com/c/sdk/+/29744/3/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart#892
Change-Id: I7b63269573749a61ff9e211d9df8676eae66b7e7
Reviewed-on: https://dart-review.googlesource.com/30000
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-12-15 22:45:53 +00:00
Paul Berry ae9b0c42d7 Add type inference code to generate Instantiation nodes.
Fixes #31586.

Note that none of the back-ends handle Instantiation nodes yet, so the
language_2 tests added in this CL
(instantiate_tearoff_after_contravariance_check_test,
instantiate_tearoff_of_call_test, and instantiate_tearoff_test) fail
pretty much across the board right now.

Includes two fixes to Instantiation.getStaticType and the kernel type checker:

- Previously, they attempted to perform substitution on the full
  function type, which had no effect because the type parameters were
  bound.

- The type checker was not checking that type parameter bounds were
  satisfied.

Note that the front end doesn't yet check that type parameter bounds
are satisfied by the inferred type parameters.  I will address that in
a follow-up CL.

Change-Id: Ib0ad7a5fc5f4a2fdc8c99abe1f2d3d15b21a4974
Reviewed-on: https://dart-review.googlesource.com/29744
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-12-15 20:41:43 +00:00
Emily Fortuna 4cd0593574 Tiny fix to fix type errors in our compiler while running host-checked
and deferred loaded code.

Bug:
Change-Id: I57b51a287fd7ffad59a1a59eae34e739b5e5603b
Reviewed-on: https://dart-review.googlesource.com/29745
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Emily Fortuna <efortuna@google.com>
2017-12-15 18:42:33 +00:00
Leaf Petersen 53908b0790 Remove warning for "is" checks with generic type parameters.
The analyzer used to emit a warning when a type parameter to a generic
method was used in an "is" check.  This warning was there to help
users write code that worked correctly on both Dart 1.0 and 2.0.  Now
that 2.0 generic methods are being more broadly supported and used,
this warning is blocking further library work, and is being removed.

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

Bug:
Change-Id: I70395305ad082aee3072b5beeb0b1b7f7883391b
Reviewed-on: https://dart-review.googlesource.com/29821
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-15 18:12:03 +00:00
Dan Rubel 8239aa093e Fix synthetic token offset and length
During fasta parser recovery, the offset and/or length of some
synthetic tokens was incorrect. This caused problems during
code completion.

Change-Id: Iace73d06bb5da3ae916c69b7823367d8fc6e16b8
Reviewed-on: https://dart-review.googlesource.com/29822
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2017-12-15 16:06:43 +00:00
Dan Rubel c780e6a935 Add fasta parser map literal recovery
Change-Id: Icde67bdef748a2bce4811d61bda19e9e4a008d52
Reviewed-on: https://dart-review.googlesource.com/29820
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2017-12-15 16:05:54 +00:00
Dan Rubel b16baaf8cf Add fasta parser property access recovery
Change-Id: Iece1dc1ea8eeb0928ffbcdefdbbdb54cb4277e31
Reviewed-on: https://dart-review.googlesource.com/29740
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2017-12-15 12:47:22 +00:00
Terry Lucas 0f07255380 Another passing test.
TBR=vsm@google.com

Change-Id: Ic01d3e213d30d7b5da61c2ccd9d0faf2de804dff
Reviewed-on: https://dart-review.googlesource.com/29746
Commit-Queue: Terry Lucas <terry@google.com>
Reviewed-by: Terry Lucas <terry@google.com>
2017-12-15 05:01:54 +00:00
Sam Rawlins ee07335392 Improve message around re-assigning a local final.
Add a new ASSIGNMENT_TO_LOCAL_FINAL code for the new text.

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

Bug: https://github.com/dart-lang/sdk/issues/28721
Change-Id: I5492dd0d9ee09d5b73296b46fe10271661c3c64f
Reviewed-on: https://dart-review.googlesource.com/29621
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-12-15 01:09:55 +00:00
Terry Lucas 3ebdf40490 Another passing test.
TBR=vsm@google.com

Change-Id: Ie5d759f11ebec219a7834dd5f4913b5ae1cf8333
Reviewed-on: https://dart-review.googlesource.com/29660
Reviewed-by: Terry Lucas <terry@google.com>
Commit-Queue: Terry Lucas <terry@google.com>
2017-12-15 01:09:40 +00:00
Mike Fairhurst a9fe991cc5 First pass at plumbing fasta errors through to the analyzer. Hopefully this is
all satisfactory infrastructurally, organizationally, performance wise.

This does not handle summarizing errors so that we can produce them for existing
dill files, and some other places where special analysis is performed like on
the standard libs.

The CompilationMessage object is less rich than the Message object that other
code is using, see \#31644. However, workarounds included.

Bug:
Change-Id: I5b436b0de6051877801c1d128f43a9656df1b549
Reviewed-on: https://dart-review.googlesource.com/29400
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-15 00:49:55 +00:00
Vijay Menon 28ae7ff5b0 DDC cleanups
- Fix kernel invocation via ddc/ddw tools
- Remove sdk_expected_errors file - it's often out of date

Change-Id: I07bc073e7ebaffd39ff31b9438fd632e14aeac73
Reviewed-on: https://dart-review.googlesource.com/29640
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2017-12-14 22:56:35 +00:00
Devon Carew 3bca5b6a1d Duplicate some analyzer cli tests to also run in --preview-dart-2.
Bug:
Change-Id: Ic2b96434e58a7d3eff3ff9aef1bcb540d8f4f0ce
Reviewed-on: https://dart-review.googlesource.com/29623
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2017-12-14 22:18:35 +00:00
Alexander Markov ab8629af65 Revert "[VM] Enable --limit-ints-to-64-bits in Dart 2.0 precompiler"
This reverts commit 752dd8921a.

Reason: buildbot failures. Batch compiler which is used on certain
buildbots doesn't have --limit-ints-to-64-bits enabled yet.

Issue: https://github.com/dart-lang/sdk/issues/31339
Change-Id: I75a3940f981f47cb83425b99842c15c7d81b3c2d
Reviewed-on: https://dart-review.googlesource.com/29701
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2017-12-14 22:04:16 +00:00
Konstantin Shcheglov 92bf47e7e4 When vm_platform_strong.dill is loaded, and an SDK library is requested, we don't need cycles.
R=brianwilkerson@google.com

Bug:
Change-Id: I0bd39b5bd8fa414a59b27b21e1a63196ec8a4300
Reviewed-on: https://dart-review.googlesource.com/29620
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-14 21:10:49 +00:00
Alexander Markov 752dd8921a [VM] Enable --limit-ints-to-64-bits in Dart 2.0 precompiler
* Also enable --limit-ints-to-64-bits for CFE when it is used to generate
  kernel for VM as CFE relies on int.parse being able to parse correct
  literals and reject incorrect.

Issue: https://github.com/dart-lang/sdk/issues/31339

Change-Id: I4d12057457869e86945a4d3cf83326be7c93c17f
Reviewed-on: https://dart-review.googlesource.com/29546
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-12-14 21:03:42 +00:00
Brian Wilkerson a39bf4764b Add some recovery tests inspired by an issue
Change-Id: Ic5fe3fde8dc6223fb78647f90052cd1a2e758dca
Reviewed-on: https://dart-review.googlesource.com/29600
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-14 19:19:06 +00:00
Dan Rubel b709bc4bbe Fix AstBuilder interpolation expression construction
Add a new handleInterpolationExpression fasta parser event
so that AstBuilder can correctly construct interpolation expressions
with left and right brackets.

Change-Id: Icca977067fe3a28dbab83488108c7286ec135dca
Reviewed-on: https://dart-review.googlesource.com/29541
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2017-12-14 19:18:16 +00:00
Terry Lucas 642b768e87 Fixed default parameter messagePorts for MessageEvent factory.
R=vsm@google.com

Change-Id: Ic94ccbe4c29302e44c58791658ce75dff86d9ac2
Reviewed-on: https://dart-review.googlesource.com/29544
Commit-Queue: Terry Lucas <terry@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2017-12-14 18:21:25 +00:00
Devon Carew 38df6ea1f4 Only show closing labels that have nesting.
Bug:
Change-Id: Ifc9177973961f2a74be3e2871aa2d58c28007478
Reviewed-on: https://dart-review.googlesource.com/29540
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-14 15:54:50 +00:00
Brian Wilkerson df479ca916 Accept a trailing comma in asserts in initializer lists (issue 31320)
Change-Id: I6166aac91abc65c0817d14e1d98f5944236016bf
Reviewed-on: https://dart-review.googlesource.com/29520
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-12-14 15:49:45 +00:00
Florian Loitsch 1a61b425d1 Reland BigInt class.
Moved `parseRadix` into a separate test where it doesn't do 10 iterations.
This reverts commit ab4061471b.

Change-Id: Ie48216c2f4f077dc86f915a54021c39706c432e8
Reviewed-on: https://dart-review.googlesource.com/29593
Reviewed-by: Florian Loitsch <floitsch@google.com>
Commit-Queue: Florian Loitsch <floitsch@google.com>
2017-12-14 15:44:15 +00:00
Paul Berry 09e432a914 Remove StrongModeCode.UNSAFE_BLOCK_CLOSURE_INFERENCE, which is no longer used.
Change-Id: I289a194670dbdec7cda3522bea614beae09a18c3
Reviewed-on: https://dart-review.googlesource.com/29543
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-12-14 15:08:46 +00:00
Sam Rawlins eb834e1886 Analyzer: allow identifier references in comments
When referencing an identifier in a documentation comment that precedes the
identifier, but exists in the same scope, do not raise an error.

Bug: https://github.com/dart-lang/sdk/issues/24880
Change-Id: I1cf9b54e0af280ea9f9a64f5e2a751e9573a1e5b
Reviewed-on: https://dart-review.googlesource.com/29561
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2017-12-14 15:05:55 +00:00
Aske Simon Christensen d5fd7a3007 Eliminate error flag from library builder.
Change-Id: I4fe70ba733c80dcfa95b86447d1094b7338d83f2
Reviewed-on: https://dart-review.googlesource.com/29588
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2017-12-14 14:53:46 +00:00
Kevin Millikin bc2560069a Add a representation for an instantiated generic function
Kernel allows instantiating a tearoff to type arguments.  This
construct is not yet produced by the front end or supported in any
back end.

Closes issue #31550

Bug: https://github.com/dart-lang/sdk/issues/31550
Change-Id: I5e50d26cdc77a84ba92fa0ea5eea49b42ca83551
Reviewed-on: https://dart-review.googlesource.com/29587
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2017-12-14 14:51:45 +00:00
Jens Johansen 4b8415dd5a [DDC] Sourcemap tests no longer spawn external dart process
Previously a separate dart process would be spawned to compile a dart
file to JS.
This CL internalize it instead, giving a massive speedup.

Bug:
Change-Id: Ib0c073b1f99ecc0c0531aa83a8299278d90762c8
Reviewed-on: https://dart-review.googlesource.com/29200
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2017-12-14 14:20:18 +00:00
Peter von der Ahé f42359cdd1 Remove collectAllClasses
Change-Id: I12390cc3a3f6dde2b2abe5ed5da4e6c5ce114ba7
Reviewed-on: https://dart-review.googlesource.com/28725
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2017-12-14 10:18:25 +00:00
Johnni Winther b13a6015cc Support subtyping for function type variables.
Change-Id: I0e00330d76cc9b1f3d48bb1f0d87f6334976de54
Reviewed-on: https://dart-review.googlesource.com/29281
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-14 10:09:55 +00:00
Johnni Winther 5f06d51d1a Enable inlining by default
Change-Id: I4810959da23193d8a1b572b4feea329a2f4b2f31
Reviewed-on: https://dart-review.googlesource.com/29320
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-14 10:02:54 +00:00
Johnni Winther b759f8fb15 Use sorted named parameters on inlining.
Change-Id: I066383b86b55e1d76633c281f30ebbc3fa5d46e3
Reviewed-on: https://dart-review.googlesource.com/29280
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-14 09:21:44 +00:00
Jens Johansen 627fb6ac6c [DDC-kernel] Fix sourcemaps after fileUri was added to Constructors
When fileUri was added to Constructors a few tests had to be marked as
failing. This CL fixes the issue.

Bug:
Change-Id: I1168fab05a8edfcd17416476b3abbaf9322d88b9
Reviewed-on: https://dart-review.googlesource.com/29580
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2017-12-14 09:07:17 +00:00
Johnni Winther 5c0f33934b Register inlined constructor types
Change-Id: I097394c868a0fabe0e83814a65ec7884b64741af
Reviewed-on: https://dart-review.googlesource.com/29121
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-14 09:07:03 +00:00
Johnni Winther 0edef589d4 Ensure type variables for inlined constructors and mixin fields
Change-Id: I348acffb7842ff1c9f28ebf73c507e282c6a045e
Reviewed-on: https://dart-review.googlesource.com/29080
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-14 08:53:21 +00:00
Peter von der Ahé 7a40a6c3da Report an error on all classes involved in a cycle
Change-Id: I80221caf1f17acfe50b3c77da8e86e1bff54c67f
Reviewed-on: https://dart-review.googlesource.com/28724
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2017-12-14 08:47:25 +00:00
Dan Rubel 3f273903bb Add fasta parser incomplete field recovery
Change-Id: Ifb948c752d8cda3afcd39f80d4681a25fac9e3a8
Reviewed-on: https://dart-review.googlesource.com/29445
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2017-12-14 01:25:45 +00:00
Sam Rawlins 14629098dd Enforce @visibleForTesting annotations.
In particular, enforce that a method annotated with @visibleForTesting can only
be referenced from within the declaring library, or within a file that has
"/test" in its path. This allows @visibleForTesting methods to be accessed from
test files, or files in "/testing" folders, etc.

Bug: https://github.com/dart-lang/sdk/issues/28273
Change-Id: I3c19f73be330c49face7e3203879742d514bca74
Reviewed-on: https://dart-review.googlesource.com/27201
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-14 00:17:24 +00:00
pq 3be583a006 Account for missing option includes (#31648)
Fixes: #31648.
Bug:
Change-Id: I1fae4c0aeff4935ca212b3d9ef52645492f7465c
Reviewed-on: https://dart-review.googlesource.com/29500
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-13 23:36:14 +00:00
Sigmund Cherem 08bd966708 Count return/throw and their children in inlining heuristic.
I discovered this because a deferred method was being inlined accidentally: we
thought it was empty and inlined it when we shouldn't have.

Change-Id: I9795b62f4ffb81222100afedd3b42cb8828900bd
Reviewed-on: https://dart-review.googlesource.com/27925
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-12-13 23:26:54 +00:00
Brian Wilkerson 77d3b70220 Add previewDart2 to remaining kernel tests
Change-Id: I097df911af5d90f38eb177a6744c798a29a5804e
Reviewed-on: https://dart-review.googlesource.com/29460
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-12-13 22:46:14 +00:00
Devon Carew 6346b18028 Restore a strong mode analyzer cli test.
Bug:
Change-Id: If9b459d99a3120071ba8f3a7bd9aa1d2e776bbd6
Reviewed-on: https://dart-review.googlesource.com/29443
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2017-12-13 22:26:56 +00:00
Konstantin Shcheglov 4804108735 Support for more than one variable defined in a statement.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: I9c5163099e46639a58487d217c1895b21bbc754d
Reviewed-on: https://dart-review.googlesource.com/29440
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-13 22:14:24 +00:00
Konstantin Shcheglov 577ceed6cd Apply resolution to multiple top-level and class fields.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: Ib6c60b433215c4cd2af8d8a160b0cd9419c64095
Reviewed-on: https://dart-review.googlesource.com/29441
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-12-13 21:47:34 +00:00
Bob Nystrom 4d5bcd5958 Make minitest.dart a little more resilient against misues.
We don't want to silently pass tests that think they are async when
the test framework doesn't know it's async.

Change-Id: I6556f8223d8d930ba252496adf233a5cb1108929
Reviewed-on: https://dart-review.googlesource.com/27923
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-13 21:32:54 +00:00
Sigmund Cherem e0e94eca46 Workaround issue #31579.
Temporarily use the patch URI for procedures and constructors and adjust
file-offset on class metadata to workaround issue #31579.

This change should be reverted when we have proper tracking of both origin and
patch URIs for each patched element.

Change-Id: I451a39b57cb121c2de3b1a324adc8cdbb5e8962c
Reviewed-on: https://dart-review.googlesource.com/29004
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-12-13 21:30:24 +00:00
Konstantin Shcheglov 3f90f36380 Apply resolution to not procedures/methods invocations.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: I419245d819c68a28ecb328e78073cbe5373f7455
Reviewed-on: https://dart-review.googlesource.com/29360
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-13 21:13:14 +00:00
pq ab4061471b Revert "Add BigInt class." [TBR].
This reverts commit f189bb57a4.

Bug:
Change-Id: I7b1cc4ab69adb5142ff7b5abd563d3bf7371ebb9
Reviewed-on: https://dart-review.googlesource.com/29442
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2017-12-13 21:12:02 +00:00
Brian Wilkerson 9267fe0dbb Add flag to CompileTimeErrorCodeTest_Kernel
Change-Id: I926d4072d93c1c32107d7bcf8fba5add906c7fd0
Reviewed-on: https://dart-review.googlesource.com/29380
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-13 20:44:24 +00:00
Samir Jindel 56ecbbde4b [kernel] Support 64-bit integer literals correctly in Fasta.
Bug:
Change-Id: Idfb037e79d247889fe6a7d9a9b475ca4f8637080
Reviewed-on: https://dart-review.googlesource.com/27800
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-12-13 20:35:19 +00:00
Sigmund Cherem f34af36ef9 [pkg:kernel] Add fileUri to Constructors
We have a fileUri for fields and procedures and it was missing in constructors.

This is needed to be able to correctly store the patch URI in patched
constructors and to be able to workaround
https://github.com/dart-lang/sdk/issues/31579.
Change-Id: Ic80d3dc87450ada8b39b555e9b16e162d0e40b45
Reviewed-on: https://dart-review.googlesource.com/29003
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2017-12-13 19:35:34 +00:00
Konstantin Shcheglov 1b7ae4e98b Fix for the test that does not fail anymore.
TBR

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

Bug:
Change-Id: I0a17afcd8379fcebf0547735bd4b5f7bfcc05bf1
Reviewed-on: https://dart-review.googlesource.com/29341
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-12-13 19:17:36 +00:00
Dan Rubel 3ab29148f4 Add fasta parser cascade recovery
Change-Id: I1cf32604acf2124a9d61621fbb4cfb9343d98d33
Reviewed-on: https://dart-review.googlesource.com/28840
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2017-12-13 18:30:25 +00:00
Florian Loitsch f189bb57a4 Add BigInt class.
Change-Id: I6e7fed3913cdb8e69ea15f0c69e060cccd91a356
Reviewed-on: https://dart-review.googlesource.com/9820
Commit-Queue: Florian Loitsch <floitsch@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2017-12-13 18:23:51 +00:00
Konstantin Shcheglov 88575a3f4c Fix resynthesis for 'dynamic op value' constant expressions.
1. Move error checking before.

2. Remove check for operator using resolution, because there is no
   resolution for dynamic target. _toBinaryOperatorTokenType() will
   throw if the operatorName is not actually the name of an operator.

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

Bug:
Change-Id: Iaa7d909ec8a6c13f306fd73122a10a0de170e7e1
Reviewed-on: https://dart-review.googlesource.com/29181
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-12-13 18:18:35 +00:00
Brian Wilkerson 24a510a91e Enable previewDart2 for more tests
Change-Id: I1f2003040246b5b12f2866d513ff3502246ac39f
Reviewed-on: https://dart-review.googlesource.com/29220
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-13 18:15:45 +00:00
Peter von der Ahé e816c3fbc1 Remove unused argumentsWithMissingDefaultValues
Change-Id: I0961e74144fd9d86942e88cf525fe71e9a9c2b41
Reviewed-on: https://dart-review.googlesource.com/28740
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2017-12-13 16:48:24 +00:00
Konstantin Shcheglov 74dcc87393 Triage several tests in NonErrorResolverTest_Kernel.
I opened several issues for missing errors and providing actual source
span, not just single offset. We need them anyway, and it is better to
let the FrontEnd know about them sooner, so that they have time to
plan implementing them.

https://github.com/dart-lang/sdk/issues/31626

R=brianwilkerson@google.com

Bug:
Change-Id: I9238a06c8489679fa2a19f853ead2a2b93c39e39
Reviewed-on: https://dart-review.googlesource.com/29042
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-12-13 15:38:48 +00:00
Konstantin Shcheglov fe7e7df11c Give function expression elements unique names to ensure unique identity.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: I1bf76b14a63e35403629bb5864f7f1122cf28d5e
Reviewed-on: https://dart-review.googlesource.com/29002
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-12-13 15:37:47 +00:00
Dan Rubel ebddad2329 Fix fasta parser recovery of redirection in non factory
Change-Id: Ia9943fb3c600a042b71bd2901cf962c06f61b523
Reviewed-on: https://dart-review.googlesource.com/28940
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2017-12-13 15:24:55 +00:00
danrubel 1d174010cc fasta parser parseMethod cleanup
Change-Id: I67527349274f7422ca5ce33263c66fb8e88e23f9
Reviewed-on: https://dart-review.googlesource.com/28980
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2017-12-13 15:07:05 +00:00
Brian Wilkerson 941b3b25c3 Clean up some failing tests
Change-Id: I79d951bab655ac322750222f921e055ad6ed6ef9
Reviewed-on: https://dart-review.googlesource.com/29040
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-13 14:16:36 +00:00
Erik Ernst f95a3cc1e6 dart2js no longer warns that function type variables are not reified
Change-Id: I69746c92912fcbbc35e1f6c37e310352f92708f6
Reviewed-on: https://dart-review.googlesource.com/28641
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2017-12-13 14:01:16 +00:00
Vijay Menon e9d03b4120 Forward native static methods
We don't generate these.  Rather than do that, this CL forwards to the
actual JS method instead.

This is the diff on the generated dart_sdk.js:

59732c59732

<     return html$.LengthValue._fromDictionary_1(dictionary_1);

---

>     return dart.global.LengthValue.fromDictionary(dictionary_1);

59894c59894

<     html$.MediaStreamTrack._getSources(dart.fn(value => {

---

>     dart.global.MediaStreamTrack.getSources(dart.fn(value => {

80232c80232

<     html$.Notification._requestPermission(dart.fn(value => {

---

>     dart.global.Notification.requestPermission(dart.fn(value => {

Change-Id: I9e857a808557e4702fb2b99aa518c25b49ff3db7
Reviewed-on: https://dart-review.googlesource.com/29020
Reviewed-by: Terry Lucas <terry@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
2017-12-13 13:38:36 +00:00
Jens Johansen 970e1aabf7 [DDC-kernel] Deal with null fileUris
When building source maps it is currently assumed that the fileUri is
non-null (or at least that the location extracted from the Uri and
offset is non-null.
That might not always be the case (e.g. see CL 29003).

Bug:
Change-Id: I29c928a0d5fcd2bd5e1d1ef6c6d6ac97d2e7408c
Reviewed-on: https://dart-review.googlesource.com/29120
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2017-12-13 12:37:14 +00:00
Johnni Winther 5599c80edd Don't create HParameterValue nodes for type arguments when inlining
Change-Id: If44fc4cbb39336f7ac01b906702f5aaa2ed1cd90
Reviewed-on: https://dart-review.googlesource.com/28721
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-13 10:10:23 +00:00
Johnni Winther a1f5474f80 Allow inlining of platform library functions
Change-Id: I2803d66f54d2e1052ca8af5fb719bded8f400171
Reviewed-on: https://dart-review.googlesource.com/28563
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-13 09:35:59 +00:00
Johnni Winther 9df549a2d0 Avoid inlining of external functions
Change-Id: I43aed9e484c55d40a9fa7d5db029e0d11a698b3e
Reviewed-on: https://dart-review.googlesource.com/28562
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-13 09:28:09 +00:00
Devon Carew 7458045577 Re-enable the benchmark test.
Bug:
Change-Id: I433bb1a0944a8b1bf12400c62d97246031a73082
Reviewed-on: https://dart-review.googlesource.com/28843
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2017-12-13 03:54:19 +00:00
Terry Lucas 529add3834 DDC fix to expose classes which are only created inside of the browser.
R=vsm@google.com

Change-Id: I27ede73ac84a72ee9b5e8b3b0a706ade82b2aa59
Reviewed-on: https://dart-review.googlesource.com/25500
Commit-Queue: Terry Lucas <terry@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2017-12-13 03:03:09 +00:00
Konstantin Shcheglov ccc20bedf5 Apply resolution to function typed formal parameters.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: I512bd3aca390d7b8b25dec595d0d7b580ea31fde
Reviewed-on: https://dart-review.googlesource.com/28960
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-12-13 02:36:29 +00:00
Konstantin Shcheglov 256af31572 Specify the folder with vm_platform_strong.dill when create AnalysisDriver from Analysis Server.
This should let us go a bit further in running the benchmark.
We still fail later though.

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

Bug: https://github.com/dart-lang/sdk/issues/31554
Change-Id: I052d8a1805c17ab464027b35235a3abb59792142
Reviewed-on: https://dart-review.googlesource.com/29000
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-12-13 00:35:10 +00:00
Harry Terkelsen 1e0a657961 dart2js kernel: Add types seen in the superclass chain to the hierarchy
Change-Id: I5c0f6b76042e7a3cf8f54326963d56eb6a78f568
Reviewed-on: https://dart-review.googlesource.com/27020
Commit-Queue: Harry Terkelsen <het@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-12-13 00:19:03 +00:00
Brian Wilkerson fa265c892e Triage some failing tests
Change-Id: Ia6ef2b687b4eb5abc5d88a58b8416a6b4c9e2bb8
Reviewed-on: https://dart-review.googlesource.com/28860
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-12-12 23:17:01 +00:00
Devon Carew 0a289c8341 Add analysis server analysis domain preview dart 2 tests.
Bug:
Change-Id: Id1ea8cbd214ec5f117c83f7df31b53456254ff78
Reviewed-on: https://dart-review.googlesource.com/28802
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-12 21:43:29 +00:00
Konstantin Shcheglov f6338287ab Apply resolution to constructor redirection.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: Idb9c6c7f43bda03864b9a2ba291b5dba6e45f637
Reviewed-on: https://dart-review.googlesource.com/28841
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-12-12 20:28:49 +00:00
Bob Nystrom 650c9dcc8e Support extractTypeArguments() in 1.0 mode on the VM and dart2js.
Without strong mode, a "good enough" implementation is to simply call
the generic method with "dynamic" for the type arguments, which is what
this does. That should be enough to unblock our internal users.

We also need to not report a compile error when
dart_internal/extract_type_arguments.dart imports the hidden
"dart:_internal" library.

This patch does both of those for the VM and dart2js (using its old
front end).

Note that the test still fails because the test is more particular than
most actual user code would be -- it validates that the instantiated
type arguments are *exactly* correct, and not that the returned object
is merely subtype compatible.

Bug:
Change-Id: I0343beace4991861b29712b3fd7067ec8dc8f8ba
Reviewed-on: https://dart-review.googlesource.com/28020
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-12 19:04:18 +00:00
Brian Wilkerson 081074ebf4 Completion suggestion relevance influenced by parameter types (issue 31592)
Change-Id: I8f03dea74fac8080bc628128a0f32b09784d0248
Reviewed-on: https://dart-review.googlesource.com/28780
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-12 18:40:59 +00:00
Konstantin Shcheglov 353e0bdefc Apply resolution to formals in AstBuilder tests.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: I28a045d1e8640a2a447fae6e9f35bfb6db76790a
Reviewed-on: https://dart-review.googlesource.com/28542
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-12-12 17:42:51 +00:00
Peter von der Ahé 40d80969d7 Track location for invalid types
Change-Id: I6c500f977498b5e54e581273bf3a3b171fc2e61b
Reviewed-on: https://dart-review.googlesource.com/28720
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2017-12-12 15:34:31 +00:00
Martin Kustermann a11d7a1643 Add support for running simdbc64 in batch mode
This makes isolate tests fail, since we no longer run from "source" (or
rather use the kernel-isolate to to "source -> dill" for us).

The special vm/cc suite will continue to be run via the kerne-isolate, so we
have the coverage for these (which probably include reload tests).

Issue https://github.com/dart-lang/sdk/issues/31585

Change-Id: I51bd2f9345d650b4ff2a98aa1c8365c765e0d013
Reviewed-on: https://dart-review.googlesource.com/28722
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-12-12 15:26:41 +00:00
Peter von der Ahé 0cad7e3168 Support reusing source library builders
Change-Id: Idc884e9c733bad0cb3e15be3cbaf248e8371196a
Reviewed-on: https://dart-review.googlesource.com/28663
Reviewed-by: Jens Johansen <jensj@google.com>
2017-12-12 15:02:11 +00:00
Brian Wilkerson 96c3b2a24d Convert Parser.rewriteAndRecover to return the token before the insertion
Change-Id: Ib7db1a7e48b48f2137edacd921b35d5c86313419
Reviewed-on: https://dart-review.googlesource.com/28521
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-12 14:16:45 +00:00
Brian Wilkerson b1fce8078e Enable strong mode when previewDart2 is enabled
Change-Id: I2d26dec1e3e4dc7a32ef51ff740211032919adb1
Reviewed-on: https://dart-review.googlesource.com/28524
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-12 14:08:40 +00:00
Dan Rubel c284c428bb Add fasta parser type parameter recovery
Change-Id: I6363aa558b2ac6dec3fb3c7ba1abd82dd8e98874
Reviewed-on: https://dart-review.googlesource.com/28060
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-12 14:06:40 +00:00
Martin Kustermann d1ed915244 Use batch mode compilation for normal -cdartkp
Issue https://github.com/dart-lang/sdk/issues/31585

Change-Id: I70790a33cfbfbc7c2c48c6e77074f955d6de7e01
Reviewed-on: https://dart-review.googlesource.com/28280
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-12-12 13:47:11 +00:00
Peter von der Ahé ce655bc2ff Print the URI, not t.dart
Change-Id: I03b28f60622f34f19d2e5ce6428e6d696f505331
Reviewed-on: https://dart-review.googlesource.com/28600
Reviewed-by: Jens Johansen <jensj@google.com>
2017-12-12 12:22:37 +00:00
Peter von der Ahé 728a1770c4 Ensure edits of main are correctly detected
Change-Id: Ic7cf4f09c001d6a1d3b3a84fc3ead794f7530b09
Reviewed-on: https://dart-review.googlesource.com/28306
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-12 12:22:37 +00:00
Peter von der Ahé 690b8865f5 Compute dependencies instead of strong components
Change-Id: I1d20ffc26951669391eaa2a67c02932a264d5eb1
Reviewed-on: https://dart-review.googlesource.com/28305
Reviewed-by: Jens Johansen <jensj@google.com>
2017-12-12 12:22:37 +00:00
Peter von der Ahé 32673d01c5 Add missing type variables to interface
Change-Id: I6c3d07d7b1adf145da54d24081e5238ce3a07624
Reviewed-on: https://dart-review.googlesource.com/28303
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-12-12 12:22:37 +00:00
Peter von der Ahé c9026e446e Pass offset to buildSupertype
Change-Id: I4a1cf524e7edbb9bc8d435fbea8a6b4eb440a077
Reviewed-on: https://dart-review.googlesource.com/28302
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2017-12-12 12:22:37 +00:00
Peter von der Ahé 08aa7e9114 Add context for override warnings
Change-Id: Icc53b580fddae02fa07341a004dc602db612dc0a
Reviewed-on: https://dart-review.googlesource.com/28301
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2017-12-12 12:22:37 +00:00
Peter von der Ahé a12ebf65e3 Add context to ClassBuilder diagnostics API
Change-Id: I823a800293b059857895bf38698fca487323e4f2
Reviewed-on: https://dart-review.googlesource.com/28300
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2017-12-12 12:22:37 +00:00
Peter von der Ahé cac6551376 Always clear StringToken canonicalizer after running Fasta
Change-Id: If994a644c2089e3e9cb57232baceb6b622106d19
Reviewed-on: https://dart-review.googlesource.com/28282
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2017-12-12 12:22:37 +00:00
Peter von der Ahé a70aba8efc Add ikg-variant constant to pick Fasta
Change-Id: I0826e32f4820a9c4ccb86c47b7cd8114320ae649
Reviewed-on: https://dart-review.googlesource.com/28281
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2017-12-12 12:22:37 +00:00
Peter von der Ahé affb2c9321 Use existing tests of DependencyWalker
Change-Id: If870792d24757d020c5724ab79e8972be4bd679b
Reviewed-on: https://dart-review.googlesource.com/27722
Reviewed-by: Jens Johansen <jensj@google.com>
2017-12-12 12:22:37 +00:00
Vyacheslav Egorov efca9c69ab [vm/testing] Make --strong -c dartk configuration a Dart 2.0 configuration.
Switch it to use pkg/vm/tool/dart2 which is the source of truth for what
Dart 2 VM configuration means. Don't pass any additional flags from
tools/test.py itself.

Align pkg/vm/tool/dart2 with what tools/test.py was passing to VM on _2 suites.

Make default invocation `tools/test.py -c dartk --strong -m release,debug`
green by updating status files and skipping suites that are not Dart 2.0
compliant. I have filed issues #31588 for isolate suite and #31587 for
service suite.

Reland of https://dart-review.googlesource.com/27820

Change-Id: I49400fae716f75425e70bf1e561b3375ba39157e
Reviewed-on: https://dart-review.googlesource.com/28565
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2017-12-12 12:19:10 +00:00
Peter von der Ahé 31b512faa2 Implement reusing libraries not affected by invalidated URIs
Change-Id: I2fbb6daaa8fe6ca5b136c639194ec49ae31c385f
Reviewed-on: https://dart-review.googlesource.com/27721
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2017-12-12 11:26:10 +00:00
Jens Johansen 0ae908f66f [DDC] Fix problem occurring when an async* stream is paused at the end of a yield*
This CL copies the fix for the VM
(https://codereview.chromium.org/2297013003, committed as
8a70e46d76 ~1 year ago) to DDC.

Bug:
Change-Id: I7244de9ae891ee1eb8f58d3921cf996bcfdb60b4
Reviewed-on: https://dart-review.googlesource.com/28220
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2017-12-12 11:14:20 +00:00
Martin Kustermann 317c55fa2c Reland "Use batch mode compilation for -cdartkp --strong"
Preliminary testing shows, this increases performance by around 20%. The
main benefit is by re-using a warmed-up VM and not start one from
scratch for every compilation.

Going forward we can do more optimizations, e.g. reading the platform
dill file only once into memory (instead of repeatedly) ...

  => This requires us using the new state-full IKG compiler.

Issue https://github.com/dart-lang/sdk/issues/31585

Change-Id: I2d3448783fc118611baf4671187a897227a65a6c
Reviewed-on: https://dart-review.googlesource.com/28400
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-12-12 10:14:20 +00:00
Johnni Winther 59106e8f55 Fix crashes caused by inlining
Change-Id: I7fef190a4b5248f1508f0122c5dcb5ee7fdc4c40
Reviewed-on: https://dart-review.googlesource.com/27940
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-12 08:07:29 +00:00
Konstantin Shcheglov b427e02609 Apply resolution to (real) redirecting constructors.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: I6993d549b9b8a459923fa3d72eace63e93cff1cd
Reviewed-on: https://dart-review.googlesource.com/28460
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-12 05:46:06 +00:00
Brian Wilkerson 3be5621449 Handle method invocations that cannot be resolved because of missing type information
Change-Id: I07f22964b07f38fee37ab28ff205f227f50b3024
Reviewed-on: https://dart-review.googlesource.com/28500
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-12 01:23:33 +00:00
Konstantin Shcheglov b8b9073e24 Fix for named arguments for InstanceCreationExpression.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: Ie9433fdd0f1ea2dfd65fa6bd1f44b9356d0a402e
Reviewed-on: https://dart-review.googlesource.com/28364
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2017-12-11 22:50:33 +00:00
Brian Wilkerson fbe4151da4 Handle member references that cannot be resolved because of missing type information
Change-Id: I3599846476c082a533882f6d8d18e1adeb70fa3c
Reviewed-on: https://dart-review.googlesource.com/28383
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-12-11 22:21:53 +00:00
Konstantin Shcheglov d58e9735bc Apply resolution to 'dynamic' type literal.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: I5ca078942c4841f7df8c66261acab3d103cefece
Reviewed-on: https://dart-review.googlesource.com/28365
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-12-11 21:52:53 +00:00
Konstantin Shcheglov 5c580dbe21 Remember explicit static get/assign Class and offset.
Revert merging ResolutionApplier with ValidatingResolutionApplier.

Bug:
Change-Id: Ie55ebdcb5d63be26720156a28a68f2727ebc96d3
Reviewed-on: https://dart-review.googlesource.com/28380
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-12-11 21:46:13 +00:00
Brian Wilkerson fcfdb8a4d5 Replace TokenStreamRewriter.insertToken with insertTokenAfter
Change-Id: I110099eaf0db7f4b09a8225ffaf674e132ce3d43
Reviewed-on: https://dart-review.googlesource.com/28260
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-12-11 21:24:53 +00:00
Paul Berry 7b9025b407 Report errors when type inference fails due to a circularity.
Change-Id: I48e75d86140483d5f3b9c3ad17e47fe2dfdb722e
Reviewed-on: https://dart-review.googlesource.com/28361
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-12-11 21:24:13 +00:00
Vyacheslav Egorov e84fa65696 Revert "[vm/testing] Make --strong -c dartk configuration a Dart 2.0 configuration."
This reverts commit 50865e9387.

CQ on Mac is broken.

TBR=kustermann@google.com

Bug:
Change-Id: I41a7cab59c076dba4f25f5904725cca5bb4619c9
Reviewed-on: https://dart-review.googlesource.com/28420
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-12-11 21:07:43 +00:00
Alexander Markov 0352170a8f [VM] Avoid depending on --kernel-binaries if .dill file is specified
If a .dill file is specified on the VM command line (dart/dart_bootstrap),
and --kernel-binaries is not specified, then this dill file is used as
the source of platform libraries.

It supports the case of AOT-compiling a self-contained .dill file.

Change-Id: I42956a20b98958b9a2440f156fbbef17bfc359f8
Reviewed-on: https://dart-review.googlesource.com/24341
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-12-11 20:53:46 +00:00
Konstantin Shcheglov bc836ba30e Triage comment failing comment references tests as a FastaProblem.
R=brianwilkerson@google.com, paulberry@google.com

Bug: https://github.com/dart-lang/sdk/issues/31604
Change-Id: I9750673cae3287e3d13534d549c8fec01263b6a7
Reviewed-on: https://dart-review.googlesource.com/28363
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-11 19:11:09 +00:00
Alan Knight af0b27480a Revert "Use batch mode compilation for -cdartkp --strong"
This reverts commit 8c38a415de.

Bug:
Change-Id: I1b159f2d2d10b51ee843a2ba9a61feb339152338
Reviewed-on: https://dart-review.googlesource.com/28362
Reviewed-by: Martin Kustermann <kustermann@google.com>
2017-12-11 18:22:49 +00:00
Brian Wilkerson b0d520314e Run tests with previewDart2 enabled and update failure list
Change-Id: I580545037a820e37fe22288177b289371c6ce645
Reviewed-on: https://dart-review.googlesource.com/28320
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-12-11 17:57:23 +00:00
Paul Berry 1c6e907fc8 Report errors when type inference fails due to inconsistent overrides.
I will have a follow-up CL to cover type inference failures due to
circularities.

Change-Id: I8c9af501c150d4707ad06e6bbcdc3cabdfbf9207
Reviewed-on: https://dart-review.googlesource.com/28180
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2017-12-11 17:02:45 +00:00
Konstantin Shcheglov 0fb3ff477f Issue 31589. Return only unique top-level declarations.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/31589
Change-Id: Ife9c607071bba90afb04ceb828203664fab49861
Reviewed-on: https://dart-review.googlesource.com/28122
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-12-11 16:54:33 +00:00
Vijay Menon 8602a8446e Fix LazyJsType check
This type is used for JS instanceof checks.  dart.dynamic doesn't work for that.  In general, this fall back looks dodgy (with or without this change), but this unblocks an internal user.

Change-Id: Id7401bbbef1aeddd93f40932b84f1928b4238edb
Reviewed-on: https://dart-review.googlesource.com/28121
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Jacob Richman <jacobr@google.com>
2017-12-11 16:51:48 +00:00
Dan Rubel 6b73954d6c Update popList to remove popped values from the stack
Change-Id: I0d6f9a2550c7b49e06e4b18ad3473f679f85d377
Reviewed-on: https://dart-review.googlesource.com/28080
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2017-12-11 16:15:21 +00:00
Martin Kustermann 8c38a415de Use batch mode compilation for -cdartkp --strong
Preliminary testing shows, this increases performance by around 20%. The
main benefit is by re-using a warmed-up VM and not start one from
scratch for every compilation.

Going forward we can do more optimizations, e.g. reading the platform
dill file only once into memory (instead of repeatedly) ...

  => This requires us using the new state-full IKG compiler.

Change-Id: I74db7dbb1aa79289d1045ef41f960215cf5b3b35
Reviewed-on: https://dart-review.googlesource.com/28240
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-12-11 15:55:31 +00:00
Vyacheslav Egorov 50865e9387 [vm/testing] Make --strong -c dartk configuration a Dart 2.0 configuration.
Switch it to use pkg/vm/tool/dart2 which is the source of truth for what
Dart 2 VM configuration means. Don't pass any additional flags from
tools/test.py itself.

Align pkg/vm/tool/dart2 with what tools/test.py was passing to VM on _2 suites.

Make default invocation `tools/test.py -c dartk --strong -m release,debug`
green by updating status files and skipping suites that are not Dart 2.0
compliant. I have filed issues #31588 for isolate suite and #31587 for
service suite.

Change-Id: I882b28f6a011eabf69c349ff0792b275434e39ff
Reviewed-on: https://dart-review.googlesource.com/27820
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2017-12-11 12:49:22 +00:00
Jens Johansen b2dd8418d9 [DDC-kernel] Fix of various annoyances
* Fix possibly null-pointer at end of batch mode
 * Fix changed fileUri type in source map printer
 * Silence a few warnings in tests.

Bug:
Change-Id: Ief1b9b62205a7bc20924a9e5efc06b9c9c34896a
Reviewed-on: https://dart-review.googlesource.com/27945
Reviewed-by: Karl Klose <karlklose@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2017-12-11 08:42:17 +00:00
Jens Johansen 9d8d2aec57 [DDC-step-test] Use absolute paths
Bug:
Change-Id: I3637e6f6693f1629746090f56cc466cc3e91f12e
Reviewed-on: https://dart-review.googlesource.com/27180
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Alan Knight <alanknight@google.com>
2017-12-11 08:34:37 +00:00
Jens Johansen aaa125cd25 [kernel] Fix for incorrect transformerFlags with lazy loading
When the body of a function node in a Procedure is lazy loaded the value
of the Procedures transformerFlags is not properly set before the body
has been read. That means that one can get the wrong result.
This CL makes sure to read the body (thereby setting the correct result)
before answering. The same thing is neccessary when setting the value to
avoid it being overwritten later.

Bug:
Change-Id: Id5e631e69885af0872b9644d02eb7b27dfb13391
Reviewed-on: https://dart-review.googlesource.com/21349
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2017-12-11 08:30:17 +00:00
Brian Wilkerson fd5a780898 Parse documentation comment references
Change-Id: I35912533db63c3bd681099715e60c94e7af5939a
Reviewed-on: https://dart-review.googlesource.com/28040
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-10 23:08:56 +00:00
Konstantin Shcheglov 94fdf7dfe3 Apply types to top-level variables.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: I93577570ae2b1cf1c2a5a837128378f1e2ce785f
Reviewed-on: https://dart-review.googlesource.com/27961
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-09 23:49:35 +00:00
Devon Carew 3ac5200e3a Add --preview-dart-2 integration tests for the search domain.
Bug:
Change-Id: Ib062b45936463c2e3564195bc3ffd69e031ddf17
Reviewed-on: https://dart-review.googlesource.com/27464
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-09 04:57:26 +00:00
Paul Berry 71b5fa86db Don't invoke type inference listener on synthetic for-in loop assignment.
This avoids the need for a clumsy workaround in the analyzer.

Change-Id: I2ee2ec25a7d13ccaccc4f5b817cf2026f4547378
Reviewed-on: https://dart-review.googlesource.com/27962
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-12-09 00:09:50 +00:00
Paul Berry ea7b31be82 Get rid of class ShadowSyntheticStatement, which is no longer used.
Change-Id: I18d325efb5c41babb1783e775ad148a6865ff443
Reviewed-on: https://dart-review.googlesource.com/27960
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-12-08 23:45:50 +00:00
Konstantin Shcheglov 7e22dbf1f9 Apply KernelType(s) based on function type alias.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: I8cb26120cfc7d58f1d59e0034fbe0d94c7422478
Reviewed-on: https://dart-review.googlesource.com/27927
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2017-12-08 23:28:20 +00:00
Emily Fortuna 1dab6ab88c Add List/Map factory type checks.
Bug:
Change-Id: I27b4cd1e4b528606e2ea2028eab3cdea1d47abc4
Reviewed-on: https://dart-review.googlesource.com/27882
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2017-12-08 23:11:20 +00:00
Sigmund Cherem 5fde58ceb0 Map closure entities so they get emitted in the correct output unit
Change-Id: I7edcf1715adcff3caba5bbe7ebfc18ecaeca6801
Reviewed-on: https://dart-review.googlesource.com/27920
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
2017-12-08 22:40:40 +00:00
Bob Nystrom 03c8767f73 Here's a start at exposing an API to address https://github.com/dart-lang/sdk/issues/31371.
There is no actual implementation here yet (that's your job :) ), but there is:

- An external method in dart:_internal, extractTypeArguments().
- Empty patch methods for that for the VM, dart2js, and DDC. These need to have implementations
  filled in.
- A "dart_internal" package to expose a subset of the API. It gives you:

    extractListTypeArgument()
    extractMapTypeArguments()

  We'll bring this into Google, but not publish it externally unless we find we really need to.
- A test for the behavior. It probably has bugs since I can't run it.

See: https://github.com/dart-lang/sdk/issues/31371
Change-Id: I7d9f9a3a36f8e8be106440375c80d584898c83cb
Reviewed-on: https://dart-review.googlesource.com/26467
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2017-12-08 21:57:00 +00:00
Konstantin Shcheglov 6c23d21a4c Upgrade test_reflective_loader to 0.1.3
Update test expectations for tests that pass.

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

Bug:
Change-Id: If822e47146c438c57eb8dd45554a019f01fdca89
Reviewed-on: https://dart-review.googlesource.com/27921
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2017-12-08 21:28:10 +00:00
Stephen Adams d7516551ca measure computeWorldImpact in Kernel pipeline
Change-Id: I23d80a1272413350f3bf846d6e55e4bc533ddc59
Reviewed-on: https://dart-review.googlesource.com/25724
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-12-08 21:01:51 +00:00
Sigmund Cherem d4d9ea6206 Do not print error message for whitelisted errors in perf scripts.
Note: this may change again soon, this is a quick fix to address limitations in
golem. I thought the 64Kb limit only applied to stdout, but it also applies to
stderr, so redirecting the output doesn't help.

TBR=ahe@google.com

Change-Id: I861c6c809a20982f0865afd723db5b17d67e2041
Reviewed-on: https://dart-review.googlesource.com/27881
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2017-12-08 20:22:49 +00:00
Brian Wilkerson d1a265ba93 Partially fix the copying of constructor-based annotations
Change-Id: I31a6077b7d046fb36dafbff173e3c6861efa5b67
Reviewed-on: https://dart-review.googlesource.com/27900
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2017-12-08 20:06:10 +00:00