Commit graph

20080 commits

Author SHA1 Message Date
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
Johnni Winther f493274ce8 Delete more parts of resolution
Change-Id: I1c9ab31efa7c4a97f283275d5122c7b9a8762fb8
Reviewed-on: https://dart-review.googlesource.com/54908
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-15 08:37:29 +00:00
Johnni Winther 330271ed2b Delete modelx
Change-Id: I8f69655ee251cef097b46d80ddfbb7d2434b1051
Reviewed-on: https://dart-review.googlesource.com/54903
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-15 08:37:29 +00:00
Johnni Winther 351b90cb59 Delete NativeDataResolver
Change-Id: I91d2e1cb8d03bb1d0da7e175c810fa3cf3216962
Reviewed-on: https://dart-review.googlesource.com/54901
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-15 08:37:29 +00:00
Johnni Winther a86621318d Delete CompileTimeConstantEvaluator
Change-Id: I025566965d992829e93e84912d68317f145d96b2
Reviewed-on: https://dart-review.googlesource.com/54885
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-15 08:37:29 +00:00
Johnni Winther 76ab610097 Remove parser listeners and partial elements
Change-Id: Ifb5fffdca3a0e4f2bca7c35ae3c1a99490978ebf
Reviewed-on: https://dart-review.googlesource.com/54882
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-15 08:37:29 +00:00
Johnni Winther aeaa3b05c4 Remove more parts of resolution
Change-Id: Ic32851c32f4119b9682bb8538cfd7aa745ca7f09
Reviewed-on: https://dart-review.googlesource.com/54880
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-15 08:37:29 +00:00
Johnni Winther 4d76600b22 Delete SemanticSendVisitor
Change-Id: I0ccf8527e973dc5cfeac19caaaac026f91795e17
Reviewed-on: https://dart-review.googlesource.com/54860
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2018-05-15 08:37:29 +00:00
Johnni Winther 049d41ee36 Delete AST-based SSA builder
Change-Id: I16aa702eae335a01163a3b79d36bf4e60561756e
Reviewed-on: https://dart-review.googlesource.com/54841
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-15 08:37:29 +00:00
Johnni Winther 4fbd22c9e2 Remove AST-based inference
Change-Id: I368630e15d08ecbc0fdee288985746f90477159b
Reviewed-on: https://dart-review.googlesource.com/54822
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-05-15 08:37:29 +00:00
Peter von der Ahé 013bc60b22 Make most fields in Generators final
Change-Id: I3cd1d3c88c0572874b3fbfb4c1862898ce8037a4
Reviewed-on: https://dart-review.googlesource.com/55103
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-15 08:07:08 +00:00
Peter von der Ahé 6b9754d9b5 Convert SuperPropertyAccessor to SuperPropertyAccessGenerator
Change-Id: I9252da81d07b948b16ce0da4a0e989b63df996e5
Reviewed-on: https://dart-review.googlesource.com/55102
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-15 07:57:28 +00:00
Peter von der Ahé 60c825e1be Convert NullAwarePropertyAccessor to NullAwarePropertyAccessGenerator
Change-Id: I55a656f153cd6226f55fad47e952b065928754fb
Reviewed-on: https://dart-review.googlesource.com/54915
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-15 07:42:09 +00:00
Peter von der Ahé 5e4776eab9 Convert ThisPropertyAccessor to ThisPropertyAccessGenerator
Change-Id: Ib3a729db7b87192d47fb909d36aa1eff88fff29b
Reviewed-on: https://dart-review.googlesource.com/54914
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-15 07:39:57 +00:00
Peter von der Ahé 43ab0e51db Add Generator as shared base class for converted generators
Change-Id: I739f883e90c0e902b461e40f83aa478f67d593fd
Reviewed-on: https://dart-review.googlesource.com/54909
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-05-15 07:39:57 +00:00
Jens Johansen f08f61e84d Incremental ClassHierarchy
This CL turns the ClassHierarchy incremental and use that in two places:

* When compiling incrementally
* When performing the second ClassHierarchy computation after adding
  forwarding stubs.

Change-Id: I7046d6be9d7673dc0783a98789b5a25183b44799
Reviewed-on: https://dart-review.googlesource.com/53804
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2018-05-15 07:37:09 +00:00
Jenny Messerly 29afbf8f12 Implement constant evaluation for dartdevk
This builds on the VM's support for constants, and brings dartdevk to
parity with dartdevc. Also, constants are computed with arithmetic
operations that match runtime behavior (JS numbers).

Constants are limited in some cases right now: when building outline
kernel files (via pkg/dev_compiler/tool/build_pkgs.dart), constant field
initializers are not preserved, and this fact is not recorded, making
these fields appear to be implicitly null. dartdevk will recognize this
and avoid inlining the constant in these cases.

Change-Id: I5e6d95ccc32799da3bec1667ed16078a1a87d0bd
Reviewed-on: https://dart-review.googlesource.com/53121
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
2018-05-15 06:04:18 +00:00
Alexander Markov 344c68e54c [kernel, vm] Revise how metadata is written in kernel binaries
Metadata is no longer written ahead of all nodes. Instead, metadata for
each node is written in the same context as the node itself (into a separate
buffer). This allows metadata to contain (serialize) arbitrary nodes
(for example, arbitrary DartTypes) and use serialization context of parent
nodes (such as declared type parameters).

However, with this change metadata looses the ability to reference
arbitrary AST nodes. This ability was overly restricted and had no
practical uses. (It was not possible to reference nodes which are not
reachable from root Component. As a consequence, it was not possible to
write references to arbitrary DartTypes.)

This change aligns the serialization capabilities of metadata with
how kernel AST nodes are serialized.

Change-Id: I027299a33b599b62572eccd4aa7083ad1dd2b3b3
Reviewed-on: https://dart-review.googlesource.com/54481
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-05-15 00:41:08 +00:00
Stephen Adams 65c4eebcf6 [dart2js] $async$self does not require a temp
Change-Id: Ief44aa36b67928cf33176410ebf1dfd5c794b024
Reviewed-on: https://dart-review.googlesource.com/55040
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2018-05-15 00:29:48 +00:00
Sigmund Cherem a06f7c9241 Remove dart:_isolate_helper.
The rest of the code was used in a single place, so I've moved the code to the
appropriate library.

Change-Id: Idd0416bf7365e3de05f20ab1184428ae7ae614b2
Reviewed-on: https://dart-review.googlesource.com/54745
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-05-15 00:21:28 +00:00
Ben Konyi 4f549e2900 Revert "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 ba342a94ec.

Reason for revert: Bots are red.

Original change's description:
> Fix issues with FileSystemEntities which have non-UTF8 paths causing exceptions to be thrown when converting to/from a Dart VM String.
> 
> Continuation of PR #32583 by powdercloud
> 
> Fixes #29451
> 
> Change-Id: I4bdf24f9c8ead425a4f0cad33b642908f1ec203d
> Reviewed-on: https://dart-review.googlesource.com/51580
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Zach Anderson <zra@google.com>

TBR=bkonyi@google.com,rmacnak@google.com,zra@google.com,tvolkert@google.com

Change-Id: I12850f178a13a75289d18af4e565bd73c59b14ad
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/55060
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2018-05-14 23:40:29 +00:00
Ben Konyi ba342a94ec Fix issues with FileSystemEntities which have non-UTF8 paths causing exceptions to be thrown when converting to/from a Dart VM String.
Continuation of PR #32583 by powdercloud

Fixes #29451

Change-Id: I4bdf24f9c8ead425a4f0cad33b642908f1ec203d
Reviewed-on: https://dart-review.googlesource.com/51580
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2018-05-14 23:06:57 +00:00
Alexander Markov 7e4cec8a49 [vm/kernel/aot] Fix handling of type parameters and annotations on typedefs in TFA tree shaker
Closes https://github.com/dart-lang/sdk/issues/33109

Change-Id: I84204373010ebfdd7d774c8bb29c743d056dc24e
Reviewed-on: https://dart-review.googlesource.com/54981
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-05-14 23:04:48 +00:00
Brian Wilkerson cbb2403f5d More improvements to the test framework
Change-Id: I57827bd7f6a0b7873bba87e99b7043efb96ddd0c
Reviewed-on: https://dart-review.googlesource.com/54982
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-05-14 21:47:47 +00:00
Sigmund Cherem be77569d57 Remove old mirrors library now that the old-frontend is being deleted
Change-Id: Iea1cbb0c4422fa51e632ac03c9cd01e4916181fc
Reviewed-on: https://dart-review.googlesource.com/54744
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2018-05-14 21:38:07 +00:00
Janice Collins e6d9ed5688 Restrict analyzer/front_end/kernel SDK versions to dev.48+.
Change-Id: If341e8aa3503881bb44e445c39e5f821fd213bfd
Reviewed-on: https://dart-review.googlesource.com/55000
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Janice Collins <jcollins@google.com>
2018-05-14 19:32:45 +00:00
Brian Wilkerson 7328988ad0 Remove some dead code from analysis_server
Change-Id: I6407d800bca7f81e6bcf0fb1e0765e24fe310956
Reviewed-on: https://dart-review.googlesource.com/54980
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-05-14 18:57:17 +00:00
Brian Wilkerson d30a05711f Fix the parsing of literal symbols
Change-Id: I237871ee1c44d2819afbbee583ddd7e14b1ef043
Reviewed-on: https://dart-review.googlesource.com/54801
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
2018-05-14 18:23:27 +00:00
Konstantin Shcheglov d48aa1b0c7 Issue 2244. Add 'Import Library' quick fix for (potential) implicit constructor invocations.
R=brianwilkerson@google.com

Bug: https://github.com/flutter/flutter-intellij/issues/2244
Change-Id: I464b3bc872dc6df46197761c8f619cd69f194566
Reviewed-on: https://dart-review.googlesource.com/54962
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-05-14 18:17:08 +00:00
Harry Terkelsen fe51bb1b14 Don't eagerly enqueue JS helpers when we see a native class
We no longer eagerly enqueue defineProperty, toStringForNativeObject,
or hashCodeForNativeObject. We only enqueue convertDartClosureToJS
when needed.

For the following 'Hello World' program, code size dropped from 33175 to 10066:

```
import 'dart:html';

main() {
  window.console.log('Hello World');
}
```

Change-Id: I47860b44b572f7a162fc95c9cccefdc9012810dd
Reviewed-on: https://dart-review.googlesource.com/54500
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Harry Terkelsen <het@google.com>
2018-05-14 18:11:09 +00:00