Commit graph

55417 commits

Author SHA1 Message Date
Stephen Adams 81d779c41b Redo "Pass type argument into rewritten marked function"
TBR=sigmund@google.com

Change-Id: I0999ab52f76da185c601ce7105e4a8491c5e4edf
Reviewed-on: https://dart-review.googlesource.com/52262
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-04-21 01:14:49 +00:00
Mike Fairhurst ebcd876d0c Remove broken overrides
Change-Id: I7815fb1a139bf4723e29177965cfde8942ef2d3e
Reviewed-on: https://dart-review.googlesource.com/52264
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-04-20 22:04:26 +00:00
Konstantin Shcheglov 6865041334 Issue 27098. Check that argument is assignable to parameter in call().
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/27098
Change-Id: I0d5ac65202b632646bd7b26170c55ab985d2523c
Reviewed-on: https://dart-review.googlesource.com/52263
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-04-20 21:50:59 +00:00
Johnni Winther be47fa67aa Fix dart2js subtyping
A<dynamic> is _not_ a subtype of A<int> in Dart 2

Change-Id: I0d1185b38192a06aaf9d8622a78c7384dfc287dc
Reviewed-on: https://dart-review.googlesource.com/52106
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-04-20 21:44:09 +00:00
Konstantin Shcheglov 818c4b5bfd Remove AbsolutePathContext and use package:path instead.
I see however that linter/test/rule_test.dart uses it, but as far as I
can see, that's it. All other usages are from analyzer and
analysis_server.

R=brianwilkerson@google.com

Change-Id: I2b82870a4a4ec6f155326d8ee6dc1c1028f84793
Reviewed-on: https://dart-review.googlesource.com/52265
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-04-20 21:01:06 +00:00
Johnni Winther 74a69a03c4 Add tests for method/local function signatures
Change-Id: I608303b91e0a4ed0d83130841719f0f5116102de
Reviewed-on: https://dart-review.googlesource.com/52105
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-04-20 20:26:07 +00:00
pq 534268d017 Bump Linter to 0.1.49
* new `void_checks` lint

(Also removes analyzer internal API dependency.)

Change-Id: I71015d765c033c18d06ac17b64c399612ebb4e17
Reviewed-on: https://dart-review.googlesource.com/52260
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-04-20 20:23:47 +00:00
Brian Wilkerson 27d93e20c4 Remove unused code in a test
Change-Id: I83bae6d28c27dde2beaff470362e84b2fb0e5296
Reviewed-on: https://dart-review.googlesource.com/52161
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-04-20 20:17:30 +00:00
Johnni Winther 4e6e68fca8 Update constant_expression_test to match CFE encoding
Closes #32511

Change-Id: I7a76bff6ed59023edbb4d678991d627b683ddf6f
Reviewed-on: https://dart-review.googlesource.com/52220
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-04-20 20:03:59 +00:00
Stephen Adams a5ea3c5e33 Revert "Pass type argument into rewritten marked function"
This reverts commit 25b3dbb7b3.

TBR=sigmund@google.com

Change-Id: If0e37738e1516efcb144bffbaf57cfc7d3028d13
Reviewed-on: https://dart-review.googlesource.com/52261
Reviewed-by: Stephen Adams <sra@google.com>
2018-04-20 19:30:14 +00:00
Johnni Winther 395c96153b Fix subtype/equals for function types with type variable return types.
Change-Id: I645f73cabc74c4a427eb100220b3ddcf7232b0a4
Reviewed-on: https://dart-review.googlesource.com/52101
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-04-20 19:21:59 +00:00
Stephen Adams 25b3dbb7b3 Pass type argument into rewritten marked function
The values returned from calling sync*, async and async* are now parameterised.
Simple cases where the type has no type parameters are handled.

The next step is to introduce a signature-like j-model entity to compute the type in more complex cases.


Change-Id: I2e43088cc6383a70e3a3d3067ec7542694ee2d0a
Reviewed-on: https://dart-review.googlesource.com/51421
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-04-20 18:41:59 +00:00
Brian Wilkerson 712193bf77 Attempt to fix bots
Change-Id: I24ee05fcd567eaab47854ef0bb21e54bbc6ee7c7
Reviewed-on: https://dart-review.googlesource.com/52162
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-04-20 17:41:29 +00:00
Konstantin Shcheglov f755d9dc33 Don't specify 'void' return type for setters in 'Encapsulate Field'.
R=brianwilkerson@google.com

Bug: https://github.com/flutter/flutter-intellij/issues/2104
Change-Id: Ib7fe60e27f37726be5131c8a2e915b7911773855
Reviewed-on: https://dart-review.googlesource.com/52180
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-04-20 17:40:39 +00:00
Devon Carew 703a26a723 Pass the --dart-sdk flag into the flutter analyze benchmark.
Change-Id: I232e108eb29dd3cab75c4586f777555d84385731
Reviewed-on: https://dart-review.googlesource.com/52082
Reviewed-by: Jonas Termansen <sortie@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2018-04-20 17:33:09 +00:00
Mike Fairhurst bd757f9948 Redo #28580: instantiate bounds to bounds.
One thing to be careful of here is that function type bounds may be
left unbounded. However, their parameters and return type cannot refer
to a type parameter for resolve-to-bounds to work.

There are also a large number of ways that this can loop infinitely, and
a number of new guards had to be added (as well as some test cases) to
catch them all.

Change-Id: I14322f5f71d1f7b73b27a870553e5c588b2c7e2e
Reviewed-on: https://dart-review.googlesource.com/52062
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-04-20 17:25:09 +00:00
Vyacheslav Egorov 375b32d621 [vm/compiler] Canonicalize more intermediate constants in IL.
* when building IL from Kernel use canonical double representation
instead of allocating new double objects;
* in constant propagation canonicalize immutable primitive constants
(strings, mints and doubles) before replacing instruction with its
constant value;

This relands 5909932d38 with the part
that was causing timeouts on flutter_test reverted.

See https://github.com/dart-lang/sdk/issues/32904 for more details.

TBR=aam@google.com

Change-Id: I0c128e44dd6c9689c4b7e9dd91832408214847f3
Reviewed-on: https://dart-review.googlesource.com/51460
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2018-04-20 16:59:49 +00:00
Brian Wilkerson 9d7e35b417 Unmake some breaking changes made in previous CLs
Change-Id: I4c28418f8e5a3c9af7b37f44d7ebd3cd2d818c16
Reviewed-on: https://dart-review.googlesource.com/52160
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-04-20 16:16:09 +00:00
Dan Rubel 313b5bd191 Rename TypeInfo subclasses and constants
Rename the TypeInfo constants and related constants in preparation
for refactoring and improving type argument and type parameter parsing.

Change-Id: I5a741ee06f373800973942c233490fe83916e39c
Reviewed-on: https://dart-review.googlesource.com/52140
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-04-20 16:07:39 +00:00
Brian Wilkerson a456753267 Move a library only used by tests into the test directory
Change-Id: Ie8dcadc6313b3745ef874954da968839eb460c71
Reviewed-on: https://dart-review.googlesource.com/52020
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-04-20 15:56:00 +00:00
Brian Wilkerson 9a7168a2bf Clean up dead code in quick assist support
Change-Id: I983c78a9ad131e5ae35a83abf2f455608b3ae835
Reviewed-on: https://dart-review.googlesource.com/52060
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-04-20 14:23:29 +00:00
danrubel 10b441b16b Improve conditional import expression recovery
This improves recovery when parsing conditional import expressions
by repositioning the synthetic closing ')' that was inserted by the
scanner in a less than optimal location.

This approach relies on the beforeSynthetic field being set correctly.
While the scanner still sets the 'next' and 'beforeSynthetic' fields
directly for efficiency, most other functions which update an existing
token stream have been revised to call 'setNext()' rather than setting
the 'next' field directly. This ensures that the 'beforeSynthetic' field
will be correctly updated.

Change-Id: Id631fd600c64d1feaf00593acb74a7070e354f07
Reviewed-on: https://dart-review.googlesource.com/52120
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-04-20 13:58:50 +00:00
Dmitry Stefantsov 1f7fa3e1ad Revert "[fasta] Handle annotations on formals and variables"
This reverts commit 0289071afe.

The reverted commit breaks precomp bots.

Change-Id: I3218d5a0779e1f30f4172ede2294be558ded2abd
Reviewed-on: https://dart-review.googlesource.com/52103
Reviewed-by: Jens Johansen <jensj@google.com>
2018-04-20 13:32:59 +00:00
Aske Simon Christensen f06118ef8f Dart 2 fixes to various tests.
All fixes are related to the requirement that a concrete class must
implement its entire interface or have a non-trivial noSuchMethod
implementation.

Change-Id: I015e0565e5dd9cfa324c38bb43696e365c58329a
Reviewed-on: https://dart-review.googlesource.com/51880
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-04-20 12:57:19 +00:00
danrubel be741ba511 Add beforeSynthetic field for synthetic ")", "]", and "}" tokens
This CL updates SyntheticToken to have a new beforeSynthetic field
and the fasta scanner to set that field for synthetic ")", "]", and "}" tokens.
This makes it much more efficient for the parser to move a synthetic
closer when the scanner has inserted it in a less than optimal location
in the token stream.

This CL also addresses a comment in
Address comment in https://dart-review.googlesource.com/c/sdk/+/51561

Change-Id: I7f056ac25f2ca4cf5edb0ef4bce7f1e9dd76de9a
Reviewed-on: https://dart-review.googlesource.com/52040
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-04-20 12:21:09 +00:00
Dmitry Stefantsov 0289071afe [fasta] Handle annotations on formals and variables
Bug: http://dartbug.com/28434
Change-Id: If386d24f95d14a38150c9316caf7a17065583e32
Reviewed-on: https://dart-review.googlesource.com/51840
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2018-04-20 11:19:39 +00:00
Aske Simon Christensen e33a636317 Fixes to frontend tests.
Tests contained erroneously abstract methods and non-abstract classes
that made them not proper Dart 2.

Change-Id: Ie04935f3ffd4aa4e9756048de9668c5481553733
Reviewed-on: https://dart-review.googlesource.com/51845
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2018-04-20 10:54:59 +00:00
Aske Simon Christensen f50c86c419 Fixed noSuchMethod implementation in future subclass tests.
Change-Id: Ia8f5eb36b2103b7312062167ae917e9c97b738b5
Reviewed-on: https://dart-review.googlesource.com/51843
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2018-04-20 10:41:39 +00:00
Ben Konyi cdb4a15732 [ VM / Kernel ] Implemented SourceFingerprint for Dart 2.
Change-Id: I567dda75b908895950329447fdf86df0d66b1984
Reviewed-on: https://dart-review.googlesource.com/50380
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2018-04-19 23:48:28 +00:00
Ryan Macnak 859a8748e0 Update status files to account for different type of failures in different modes.
Change-Id: Ibd808e8a7fd5ca2b33a63d4b9b16b371b11006ed
Reviewed-on: https://dart-review.googlesource.com/52080
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-04-19 23:18:08 +00:00
Ryan Macnak 66e66daf86 [fuchsia] Print error on failing fdio_ns_destroy instead of crashing.
Makes debug mode more useful.

Change-Id: Iccdb1be03d4abe23424cfb993c566fecb3d74ced
Reviewed-on: https://dart-review.googlesource.com/52021
Reviewed-by: Zach Anderson <zra@google.com>
2018-04-19 22:53:13 +00:00
Harry Terkelsen ffc1f607a1 dart2js: Emit fields in dump-info in more cases.
Previously we would omit a field if it was never the element
in a codegen WorkItem. However, almost all fields fail this test
because field getters are inlined in the optimizer.

Change-Id: I34de218dadb5937885d77dd429237584d1a8be2c
Reviewed-on: https://dart-review.googlesource.com/51581
Commit-Queue: Harry Terkelsen <het@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-04-19 22:14:18 +00:00
Jacob Richman 4fdf84e4f4 # Enter a description of the change.
Make all lists returned by ast_from_binary growable so the ast is more consistent with the ast generated by parsing dart code which generally contains growable lists as opposed to fixed-length lists.

This fixes a bug in the Flutter --track-widget-creation transform
where it would fail on an AST if it was deserialized from a binary file
rather than parsed from source code.

Change-Id: I4e6b199ed98df1b72d8d6844829341975a2c29c9
Reviewed-on: https://dart-review.googlesource.com/51780
Commit-Queue: Jacob Richman <jacobr@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-04-19 22:09:38 +00:00
Jenny Messerly 06bebcafba fix how DDC startRootIsolate calls main()
Change-Id: Ifce734bfa3d1dd48cf264727e6ca2da8e8bb6fa1
Reviewed-on: https://dart-review.googlesource.com/52022
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2018-04-19 22:03:28 +00:00
Dan Rubel bdfcc20846 Improve fasta parser formal parameter recovery
This CL improves recovery given invalid or malformed formal parameter
types and identifiers. This accomplished by switching the
parseFormalParameter method to use computeType rather than parseType,
improving recovery when parsing field initializers, and in the process,
further reducing the size of parseType and eliminating 6 unused
TypeContinuation elements.

Change-Id: I6f05d8018bf8d9f2c256e5a64408c29db006a8e2
Reviewed-on: https://dart-review.googlesource.com/52000
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-04-19 20:25:58 +00:00
Stephen Adams 32df3387f2 Fix the output type of HNegate.
TBR=sigmund@google.com

Change-Id: If5875aac80f111bb95852ad4d9f568dadf4f9d65
Reviewed-on: https://dart-review.googlesource.com/51980
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-04-19 20:18:38 +00:00
Stephen Adams 2f9f8088b5 Don't lower to HIndexAssign when the value should be checked
'--checked' and '--strong' accidentally lowered []= to HIndexAssign,
in effect removing the check on the parametric covariant argument.

This makes --checked slower for some array-update-intensive
benchmarks.

Change-Id: I8c36e1db15ac6a98e1ec9ca01b2ebdd3effafc1b
Reviewed-on: https://dart-review.googlesource.com/51802
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-04-19 20:15:48 +00:00
Martin Kustermann 3b057dea98 [VM] Remove legacy Object::empty_context() and CTX constant
Our generated code does not keep the context in a special register
anymore (for quite some time now).  The context is just another definition
in the IR language and gets assigned register locations by the linearscan
register allocator.

Furthermore we no longer use an empty context for closures which have no
captured states, instead the context of those closures is just `null`.

This CL therefore removes Object::empty_context() and the CTX constant.

Change-Id: Iea171e0d0fd56c48f1c456e08e060a12267e39cc
Reviewed-on: https://dart-review.googlesource.com/51129
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-04-19 20:09:38 +00:00
Brian Wilkerson 1a56d6534c Add a recovery test based on reported failure (and fix a minor bug)
Change-Id: Ieaa0309559f7b2cc5c24741f16194c98f9ba0df2
Reviewed-on: https://dart-review.googlesource.com/51960
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-04-19 18:47:19 +00:00
Ryan Macnak 2048137583 Fix crash dump message not to claim the process was the standlone VM. This code is shared by other users of dart:io such as Flutter.
Change-Id: I0612670ad74fcfc2103ba93ac531c6f44ac44dc0
Reviewed-on: https://dart-review.googlesource.com/51804
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-04-19 18:16:59 +00:00
Ryan Macnak da14cbd1d7 [vm] Refuse to generate or load script snapshots for Dart 2.
Script snapshots add nothing over kernel files.

Bug: https://github.com/dart-lang/sdk/issues/32911
Change-Id: If7a58ce8ec5305462e9bf449d02394c87579c9a4
Reviewed-on: https://dart-review.googlesource.com/51801
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-04-19 17:08:38 +00:00
Brian Wilkerson bdc727d49b Fix npe in quick fix computation (issue 32926)
Change-Id: Ic93da063758513f101d753516cb61c351dae2501
Reviewed-on: https://dart-review.googlesource.com/51940
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Danny Tuppeny <dantup@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-04-19 17:05:20 +00:00
Dan Rubel 499b6ba4cf Improve fasta parser computeType recovery
This CL improves recovery when a type is required to interpret
"Foo.", ".", and ".Foo" as malformed prefixed type references.
When a type is *not* required, each of the above are still interpreted
as no-type-reference.

Change-Id: Ia20caa8619821d24c5b16fd0015cee03987ee2a6
Reviewed-on: https://dart-review.googlesource.com/51900
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-04-19 16:08:49 +00:00
Samir Jindel 7e64ddd00f [kernel/vm] Update closure conversion to work in Dart 2.
The change to vm.dart which turns it on by default will *not* be committed.

Change-Id: Ia3a80ff8e5335aa326f1ffaa9f5c9728ad511b60
Reviewed-on: https://dart-review.googlesource.com/51721
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2018-04-19 16:04:08 +00:00
Johnni Winther 6a8cad4877 Optimize RTI capture
Change-Id: I1b1b363de442e118ccb1e2018748a2ba7c5fe9e6
Reviewed-on: https://dart-review.googlesource.com/51642
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-04-19 16:00:28 +00:00
Lasse R.H. Nielsen fab5bef194 More upper-case constants found.
Change-Id: Ibce257b802d398612ad03e1d53014b82f9b9c54f
Reviewed-on: https://dart-review.googlesource.com/51881
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2018-04-19 15:08:18 +00:00
Dan Rubel 58dc646c85 Update parser recovery tests
Change-Id: Iab3523b61e878844e7e8ee296a7c4da289758028
Reviewed-on: https://dart-review.googlesource.com/51860
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-04-19 15:05:58 +00:00
Lasse R.H. Nielsen 2eeea7bc30 Remove more usages of upper-case constants in SDK
Change-Id: I4e54ed7eba5f2af7852faba2cffae12f28e618cf
Reviewed-on: https://dart-review.googlesource.com/51844
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2018-04-19 13:31:57 +00:00
Johnni Winther 1f2f8be33a Add tests for closure/rti optimization
Change-Id: Iedf1d63cb7d87ecd87a059988b1fd95431aeab6a
Reviewed-on: https://dart-review.googlesource.com/51641
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-04-19 12:51:50 +00:00
Stephen Adams ec1186bc80 update dart2js --strong status
TBR=sigmund@google.com

Change-Id: I95eaeb3f38da163b7bfdbdca1cae4a40aca6b42a
Reviewed-on: https://dart-review.googlesource.com/51803
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-04-19 01:20:47 +00:00