Commit Graph

20409 Commits

Author SHA1 Message Date
Kevin Millikin 05deb5b2f5 Just apply covariant fixes
The implementation built up a list of closures and then immediately
looped over them to apply them.  It seems simpler to do the operations
directly in the first place and it's probably faster too.

Change-Id: I4f3ce4cd1cb1bc3169f1b7190d54118ec22b8bda
Reviewed-on: https://dart-review.googlesource.com/55223
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-16 14:49:38 +00:00
Martin Kustermann aafc2a6d43 Reland "[vm/kernel] Enable kernel2kernel "constants" transformation in AOT mode (after running TFA)"
The CL was originally committed in 039e8a175 (and reverted in
46ab040e5). The fix for the issue has landed in 9d9ce8d69 .

This time the CL will land in "disabled" form and will be enabled in a separate CL.

Change-Id: I3d5eb952230aee99875e3c58a6595691c5145e25
Reviewed-on: https://dart-review.googlesource.com/55361
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-05-16 12:48:38 +00:00
Dan Rubel 137942aca5 Implement TypeParamOrArgInfo.parseVariables
This CL is the next step in replacing parseType and improving recovery.
It introduces a new parseVariables method for parsing type parameters
(aka type variables) method in addition to improving recovery in the
parseArguments method.

Change-Id: I4049528152a7c731771d7a8145e5f79729165d79
Reviewed-on: https://dart-review.googlesource.com/55301
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-05-16 11:44:08 +00:00
Johnni Winther 9bfdaf9182 Revert "Cleanup after removing MirrorsData"
Apparently a bit to eager :(

Change-Id: Id1e87447f3641c4d9689a4a7aa8cdd8cbd839d89
Reviewed-on: https://dart-review.googlesource.com/55380
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2018-05-16 11:35:13 +00:00
Peter von der Ahé 4e9f455220 Ensure toString is always implemented on generators
Change-Id: Iedff0cd12652ec57400718cb3ad9e865623d9165
Reviewed-on: https://dart-review.googlesource.com/55280
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-16 10:45:08 +00:00
Peter von der Ahé 7a2afce0aa Convert LoadLibraryAccessor to LoadLibraryGenerator
Change-Id: I60d7c905df8fa133693ce981d15476c1792be36e
Reviewed-on: https://dart-review.googlesource.com/55129
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-16 10:45:08 +00:00
Peter von der Ahé 6a10efba11 Convert StaticAccessor to StaticAccessGenerator
Change-Id: Ie3265ce20ce6e6b5114f8866010579e485bdcd38
Reviewed-on: https://dart-review.googlesource.com/55125
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-16 10:45:08 +00:00
Peter von der Ahé 331d31f56c Convert SuperIndexAccessor to SuperIndexedAccessGenerator
Change-Id: I0b4b53373b248e88058f0353a293d57a6eae766e
Reviewed-on: https://dart-review.googlesource.com/55124
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-16 10:45:08 +00:00
Peter von der Ahé 21ae1a0ab7 Convert ThisIndexAccessor to ThisIndexedAccessGenerator
Change-Id: I2ea175bbaa391bf719ba7fa000c164eff701e8c4
Reviewed-on: https://dart-review.googlesource.com/55123
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-16 10:45:08 +00:00
Peter von der Ahé 7e7c795919 Convert IndexAccessor to IndexedAccessGenerator
Change-Id: Ib5c1ef8b78543a0d9e0a98e10d6c1315409d9246
Reviewed-on: https://dart-review.googlesource.com/55122
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-16 10:45:08 +00:00
Kevin Millikin fbb9f525be Make reportCrash generic
This avoids a runtime typecheck failure because Future is Future<dynamic>
which isn't a subtype of Future<T> for any T that is not a top type.

Change-Id: I067987e27177f3ed81ec14101c965488f1c35e2e
Reviewed-on: https://dart-review.googlesource.com/55281
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-05-16 09:59:23 +00:00
Johnni Winther 54331b1c4b Delete elements.dart and resolution_types.dart
Change-Id: Ib50dabdbeec72ebf443e85b51b818d9ed0602b4f
Reviewed-on: https://dart-review.googlesource.com/55221
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-16 09:54:18 +00:00
Johnni Winther baf09db165 Remove Resolution and Target
Change-Id: I30fb47acd820077b0dd9efebc3460a9a8a1e6e1f
Reviewed-on: https://dart-review.googlesource.com/55200
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-16 09:54:18 +00:00
Johnni Winther 944ce140e2 Remove most imports of elements/elements.dart
Change-Id: I4ecd45286fab1171eab1e2d3d443a0441bbdc883
Reviewed-on: https://dart-review.googlesource.com/55180
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-16 09:54:18 +00:00
Johnni Winther c18311933b Cleanup after removing MirrorsData
Closes #23873

Change-Id: Iaa7e0b1d4f0426280bdc496d47d7799ce30543fa
Reviewed-on: https://dart-review.googlesource.com/55167
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-16 09:54:18 +00:00
Johnni Winther fc7f18a420 Delete MirrorsData
Change-Id: Ic5330226349dafc33c27291aa576bfe4d0ea09e8
Reviewed-on: https://dart-review.googlesource.com/55160
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-16 09:54:18 +00:00
Johnni Winther 1f20129650 Remove mirrors analyses
Change-Id: I1a4a0d2bd1d87a5877864d46636ff68d0426a09c
Reviewed-on: https://dart-review.googlesource.com/55127
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-16 09:54:18 +00:00
Johnni Winther 47a67b2b8f Delete AST nodes
Change-Id: Iab9396b3a21cd9502c455fb73633216faed777ef
Reviewed-on: https://dart-review.googlesource.com/55126
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-16 09:54:18 +00:00
Johnni Winther f4fb1fe932 Remove most references to tree/tree.dart
Change-Id: I2ebcfdc616ee204e8e39277537e7e3c622caee42
Reviewed-on: https://dart-review.googlesource.com/55121
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-16 09:54:18 +00:00
Lasse R.H. Nielsen bf77f064c1 Mark NoSuchMethodError constructor as deprecated.
Move implementation details into patch files, it does not belong in the interface.
Actually implement NoSuchMethod.withInvocation in dart2js.

Change-Id: I37049c258067b962d18eff42196e37aa127f0dea
Reviewed-on: https://dart-review.googlesource.com/55166
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-05-16 09:09:08 +00:00
Danny Tuppeny 9b8776763c Add some (marked) failing tests for FILE_HEADER
Bug: https://github.com/dart-lang/sdk/issues/33033
Change-Id: I89d358dd1dc41d8bece7f16ed49fb98b9b8c0aa5
Reviewed-on: https://dart-review.googlesource.com/55104
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-05-16 07:35:48 +00:00
Jens Johansen 021b4a0bc8 Always reuse dart: libraries in computeReusedLibraries
We don't support invalidating `dart:` libraries, so there's no reason
to include such libraries in the computeReusedLibraries calculations:
They should aways be reused.

This CL does exactly that.

On 430 flutter tests, it changes the time it takes to execute
`computeReusedLibraries` by -15.7188% +/- 8.83679%
(-193.125 ms +/- 108.571 ms for all 430 tests) (at 95% confidence).

Said another way it reduces the average runtime for
computeReusedLibraries from ~2.8 ms to ~2.4 ms.

Change-Id: I23a68d4910c81be94b8d9d29495e63546bdad23f
Reviewed-on: https://dart-review.googlesource.com/52441
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2018-05-16 06:05:57 +00:00
Jens Johansen df931e97a6 Only test if package URIs are updated if that's possible
Before this CL we always translated a package import URI to file URI
to check whether the file URI had been updated.
This CL changes that so it only does that once* per invalidation of the
.packages file.

Running 430 flutter tests in "batch incremental compilation mode" and
timing computeReusedLibraries, this change, at 95% confidence, changes
the time by -61.7793% +/- 7.63375% (-1941.6 ms +/- 239.914 ms) for all
430 files, or on average reduces the time it takes to run
computeReusedLibraries from ~7.3 ms to ~2.8 ms.

The total compilation time varies too much for it make a difference
at 95% confidence on that figure though.

* Once is a loose term here, it's once per successful compilation, i.e.
if we get a compilation error that goes into erroneousComponent it
doesn't count and we have to do it again and again until we get into
a good state.

Change-Id: Id1b4534f515d8c0487362f743112b44ce1372ed0
Reviewed-on: https://dart-review.googlesource.com/52440
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2018-05-16 06:04:49 +00:00
Stephen Adams 38f0d8faef [dart2js] Check type bounds before value parameters
Change-Id: Ibd75aa67b478b201f1115e9f3dc682bcc5f108c6
Reviewed-on: https://dart-review.googlesource.com/55275
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-05-15 23:18:57 +00:00
Brian Wilkerson 874f7f6c5c Add Forest support for creating if statements
Change-Id: Ia7f1f672adee0e8da2e5c1c54f9690e7f2597263
Reviewed-on: https://dart-review.googlesource.com/55273
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-05-15 22:31:42 +00:00
Mike Fairhurst ddd1c3548f Add ability for the angular plugin to set ErrorVerifier.enclosingClass.
There is a similar setter on Resolver, and without it, users are seeing
an issue:
https://github.com/dart-lang/angular_analyzer_plugin/issues/567.

Alternative options to modifying pkg:analyzer APIs are few. One option
is to block UNQUALIFIED_STATIC_REFERNCE errors, however, that will be
too general. We would need to implement a lookup to double-check when
those errors are reported, if they should be.

Alternatively the plugin could block all of them, and then do a second
pass to provide them where the plugins deems they should exist.

This seems the easiest approach and mirrors the api that [Resolver.set
enclosingClass] provides, but the chain of assertions makes we want a
second look on it.

Change-Id: I12df71719c7a0e968a0b3a43cc27c69160ec5210
Reviewed-on: https://dart-review.googlesource.com/54703
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2018-05-15 22:28:47 +00:00
Brian Wilkerson 4b647fcfe1 Add Forest support for creating yield statements
Change-Id: I244d6e17dee72704c6cb5cc2c26b9379fac03440
Reviewed-on: https://dart-review.googlesource.com/55274
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-05-15 22:23:37 +00:00
Ben Konyi 916b9da48d [ VM ] Fixed issue where backing array was deleted from an ExternalTypedData before the ExternalTypedData was used.
Reland "Fix issues with FileSystemEntities which have non-UTF8 paths causing exceptions to be thrown when converting to/from a Dart VM String."

This reverts commit 4f549e2900.

Change-Id: Ia27c8c300beb178fa7b08ffe0bfcb2d61f65bbb5
Reviewed-on: https://dart-review.googlesource.com/55271
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2018-05-15 21:54:46 +00:00
Konstantin Shcheglov 8907348ae9 Issue 2246. Fix for 'Wrap with new widget' assist when activated on a constructor name.
R=brianwilkerson@google.com

Bug: https://github.com/flutter/flutter-intellij/issues/2246
Change-Id: I66ca8b121b2600fa86c787fc26fe6dc01c79c24d
Reviewed-on: https://dart-review.googlesource.com/55272
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-05-15 21:22:26 +00:00
Konstantin Shcheglov ee414b4d9d Issue 2249. Fix swap with parent/child when code is not formatted.
We cannot just rely on line ends.
AST is our best guide.

R=brianwilkerson@google.com

Bug: https://github.com/flutter/flutter-intellij/issues/2249
Change-Id: Id901878f621abc745fb6a380e5cf9afe21884642
Reviewed-on: https://dart-review.googlesource.com/55268
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-05-15 20:35:06 +00:00
Stephen Adams 8cf81446a3 Add method stubs to support instantiation stubs
Change-Id: Id9cce10b6319d268eb4ec2745465df5f06d3b906
Reviewed-on: https://dart-review.googlesource.com/55081
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-05-15 20:32:46 +00:00
Alexander Markov a2b1ce8418 [vm/kernel/bytecode] Add an option to drop AST if bytecode was generated
This CL adds experimental option --drop-ast to the gen_kernel tool in
order to remove AST bodies of members with bytecode.

Change-Id: Ib5f02eb189ec1ccd9fa77159c175fc3774998ce5
Reviewed-on: https://dart-review.googlesource.com/55262
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2018-05-15 20:04:36 +00:00
Brian Wilkerson e5853e6098 Remove some unused imports in kernel_ast_api
Change-Id: Ia92bb1c8e30f3f79a7aaa5d3b93e9461cce23c17
Reviewed-on: https://dart-review.googlesource.com/55261
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-05-15 18:05:58 +00:00
Brian Wilkerson fc5b12ac7b Delay invoking toKernelStatement until necessary; address other comments
Change-Id: I583aa89ba93f945e04e38be4565ace874e1c718a
Reviewed-on: https://dart-review.googlesource.com/55260
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-05-15 16:56:36 +00:00
Alexander Markov 6b65dcbcf6 [vm/kernel/bytecode] Support closures in bytecode generator
Change-Id: I038ba92c7bc210568d817ebaa109ca0ad02550e1
Reviewed-on: https://dart-review.googlesource.com/52988
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2018-05-15 16:51:06 +00:00
Martin Kustermann 9d9ce8d69a [VM] Ensure constant table is written in depth-first post-order
The addition of recently added [PartialInstantiationConstant] caused an
issue during constant table writing, becaused we the table writing code
wasn't updated.

This change uses visitChildren to guard against such changes in the
future.

Closes https://github.com/dart-lang/sdk/issues/33095

Change-Id: I3c6b19e1383c6825f11120b2d6255b8b747d0063
Reviewed-on: https://dart-review.googlesource.com/55161
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-05-15 15:17:36 +00:00
Brian Wilkerson fb2f43b175 Introduce toKernelStatement and toStatement to BodyBuilder
Change-Id: I4d3746c85370125c617cd1b331db095689ce4b5b
Reviewed-on: https://dart-review.googlesource.com/54963
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-05-15 14:33:21 +00:00
Jens Johansen fd26343f98 Fix invalidation not sticking on compile error
Before this CL, the invalidated URLs would be cleared sooner than we
threw away the old "userCode".
On a compile time error (issuing an erroneousComponent) we restore
the old userCode, thus in practical terms forgetting about whatever
had been invalidated prior to that.

This CL introduces a test and fixes the problem.

Change-Id: I8f5329c2f499ec3842d0b7d67e2eda1de1e7d938
Reviewed-on: https://dart-review.googlesource.com/52321
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2018-05-15 14:25:16 +00:00
Johnni Winther 3fc7925894 Add impact_test
Change-Id: Ic607d69375d1ad41f6aac349822e47c7dbf77b5a
Reviewed-on: https://dart-review.googlesource.com/54906
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-15 13:53:56 +00:00
Brian Wilkerson 55eba71759 Add Forest method to support the rethrow statement
Change-Id: Iffba18a8c81462373122c9204d758008448fbfed
Reviewed-on: https://dart-review.googlesource.com/55021
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-05-15 13:40:32 +00:00
Danny Tuppeny 5a3aff60b6 Update annotations to be a single region for all
Bug: https://github.com/dart-lang/sdk/issues/33033
Change-Id: I41586b53814d335046cc18c24936a3d32277deda
Reviewed-on: https://dart-review.googlesource.com/55100
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
2018-05-15 13:39:54 +00:00
Brian Wilkerson 35b14de7b8 Use Forest to build throw expressions
Change-Id: I568edd93204056298b640a09a67fe128f2e2c206
Reviewed-on: https://dart-review.googlesource.com/55022
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-05-15 13:21:53 +00:00
Martin Kustermann f2b37ab643 [VM] Add support for conditions in switch-case expressions to "constants" transformation
This seems to be the last remaining case which causes constant
evaluation in the VM in AOT mode.

Change-Id: I37dba2c634afa3bebd918ebe6dd93ff52a7708e7
Reviewed-on: https://dart-review.googlesource.com/55163
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2018-05-15 12:52:22 +00:00
Samir Jindel 39c93a2b19 Revert "Revert "[vm/kernel] Expression execution through Kernel."
This reverts commit b5154dd01e.

Original revision is in patchset 1.

Change-Id: Ic0776011c6fdbd64c025086535351474a9a88b6e
Reviewed-on: https://dart-review.googlesource.com/54407
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2018-05-15 12:03:22 +00:00
Samir Jindel 1a23ff68a5 Fix incorrect handling of NSM forwarders and pull all logic into CFE. (Take 2)
The behavioral difference is that named and optional arguments are filled in
with their default values in the `Invocation` object passed to `noSuchMethod`.

On the implementation side we make NSM forwarders concrete and fill in their
bodies in the CFE. The custom (and somewhat hacky) VM support is no longer
needed, and Dart2JS can benefit from this implementation as well.

According to discussion on #33031 we will be able to re-land this soon without
breaking Mockito.

Prior failures on precompiler bots are fixed in Patchset 2.

Change-Id: If1b7fe4cf6da5ef38f330e1ad226121bcfc958a1
Reviewed-on: https://dart-review.googlesource.com/54401
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-15 11:23:32 +00:00
Jens Johansen 9d05ada522 Renamings and updated comments in class hierarchy #2
Follow-up to https://dart-review.googlesource.com/c/sdk/+/53804.

Change-Id: I8359985f60207ef92c365c9a6e3833be181b49be
Reviewed-on: https://dart-review.googlesource.com/55162
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-05-15 10:12:32 +00:00
Jens Johansen 68f2db2f66 Renamings and updated comments in class hierarchy
Follow-up to https://dart-review.googlesource.com/c/sdk/+/53662.

Change-Id: I47923ee7e83800ac9d1f77c5f0e39d4b64bcfc7a
Reviewed-on: https://dart-review.googlesource.com/55120
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-05-15 09:15:53 +00:00
Johnni Winther 6fe26e7e55 Delete ElementVisitor, equivalence_helper and move live Elements functions
Change-Id: I0af209210d4a471ba12f939bd8e3a429dab100df
Reviewed-on: https://dart-review.googlesource.com/54913
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-15 08:37:29 +00:00
Johnni Winther 0cd377fe33 Delete ConstantCompilerBase
Change-Id: Ib2d748d380713b742110c772fac2fe7d428b7ded
Reviewed-on: https://dart-review.googlesource.com/54911
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-15 08:37:29 +00:00
Johnni Winther af37d7def3 Remove ConstantCompiler
Change-Id: I5c8681de4d5b9865da6a6fbb42900d2a7d2b21c3
Reviewed-on: https://dart-review.googlesource.com/54910
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-15 08:37:29 +00:00