This CL makes the following changes:
- Extracts the implementation of ClassElementImpl.getNamedConstructor
to a static method so that it can be re-used by
ClassElementForLink_Class.
- Adds a UnitResynthesizerMixin class so that unit resynthesis methods
can be shared between the resynthesizer and the linker.
Change-Id: I694d6fef511b5bb734ea78095834d6c68e22bf63
Reviewed-on: https://dart-review.googlesource.com/48380
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This CL fixes TFA summary collector to use right-hand side value as the
result of SuperPropertySet expression instead of result of setter invocation.
Change-Id: Ie2388387645eeec95096ab797e2718b7e031131b
Reviewed-on: https://dart-review.googlesource.com/48300
Reviewed-by: Martin Kustermann <kustermann@google.com>
Change-Id: I18f1561fcacc06937ae5719486a8dd524b1d16e7
Reviewed-on: https://dart-review.googlesource.com/48140
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
An expando is a better conceptual fit, since we are using
typesWithImplicitTypeArguments as a substitute for adding a new
property to every DartType object. Using an expando rather than an
identity set also has the advantage of interacting better with the
garbage collector, since the expando only has weak references to its
keys.
Change-Id: I39f538bd40b5ef264d637dbc8fafc11194ae27fa
Reviewed-on: https://dart-review.googlesource.com/48321
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This CL modifies class member parsing to replace one use of skipTypeReferenceOpt
and parseType with a more efficient call to computeType. In addition, it updates
computeType to detect when a builtIn is used as a type and improves recovery
of invalid operator declarations.
Change-Id: Idbe96584ef3c2e72faf91037668421bb0f1055d0
Reviewed-on: https://dart-review.googlesource.com/48221
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
I intend to re-use StaticTypeAnalyzer for performing type inference
during summary linking as part of fixing #32525. Allowing type
propagation to be disabled will allow the linker to do less work, and
avoid the need to implement the type-propagation-related element
methods in the linker's reduced element model.
There should be no functional change with this CL, since
StaticTypeAnalyzer is not used in linking yet.
Change-Id: I5f644e9869ab89dee21b03a3a54bf809926142f5
Reviewed-on: https://dart-review.googlesource.com/48082
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
I intend to fix#32525 by re-using resolver code to perform type
inference during summary linking. This will require the linker's
stripped down element model to be filled out more completely. To
avoid code duplication, I need to first refactor some of the existing
element logic so that it can be re-used by linker code.
This CL makes the following changes:
- LibraryElementImpl._unlinkedDefiningUnit is made non-private so that
the linker will be able to implement it.
- The logic for building a set of import elements from a summary is
moved to a reusable static method.
- The logic for building a set of prefix elements from import elements
is moved to a reusable static method.
- In resynthesize.dart, abstract base classes are created for
_LibraryResynthesizer, _ReferenceInfo, and _UnitResynthesizer.
- Also in resynthesize.dart, mixins are created to allow re-use of
some of the implementation logic in _LibraryResynthesizerContext and
_LibraryResynthesizer.
Change-Id: I34cde04f4aac291e216004e861d6ac354d551c1c
Reviewed-on: https://dart-review.googlesource.com/48081
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This is so we correctly answer `const bool.fromEnvironment("dart.library.js")`
as true when --categories=Server is passed to the compiler.
Change-Id: Id12a0af65905fabc23ef5a1cd3e5fd837bc8b766
Reviewed-on: https://dart-review.googlesource.com/48265
Reviewed-by: Emily Fortuna <efortuna@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
The "special case" text just says that the return type of `~/` on `int` is `int`, which is also its declared type, so the text isn't necessary.
Bug: http://dartbug/com/15650
Change-Id: Iba7fcc621e27dcba24dfdede2a0960f2f5ecd2f9
Reviewed-on: https://dart-review.googlesource.com/48144
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
This CL adds tree shaking transformation into TFA transformer, replacing
simple DropMethodBodiesVisitor. In addition to removing bodies of
unreachable members, tree shaker is able to remove unused classes, typedefs
and member declarations, and replace unreachable calls with 'throw'.
Total(CodeSize) of flutter_gallery in --release mode
before: 11,671,369
after: 11,499,694
https://github.com/dart-lang/sdk/issues/30480
Change-Id: I966cf222eb9725b7a75dd193ac479436b9b9b4c3
Reviewed-on: https://dart-review.googlesource.com/46942
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
This reverts commit f9c7a4a22d.
Reason for revert: This CL breaks the restart functionality in Flutter, when we restart we end up with an empty app.dill file (60 bytes).
Original change's description:
> Allow to output full component via computeDelta
>
> 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).
>
> Change-Id: Ia185d28da1f97b0be5dad8814cd01a8f13482724
> Reviewed-on: https://dart-review.googlesource.com/47020
> Commit-Queue: Jens Johansen <jensj@google.com>
> Reviewed-by: Peter von der Ahé <ahe@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
TBR=ahe@google.com,vegorov@google.com,jensj@google.com
Change-Id: I5ff39f9d78319413f4bbb7800e24bf27ab4ada9c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/48240
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
of the dev channel.
TBR
Change-Id: Iab49de4007a6fe677417d1b83cd48114a8d73310
Reviewed-on: https://dart-review.googlesource.com/48090
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Change-Id: Ic8172f4574a35ac31910ac0d5934c0d63db40a23
Reviewed-on: https://dart-review.googlesource.com/48060
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
This introduces a new TypeInfo.ensureType method which recovers
when a type is required but there is no type.
Change-Id: Ie9080864f814329bc7a7dcdf73440fd184e9e0f8
Reviewed-on: https://dart-review.googlesource.com/47944
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
The http_server in the test.py scripts uses package_resolver, which
uses 10 packages from third_party/pkg and third_party/pkg_tested.
Change-Id: I1e9ca660b9bd0a6270bcc8e4121da6a3bf9713bd
Reviewed-on: https://dart-review.googlesource.com/47781
Commit-Queue: William Hesse <whesse@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
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).
Change-Id: Ia185d28da1f97b0be5dad8814cd01a8f13482724
Reviewed-on: https://dart-review.googlesource.com/47020
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Change-Id: I22cf843faf886ae877b351017a7a8e5ab25f7f0a
Reviewed-on: https://dart-review.googlesource.com/47881
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
- and readability of error case output of equivalence tests.
Change-Id: I7883544e9d9064db1a30ecd8923de0e80c031567
Reviewed-on: https://dart-review.googlesource.com/47224
Reviewed-by: Sigmund Cherem <sigmund@google.com>