Commit Graph

56224 Commits

Author SHA1 Message Date
Konstantin Shcheglov 618077cfee Implement FlutterCorrections.addForDesignTimeConstructor().
R=brianwilkerson@google.com, devoncarew@google.com

Change-Id: I1318020e9feab79ac1403e5d76c7e15483fc9a8e
Reviewed-on: https://dart-review.googlesource.com/49545
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-04-04 22:27:25 +00:00
Ben Konyi 090d9e9231 [ VM / Dart 2 ] Reland: Fixed StackTraceFormat test to expect file URIs in stacks generated by the Dart frontend.
This reverts commit a81f4babcc.

Change-Id: I88f0d004640dd1a994b211ab2a698fd2f87afeca
Reviewed-on: https://dart-review.googlesource.com/49540
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2018-04-04 21:28:16 +00:00
Jenny Messerly e064e5156e fix DDC to provide a library on temporary variables
When enclosingElement is `null` we fail to find the library. There are
several places in the compiler that depend on having a library available
for resolved elements.

Change-Id: I2746110d8caed97733c73e89e6baef3e96882563
Reviewed-on: https://dart-review.googlesource.com/49544
Reviewed-by: Vijay Menon <vsm@google.com>
2018-04-04 20:41:26 +00:00
Stephen Adams debfef5f2e strong-mode cleanup of swarm
TBR=sigmund@google.com

Change-Id: Id0c197b99e2c82f04329217cbda13ef35c50ce48
Reviewed-on: https://dart-review.googlesource.com/49543
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-04-04 20:14:35 +00:00
Ben Konyi f2bf297aa4 [ VM / Hot Reload ] Fixed missing NoSuchMethod exceptions when hot reloading in situations with tearoffs.
Change-Id: I43ebfe2d788114d028eebbe675308c272972e06d
Reviewed-on: https://dart-review.googlesource.com/49281
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-04-04 19:38:25 +00:00
Devon Carew e27b800e2a Don't emit errors for lint rule names.
Change-Id: Iafcb0cba215e07cfe5b9e30b6983dd69c2e1492b
Reviewed-on: https://dart-review.googlesource.com/49520
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2018-04-04 19:05:35 +00:00
Konstantin Shcheglov 1ff525c7f4 Add tests and fix a problem in inverting expressions.
R=brianwilkerson@google.com, danrubel@google.com

Change-Id: I4085efd1a4457f01ccb6cf62bd535fed61a1217a
Reviewed-on: https://dart-review.googlesource.com/49541
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2018-04-04 18:29:05 +00:00
Ryan Macnak deed9b0653 [vm, reload] Fix leak when shape changes but there are no instances.
Fix leak of reload context when used by the test harness.

Bug: https://github.com/dart-lang/sdk/issues/28349
Change-Id: I2d1bda5537befddbd1e615b355654a9fefc08273
Reviewed-on: https://dart-review.googlesource.com/49321
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-04-04 18:10:05 +00:00
Régis Crelier bd6e66c538 [VM runtime] Ignore 'implements Function' in strong mode type tests (fixes #32154).
Change-Id: I7d53594e6ffaef616b3384e073e2240a8ca7017c
Reviewed-on: https://dart-review.googlesource.com/49080
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2018-04-04 17:52:55 +00:00
Peter von der Ahé 47f09a619e Redesign LibraryPart
Before, the part-URI was serialized as a file-URI and conflated with
source location information. The part-URI is the URI in the following
declaration in a Dart source file:

   part "URI";

This is different from what we normally call a file-URI. A file URI
is used to point to the source location of the part declaration, not
the URI in the part declaration.

Furthermore, the field was serialized using writeUriReference which
only works for URIs that are in the uriToSource map on a Component.
Although this might seem like a safe optimization, it doesn't work
if the uriToSource map is omitted or if a part declaration refers to
a missing file.

Finally, due to the confusing use of fileUri, LibraryPart was
mistakenly implementing FileUriNode and annotations were stripped
of source locations if the source for the part were omitted from
uriToSource.

The partUri field is now an unresolved string that can be resolved
against either the parent library's import- or file-URI to obtain
either version as needed.

Change-Id: I255cb4eeaf89928292ab32a2f6be9ead6cc8cee1
Reviewed-on: https://dart-review.googlesource.com/49500
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-04-04 16:08:57 +00:00
Dmitry Stefantsov 4bcf8ad411 [fasta] Handle static get in ConstnessEvaluator
Bug: http://dartbug.com/32737
Change-Id: I8e2199f114c4533212930bcd8e6e4c713a4f62f9
Reviewed-on: https://dart-review.googlesource.com/49140
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-04-04 16:02:17 +00:00
Alexander Thomas 26423147ab [infra] Add dart2js-chrome to the CQ again
The buildername has changed and the builder is now based on the test matrix.

TBR=whesse@google.com

Change-Id: Iedbabd094fdd8b0e441d726a4c62b9c7894bb59c
Reviewed-on: https://dart-review.googlesource.com/49506
Reviewed-by: Alexander Thomas <athom@google.com>
2018-04-04 15:32:39 +00:00
Dmitry Stefantsov b879d4df14 [fasta] Fix insertion of noSuchMethod forwarders for private members
Bug: http://dartbug.com/32757
Change-Id: If8c57614e939b4277101403aea35dbe424f30fa3
Reviewed-on: https://dart-review.googlesource.com/49460
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2018-04-04 15:14:44 +00:00
Alexander Thomas e3ace23c87 [infra] Remove dart2js-chrome from the CQ temporarily
TBR=whesse@google.com

Change-Id: I6a2ab361fa16e95c3de895adc3b0d88e89c4ab67
Reviewed-on: https://dart-review.googlesource.com/49503
Reviewed-by: Alexander Thomas <athom@google.com>
2018-04-04 15:12:03 +00:00
Dan Rubel d0ad78db24 Improve recovery when "set" found in function body
Change-Id: I11cab70a526fb52b61be9ff91ad94b6fd23044e2
Reviewed-on: https://dart-review.googlesource.com/49340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-04-04 14:43:23 +00:00
Jens Johansen 5367304ba5 Cleanup in incremental compiler
This CL addresses comments from previous CLs, renaming variables and
handles change package versions.

Change-Id: I83cf4a33bffe82ec137a32710cd6e8ff7f25ec8b
Reviewed-on: https://dart-review.googlesource.com/49161
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-04-04 13:11:43 +00:00
Jens Johansen 8ac9fa5de2 Rename simple to basic; get rid of name in tests
This CL follows up on a previous CL, renaming "simple tests" to
"basic tests" and gets rid of names in tests, as they no longer matter.

Change-Id: Id66368f26f8e2e36a8034d237f1708b30562de86
Reviewed-on: https://dart-review.googlesource.com/49160
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-04-04 13:11:33 +00:00
Erik Ernst 4b2b15f53e Clarify that mixin application drops static members
Change-Id: If0adcdb9423d856d629dd8002ba843697dafb770
Reviewed-on: https://dart-review.googlesource.com/49360
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2018-04-04 12:26:51 +00:00
Alexander Thomas cb08bf287d [infra] Expect certain errors to pass when runtime is "none"
test.py ignores RuntimeError, MissingRuntimeError, and Timeout when the
runtime is "none". Previously, the status update tool would attempt to fix
these "unexpected passes".

Change-Id: I73c15fdc7e18aa29d5553e58b6b4e65ec07c1246
Reviewed-on: https://dart-review.googlesource.com/49461
Reviewed-by: William Hesse <whesse@google.com>
2018-04-04 11:51:25 +00:00
Dmitry Stefantsov b793c8a387 [fasta] Require explicit handling of all expression kinds in ConstnessEvaluator
Change-Id: I619f4e9e7d606232034d82645e02049b53cb94d5
Reviewed-on: https://dart-review.googlesource.com/49122
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-04-04 11:09:02 +00:00
Alexander Thomas 4c6379eaff [infra] Support preview_dart_2 in status update tool
Change-Id: Ib48afe47d22f4c2672139d3ac9946471b41ef89e
Reviewed-on: https://dart-review.googlesource.com/49440
Reviewed-by: William Hesse <whesse@google.com>
2018-04-04 09:42:58 +00:00
Alexander Thomas 1b696eb6f5 [infra] Print variable name for unknown variables
Change-Id: Ib6c21278a0f07c7cdd1ee07532242d7f64cc57bd
Reviewed-on: https://dart-review.googlesource.com/49400
Reviewed-by: William Hesse <whesse@google.com>
2018-04-04 09:42:46 +00:00
Johnni Winther 1dfb1c2f64 Implement Dart 2 static subtyping
Change-Id: I8b61b30d036e4e89d04b2704c265b5f6ebea9f47
Reviewed-on: https://dart-review.googlesource.com/49120
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-04-04 08:02:51 +00:00
Vijay Menon 163f8b9678 Cleanup async stack recording
This no longer fails on a bogus error (setting a stack on a primitive):

  main() async => throw "hi";

Doesn't come up in tests as that path (rethrow) is only exercised for unhandled exceptions.

Change-Id: I69bcf8c1c6a0cf8841c626594f95c48114ae5aaa
Reviewed-on: https://dart-review.googlesource.com/48463
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2018-04-04 01:03:41 +00:00
Jenny Messerly b07a4bc264 improve deduping of cached types in DDC/K
This works around broken FunctionTypeImpl.== in Analyzer. Also
makes DDK's type naming heuristic more consistent with DDC.

Change-Id: I09527fad681c3fdc6c66654e572e9b03c57491bd
Reviewed-on: https://dart-review.googlesource.com/37120
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2018-04-04 00:37:21 +00:00
Jenny Messerly 54f7680389 fix DDC dynamic call profiler to ignore SDK frames
This is necessary because we don't include the SDK source map inline.

Change-Id: I94d7ca5bde8288abc96796594c1242970df20ae1
Reviewed-on: https://dart-review.googlesource.com/48447
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2018-04-04 00:35:01 +00:00
Jenny Messerly a4c5607281 fix #32594, debugger() will work even if dart_sdk.js is blackboxed
Change-Id: I14b46939dbc1670610913e1a14c7045569601f5e
Reviewed-on: https://dart-review.googlesource.com/48824
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
2018-04-04 00:24:11 +00:00
Stephen Adams c5caf7e294 dart2js: Pass through type arguments in parameter defaulting stubs
This fixes a problem where a defaulted optional argument
would cause the passed type parameters to be replace with dynamic.

Change-Id: I32cf327b3a4b6176f199164c840a1114fc302205
Reviewed-on: https://dart-review.googlesource.com/49081
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-04-04 00:20:41 +00:00
Natalie Weizenbaum a0a06e172c Bring in the latest pub_semver
Change-Id: I8ba26694c1b52d47ac335117c863de26b432d084
Reviewed-on: https://dart-review.googlesource.com/49320
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Natalie Weizenbaum <nweiz@google.com>
2018-04-03 23:38:11 +00:00
Konstantin Shcheglov 4089111540 Revert "Revert "Don't do implicit new/const code generation with --preview-dart-2 enabled.""
This reverts commit e5ed23fdb5.

R=brianwilkerson@google.com

Change-Id: Ida33856e965f06f773025f3c625d6ab3bace80a8
Reviewed-on: https://dart-review.googlesource.com/49280
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-04-03 22:29:09 +00:00
Sigmund Cherem e5d20a7749 Add type to loadLibrary tearoff
Fixes https://github.com/dart-lang/sdk/issues/32604

Change-Id: If068cdf66b87f9665586c9ad7a39cb8392db9ae6
Reviewed-on: https://dart-review.googlesource.com/49042
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-04-03 21:53:29 +00:00
Dan Rubel bec3801a02 Improve recovery when mixin app missing "with" clause
Change-Id: I81849a973f1033f271b39de851c6335cae63377f
Reviewed-on: https://dart-review.googlesource.com/49241
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-04-03 20:45:19 +00:00
Dan Rubel 701e02b2fa Update AstBuilder to handle named function declaration
Change-Id: I34e699e49b7138b6d0ecf7087afef9739888c716
Reviewed-on: https://dart-review.googlesource.com/49240
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-04-03 20:45:19 +00:00
Sigmund Cherem ddbe2eece1 Change assertions in SSA so that it checks up to 100 instructions. This cuts
down compilation time for some very slow tests by a third.

Change-Id: Ic9886f4e8548262ea04208d97c93e54a3425b016
Reviewed-on: https://dart-review.googlesource.com/49260
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-04-03 20:42:10 +00:00
Alexander Markov d39e5ccf4d [vm/compiler] Fix assignment of type to phi, take 2
Fixes https://github.com/dart-lang/sdk/issues/32597

Change-Id: I92fe329430420d5bf35f03763ec5b656bd034f6f
Reviewed-on: https://dart-review.googlesource.com/48443
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-04-03 20:32:09 +00:00
Sigmund Cherem a173784a31 Readd web-components: it is used for unit tests of dart:html
Change-Id: I61a8c397515fa33217011112b8204738475ed191
Reviewed-on: https://dart-review.googlesource.com/49261
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-04-03 20:13:19 +00:00
Dan Rubel 57d6ec265d Improve AstBuilder for-in recovery
Fix AstBuilder recovery when for-in expression is not a simple identifier

Change-Id: Id32ec4f8054de7870d8424c489dc5f5819ec7632
Reviewed-on: https://dart-review.googlesource.com/49181
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-04-03 18:08:29 +00:00
Konstantin Shcheglov 0ea0c42313 Extract AnalysisDriverResolutionTest and corresponding Kernel version into separate files.
Large files are pain to work in.

R=brianwilkerson@google.com

Change-Id: I94ba96323a4de41b1b67e72a4ac21644e13815ef
Reviewed-on: https://dart-review.googlesource.com/49220
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-04-03 17:47:27 +00:00
Dan Rubel ca7edd065c Improve invalid function body recovery
* Improve error message for use of "return" instead of "=>"
* Improve recovery given extraneous "return" after "=>"

Change-Id: I0e421ece1128f98b883b6c9110f1a5eaaced3d78
Reviewed-on: https://dart-review.googlesource.com/49180
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-04-03 17:31:39 +00:00
Konstantin Shcheglov 83418436b7 Issue 32740. Support for implicit call() invocation in top-level inference.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/32740
Change-Id: I669ca31653019c30a19f45f527b2bd7023ff80b0
Reviewed-on: https://dart-review.googlesource.com/49100
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-04-03 16:04:40 +00:00
Jens Johansen 38fae026b4 Allow to output full component via computeDelta
This is the second attempt at this change.
The original try was committed as f9c7a4a22d.
The revert of that was committed as 2f68e82526.

This CL allows users of the incremental compiler to ask for a computeDelta
call to include the full Component in the output,
basically turning the incremental compiler into a batch compiler.

This CL furthermore changes the frontend_server (in pkg/vm) to use this
functionality.

This change - used in flutter - takes the time it takes to run
`flutter test` in `packages/flutter` from ~8 minutes 30 seconds to
~2 minutes 30 seconds (on my machine).

Fixes #32663.

Change-Id: I073e77b3596b33a24cabcfbcedf97bb0be7aa450
Reviewed-on: https://dart-review.googlesource.com/49125
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-04-03 12:59:48 +00:00
Erik Ernst c98df5b065 Check that type alias equality relies on the underlying type, not the typedefed name.
Note that this is a multi-test, which is helpful in order to make it visible which situations are covered and which ones are not, but when it all works it would make sense to just run everything in one step, in order to get better performance.

Change-Id: Ifab94f7ad369a7c76bab3337eabf2ddd22821b04
Reviewed-on: https://dart-review.googlesource.com/47882
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2018-04-03 12:34:40 +00:00
Lasse Reichstein Holst Nielsen 155e55cbb1 Remove defaultValue parameter from Stream.first/lastWhere.
Change-Id: Id1f642a2f29086a5a7478c771ce16987b340861f
Reviewed-on: https://dart-review.googlesource.com/43420
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-04-03 10:58:15 +00:00
Johnni Winther 0588816fda Move type_representation_test to rti/ folder
Change-Id: I951b15d06a365c9323073b7474d7d0322491c0df
Reviewed-on: https://dart-review.googlesource.com/48860
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-04-03 09:24:44 +00:00
Lasse R.H. Nielsen 0ba21c25b7 Clean up Map#operator[] documentation
New PR for https://github.com/dart-lang/sdk/pull/32714 to get a squashed view.
Thanks @burkemw3.

Closes #32746
https://github.com/dart-lang/sdk/pull/32746

GitOrigin-RevId: ad3342fc027505abb9dcd0723279bbd276bf6d8a
Change-Id: I00905dded9de083350051a36657b928454b0a9fe
Reviewed-on: https://dart-review.googlesource.com/49101
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2018-04-03 07:51:05 +00:00
Sigmund Cherem e01fbecdf5 Fix type in NativeTypedArrayOfDouble
Change-Id: Ifeb5d1bdaa9dce941449217127b7324e3744d6df
Reviewed-on: https://dart-review.googlesource.com/49082
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2018-04-03 00:15:55 +00:00
Brian Wilkerson 8d78982c3f Move file system access support from AnalysisContext to ContextRoot
Change-Id: Ic9097b8852e578001cc6555bcd4d8a94a1fde08d
Reviewed-on: https://dart-review.googlesource.com/49041
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-04-02 22:16:25 +00:00
Alexander Markov 7b51acd37f [vm/kernel/aot] Treat 'return;' as 'return null;' in TFA
Change-Id: I8ccc72494fda00bbcc72b538035e9f6ff8cd2d82
Reviewed-on: https://dart-review.googlesource.com/49060
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-04-02 22:00:05 +00:00
Kevin Moore 3ba478a258 Remove SDK browser DEP
Last usage was removed

Change-Id: Ib8c6d67f22c514c8f706c2c4a683c7022a05ea87
Reviewed-on: https://dart-review.googlesource.com/49000
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
2018-04-02 19:35:54 +00:00
Ryan Macnak bfb9fae597 [vm] Don't keep events in memory when using systrace/traceutil.
Change-Id: Ic784e1f6c95d1c544958ec5510c168d3d58f50fb
Reviewed-on: https://dart-review.googlesource.com/48820
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2018-04-02 18:34:35 +00:00