Clement Skau
7f0bd5e811
[VM] Removes _Future's and _StreamImpl's _awaiter.
...
Changes debugger.cc to use the 'lazy async stack' mechanism for
unwinding async stacks, which means we no longer have to manually
keep track of the caller.
This also allows us to get rid of _asyncStarListenHelper.
Bug: https://github.com/dart-lang/sdk/issues/42457
Change-Id: I536e9da4af275998140ae5f05e3a43e07c77cfc7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167561
Commit-Queue: Clement Skau <cskau@google.com >
Reviewed-by: Martin Kustermann <kustermann@google.com >
2020-10-21 12:38:23 +00:00
Johnni Winther
8b07d1902c
[kernel] Remove DirectPropertyGet/DirectPropertySet/DirectMethodInvocation
...
These nodes are no longer used.
Change-Id: I40c8df7376f0c40a4122c22d934fb3c6f6fd520d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165902
Reviewed-by: Alexander Markov <alexmarkov@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2020-10-03 19:15:41 +00:00
Johnni Winther
6753c930c9
[kernel] Remove unused super call resolution transformation
...
Change-Id: Iacaadcae823eda57f85d3fcc42debab916924eda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165900
Reviewed-by: Alexander Markov <alexmarkov@google.com >
2020-10-03 19:15:41 +00:00
Jens Johansen
fc7de901ee
[kernel] Make LogicalExpression operator an enum (and rename)
...
Change-Id: I6054e8e44133d2419582d74700c4223d51495978
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165606
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Jens Johansen <jensj@google.com >
2020-10-02 09:41:12 +00:00
jlcontreras
8e283cb8c8
[cfe] Implements addToString to value class transformations
...
Change-Id: I431f72a103142788f886bce03f59320a67cd7d71
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164961
Commit-Queue: Javier López-Contreras <jlcontreras@google.com >
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
2020-10-01 16:00:48 +00:00
Johnni Winther
4025dee2f8
[cfe] Ensure that default values on synthesized constructor are included in outlines
...
Closes #43538
Change-Id: I58f03d6d71e6de4744003cc28519a20c7e9e7f12
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/164787
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2020-09-29 11:09:14 +00:00
jlcontreras
75ffae6a5c
[cfe] Implements recursiveScanner to solve copyWith ambiguities
...
Change-Id: I087e12702d8164ad0a7383bb5b0665d58a516f7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162743
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
Commit-Queue: Javier López-Contreras <jlcontreras@google.com >
2020-09-24 17:32:57 +00:00
Johnni Winther
f4501b6e83
Reland "[kernel] Rename Name.name to Name.text"
...
Including a deprecated getter to avoid breaking dependent code outside
the Dart repo.
Change-Id: I365957b7c2da6e0cb5c71eb8d2906b0dc6ff18ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163062
Reviewed-by: Jens Johansen <jensj@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2020-09-17 06:10:49 +00:00
Johnni Winther
b3bd2e95e7
[cfe] Fix git access in presubmit script on Windows
...
Change-Id: I6c871264dc1fff39b19421ce1f5513eb2e56901d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163061
Reviewed-by: Jens Johansen <jensj@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2020-09-16 14:17:18 +00:00
Johnni Winther
644df9b9fb
Revert "Reland: [kernel] Rename Name.name to Name.text"
...
This reverts commit c430a0ac0b .
Reason for revert: Will break flutter_frontend_server when rolled into google3
Original change's description:
> Reland: [kernel] Rename Name.name to Name.text
>
> Change-Id: I5240b0ff09faf35184998920202d7600dc97766d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162746
> Reviewed-by: Johnni Winther <johnniwinther@google.com >
> Commit-Queue: Johnni Winther <johnniwinther@google.com >
TBR=jensj@google.com ,johnniwinther@google.com
Change-Id: Ib6961f49dd416171c5d5935c490d79d6f7be779e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162748
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2020-09-16 08:22:55 +00:00
Johnni Winther
c430a0ac0b
Reland: [kernel] Rename Name.name to Name.text
...
Change-Id: I5240b0ff09faf35184998920202d7600dc97766d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162746
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2020-09-16 07:42:42 +00:00
Daco Harkes
7302e01a79
Revert "[kernel] Rename Name.name to Name.text"
...
This reverts commit 3ff8dd2f51 .
Reason for revert: Fails all CI builders. Possibly something landed
in the mean time.
Original change's description:
> [kernel] Rename Name.name to Name.text
>
> Change-Id: I93162fb387ba123b949e19a7829bd5614845b15d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162722
> Reviewed-by: Jens Johansen <jensj@google.com >
> Commit-Queue: Johnni Winther <johnniwinther@google.com >
TBR=jensj@google.com ,johnniwinther@google.com
Change-Id: I2ffe526dabf37ae09d5e4ab1fbe514925f6e8768
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162744
Reviewed-by: Daco Harkes <dacoharkes@google.com >
Commit-Queue: Daco Harkes <dacoharkes@google.com >
2020-09-15 15:21:35 +00:00
Johnni Winther
3ff8dd2f51
[kernel] Rename Name.name to Name.text
...
Change-Id: I93162fb387ba123b949e19a7829bd5614845b15d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162722
Reviewed-by: Jens Johansen <jensj@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2020-09-15 14:27:22 +00:00
jlcontreras
291b2dffc0
[cfe] Implements copyWith in valueClass transformation
...
Change-Id: I37d32c23176a9324c313031fcb283f6ab7250944
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162703
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
Commit-Queue: Javier López-Contreras <jlcontreras@google.com >
2020-09-14 13:11:58 +00:00
jlcontreras
da6cdc55b4
[cfe] Implement addHashCode to valueClass transformation
...
Change-Id: Ie566cee214b63f986e07c84e4ae28bfecc80e0a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162186
Commit-Queue: Javier López-Contreras <jlcontreras@google.com >
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
2020-09-11 16:05:52 +00:00
Johnni Winther
8008c8d54e
[cfe] Make widget transform location field nullable
...
The widget transformer doesn't handle widgets with optional positional
parameters and therefore doesn't provide locations in these cases.
For this reason we leave the location field nullable and don't null check
it on construction.
Close #43371
Change-Id: I2595eb215e8fab477ab0819b70e25d9fb921ed01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162187
Reviewed-by: Jens Johansen <jensj@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2020-09-10 11:30:15 +00:00
jlcontreras
69b194e88f
[cfe] Implements ValueClassScanner
...
Change-Id: I36b839280513a75d92797d5999ecb567e6999a5c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162180
Commit-Queue: Javier López-Contreras <jlcontreras@google.com >
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
2020-09-09 14:10:08 +00:00
jlcontreras
173a958d37
[cfe] Implement addEqualsOperator in value class transformation
...
Change-Id: I07afadfe9d23f792edb61681e794faa4de6aebb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161506
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
Commit-Queue: Javier López-Contreras <jlcontreras@google.com >
2020-09-08 18:30:55 +00:00
Clement Skau
90652bc314
[VM] Fixes nested sync* w. diff. types.
...
Makes the synthetic sync* iterator dynamic to allow the internal,
synthetic sync* code to handle nested iterators of differing types.
Bug: https://github.com/dart-lang/sdk/issues/42234
Change-Id: I309885b27555142cd7f8ab13a5637b35545f1d44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160071
Reviewed-by: Martin Kustermann <kustermann@google.com >
Commit-Queue: Clement Skau <cskau@google.com >
2020-09-03 11:48:44 +00:00
jlcontreras
70fd140a9d
[cfe] Implements addConstructor of value class transformation
...
Change-Id: I991c82693a6a3a44061efa7703fa89bd94f858b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158280
Commit-Queue: Javier López-Contreras <jlcontreras@google.com >
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
2020-08-31 13:24:38 +00:00
Clement Skau
4db081545e
Revert "[VM] Fixes yield* exception handling in sync*."
...
This reverts commit 358aee331b .
Reason for revert: Appears to break service/async_generator_breakpoint_test
Original change's description:
> [VM] Fixes yield* exception handling in sync*.
>
> This adds a mechanism similar to that used in async functions where
> exceptions are caught in the synthetic code and passed into the
> generated body to be rethrow'n.
> This ensures the exception is throw'n from the same place as the
> original yield*, as per the spec.
>
> Bug: https://github.com/dart-lang/sdk/issues/42466
> Change-Id: I553dd89141985f6f30751913a1c8a62b1229af04
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158543
> Commit-Queue: Clement Skau <cskau@google.com >
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com >
TBR=vegorov@google.com ,cskau@google.com
Change-Id: I9df83543d41d4260e91e4a7fb8df7c2762b92429
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/42466
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160101
Reviewed-by: Clement Skau <cskau@google.com >
Commit-Queue: Clement Skau <cskau@google.com >
2020-08-25 14:08:42 +00:00
Clement Skau
358aee331b
[VM] Fixes yield* exception handling in sync*.
...
This adds a mechanism similar to that used in async functions where
exceptions are caught in the synthetic code and passed into the
generated body to be rethrow'n.
This ensures the exception is throw'n from the same place as the
original yield*, as per the spec.
Bug: https://github.com/dart-lang/sdk/issues/42466
Change-Id: I553dd89141985f6f30751913a1c8a62b1229af04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158543
Commit-Queue: Clement Skau <cskau@google.com >
Reviewed-by: Vyacheslav Egorov <vegorov@google.com >
2020-08-25 12:40:49 +00:00
Johnni Winther
f8e7e64fd6
[cfe] Handle constant constructor invocations in Widget factory constructors
...
The widget transformer would try to pass on the location injected
parameter in the factory constructor when calling constructors of its
own kind in constructor body. For instance
class Foo extends Widget {
factory Foo() => new Foo.internal();
Foo.internal();
}
would be transformed into
class Foo extends Widget {
factory Foo({Location loc}) => new Foo.internal(loc: loc);
Foo.internal({Location loc}) : super(loc);
}
This doesn't work if the constructor invocation is constant. For
instance:
class Foo extends Widget {
factory Foo() => const Foo.internal();
const Foo.internal();
}
which would be transformed into
class Foo extends Widget {
factory Foo({Location loc}) => const Foo.internal(loc: loc);
const Foo.internal({Location loc}) : super(loc);
}
Here the reading of the injected factory parameter [loc] is not a
valid constant, leading to a compile-time error during constant
evaluation.
To handle this, const constructor invocations within factories do
not pass on the location from the surrounding constructor but
uses their own. For instance:
class Foo extends Widget {
factory Foo() => const Foo.internal();
Foo.internal();
}
will be transformed into
class Foo extends Widget {
factory Foo({Location loc})
=> const Foo.internal(loc: const Location());
Foo.internal({Location loc}) : super(loc);
}
This does mean that these constant widgets will all have a
location based on the factory constructor declaration and _not_
one per invocation of the factory constructor.
Related to https://github.com/flutter/flutter/issues/63335
Change-Id: Ie3300d3ba81324d5fbd7fb6ab72b9d83d7afcf22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158395
Reviewed-by: Jens Johansen <jensj@google.com >
2020-08-14 10:15:12 +00:00
jlcontreras
0f0e04ec3a
Add empty value class transformer.
...
Change-Id: I8e532c1699785ed75c7eff7a3187a4ca3a2032e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156880
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
Commit-Queue: Javier López-Contreras <jlcontreras@google.com >
2020-08-03 14:14:42 +00:00
Mayank Patke
ca743398c2
Ensure CFE provides correct setter name to instantiateInvocation.
...
All of the backends (dart2js, DDC, VM) were checking if the invocation
name was tagged with "set:" and appending "=" to the name if so.
Instead, we can simply have the CFE perform this logic at the callsite.
Note that the name of the setter itself is still unchanged. Backends may
still need to generate the correct name themselves when handling NSMs
via code paths other than instantiateInvocation.
Change-Id: Iae42c849d3557be3e3b77c3af6f3993347ba0b6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156142
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Mayank Patke <fishythefish@google.com >
2020-07-30 06:21:20 +00:00
jlcontreras
96a25bdfa1
Fix a typo in the comment on a transformer.
...
Change-Id: I9d34f5d3bfbeb75b0b5f122ef334b9b0b629aace
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154882
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
Commit-Queue: Javier López-Contreras <jlcontreras@google.com >
2020-07-20 10:50:24 +00:00
Johnni Winther
ab958bee57
[cfe,flutter] Make widget transformer location parameters optional
...
The location parameters added to Widgets was created as required
and non-nullable when opting flutter in to null-safety. This leads
to incremental compilation failing because already transformed
constructors require parameters that cannot be passed by user code.
Fixes https://github.com/flutter/flutter/issues/60269
Change-Id: I91cbeaa455e67e82983ebb17f93da13b46376da2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153085
Reviewed-by: Jens Johansen <jensj@google.com >
Reviewed-by: Jacob Richman <jacobr@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2020-07-16 06:12:13 +00:00
Dmitry Stefantsov
929d5e4a98
[cfe,ddc,dart2js,vm] Add FutureOrType
...
This CL is the sum of the following 5 CLs:
* https://dart-review.googlesource.com/c/sdk/+/149297/
* https://dart-review.googlesource.com/c/sdk/+/149299/
* https://dart-review.googlesource.com/c/sdk/+/149320/
* https://dart-review.googlesource.com/c/sdk/+/149321/
* https://dart-review.googlesource.com/c/sdk/+/149323/
The reason for landing the 5 CLs as one CL is to prevent potential
troubles with bisecting over the branch because the change is fully
functional only with all 5 CLs.
Closes #40123 .
Bug: https://github.com/dart-lang/sdk/issues/40123
Change-Id: Ice52250a98acfe455b1d7fa5bb0624c115ca5dac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150934
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com >
Reviewed-by: Alexander Markov <alexmarkov@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2020-06-15 12:18:46 +00:00
Alexander Markov
cbb5305f78
[vm/nnbd] Optimize type casts
...
Add a kernel transformation which removes redundant casts and reduces
some casts to null checks. This transformation assumes that type
system is sound and subtyping relation is transitive. So in NNBD weak
mode this transformation is always correct. In NNBD strong mode
this transformation is correct only if opted-out libraries are not
allowed.
The following patterns are handled:
If S <: T (this includes S <: T? in weak mode)
S x; x as T => x
If S <: T? in strong mode
S x; x as T => (x == null) ? x as T : x
This kernel transformation is not specific to the VM and can be reused
by other back-ends such as dart2js and DDC.
Fixes https://github.com/dart-lang/sdk/issues/40892
Issue https://github.com/dart-lang/sdk/issues/40893
Change-Id: I466ba96d763d5358011c768400c5225fa7bf5e67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139314
Commit-Queue: Alexander Markov <alexmarkov@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Martin Kustermann <kustermann@google.com >
Reviewed-by: Sigmund Cherem <sigmund@google.com >
2020-05-19 02:35:12 +00:00
Jens Johansen
6fb1efd584
[flutter/vm] Update dartdoc for WidgetCreatorTracker.transform
...
Change-Id: I6afbc4cc5f975052c9dd05e4befea572e8a91505
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148400
Commit-Queue: Jens Johansen <jensj@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2020-05-18 10:35:07 +00:00
Jens Johansen
7929b4223e
[CFE] Fix memory leak via WidgetCreatorTracker
...
Change-Id: Iebb961955bcd6cf2513cdec6036dfbd126e45231
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148240
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Jens Johansen <jensj@google.com >
2020-05-15 14:09:02 +00:00
Johnni Winther
d5650235a2
[cfe] Handle ProblemBuilder in binary expression
...
Closes #41787
Change-Id: I81fcf0aee975b58b3b44d0de94054ae87bdd265d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147140
Reviewed-by: Jens Johansen <jensj@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2020-05-12 11:44:19 +00:00
Clement Skau
2359f4dc68
[VM] Reworked: Remove unnecessary Closure.clone() from sync*.
...
Removes the Closure.clone() in sync* by adding an additional closure
around the rewritten sync* function body.
This is a re-worked version of the now reverted:
- https://dart-review.googlesource.com/c/sdk/+/136190
- https://dart-review.googlesource.com/c/sdk/+/144948
This CL includes changes from both the above CLs, in addition to:
- A new 'ShadowRewriter' transformer to do deep rewriting of
shadowed parameters.
Previous versions only rewrote the immediate sync* function, missing
references in nested rewritten functions.
Note: This CL is re-landing largely unchanged since the roll-blocking
issues suspected to be caused by this was later attributed to a
different set of changes.
I have independently re-run all failing external tests to verify
them passing for this CL.
Bug: https://github.com/dart-lang/sdk/issues/37753
Change-Id: Id1670a93961180e8558d7c7eca65fe7e9115f07b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145402
Commit-Queue: Clement Skau <cskau@google.com >
Reviewed-by: Vyacheslav Egorov <vegorov@google.com >
2020-05-05 12:04:03 +00:00
Clement Skau
12a5c93d4a
Revert "Reland "[VM] Remove unnecessary Closure.clone() from sync*.""
...
This reverts commit 1bf25798fa .
Reason for revert: Rolling back as it breaks more external targets and is currently blocking rolls.
Original change's description:
> Reland "[VM] Remove unnecessary Closure.clone() from sync*."
>
> This reverts commit 430c75b5fa .
>
> Reason for revert: We probably don't care about the dartkb breakages.
>
> Original change's description:
> > Revert "[VM] Remove unnecessary Closure.clone() from sync*."
> >
> > This reverts commit ca94ad7112 .
> >
> > Reason for revert: Appears to break dartkb.
> >
> > Original change's description:
> > > [VM] Remove unnecessary Closure.clone() from sync*.
> > >
> > > Instead, this CL wraps sync*'s sync_op in an additional function
> > > that captures local copies of the necessary closure state.
> > > Notably this state includes the parameters of the original sync* function
> > > as these also need to be cloned for each instance.
> > >
> > >
> > > Note: a large number of .expect files have a small number of changes
> > > due to the additional wrapper function, as well as some extra plumbing.
> > >
> > > Bug: https://github.com/dart-lang/sdk/issues/37753
> > > Change-Id: If099dbfe9e5d62979626b852386fd0173fc76de5
> > > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136190
> > > Commit-Queue: Clement Skau <cskau@google.com >
> > > Reviewed-by: Vyacheslav Egorov <vegorov@google.com >
> >
> > TBR=vegorov@google.com ,cskau@google.com
> >
> > Change-Id: I89e517196f03622337f909f0fcecbdc77c9dda93
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: https://github.com/dart-lang/sdk/issues/37753
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144920
> > Reviewed-by: Clement Skau <cskau@google.com >
> > Commit-Queue: Clement Skau <cskau@google.com >
>
> TBR=vegorov@google.com ,cskau@google.com
>
> Change-Id: I78589c83cbb17151ca4ab8f811b4f18f252fb9c1
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: https://github.com/dart-lang/sdk/issues/37753
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144921
> Reviewed-by: Clement Skau <cskau@google.com >
> Commit-Queue: Clement Skau <cskau@google.com >
TBR=vegorov@google.com ,cskau@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: https://github.com/dart-lang/sdk/issues/37753
Change-Id: I879df17bd282d01468fa010b94a8c89afdb8cd0d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145361
Reviewed-by: Clement Skau <cskau@google.com >
Reviewed-by: Martin Kustermann <kustermann@google.com >
Commit-Queue: Clement Skau <cskau@google.com >
2020-04-29 09:52:30 +00:00
Clement Skau
871983d8ae
Revert "[VM] Fixes missing bits for new sync* transform."
...
This reverts commit 05b7f49c72 .
Reason for revert: This appears to break other external targets. Rolling this and original CL back to unblock rolls until deeper investigation can be done.
Original change's description:
> [VM] Fixes missing bits for new sync* transform.
>
> The missing part of the transform fixes an issue that manifested
> as a crash when running tests for [0].
> Which was caused by un-transformed yields in nested functions in sync*s.
>
> The second half of this CL updates the type_checker tool for the new
> transform of sync*s.
>
> [0] https://github.com/KhronosGroup/glTF-Validator
>
> TBR: To unblock roll blocked by crash.
>
> Bug: https://github.com/dart-lang/sdk/issues/37753
> Change-Id: Ie20f351b16f2f87e92f0731fc96b0a5ea29e0300
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144948
> Commit-Queue: Clement Skau <cskau@google.com >
> Reviewed-by: Clement Skau <cskau@google.com >
TBR=kustermann@google.com ,cskau@google.com
Change-Id: Ided526100e7393375445545d0fe16806333b0d20
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/37753
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145360
Reviewed-by: Clement Skau <cskau@google.com >
Commit-Queue: Clement Skau <cskau@google.com >
2020-04-29 08:35:52 +00:00
Clement Skau
05b7f49c72
[VM] Fixes missing bits for new sync* transform.
...
The missing part of the transform fixes an issue that manifested
as a crash when running tests for [0].
Which was caused by un-transformed yields in nested functions in sync*s.
The second half of this CL updates the type_checker tool for the new
transform of sync*s.
[0] https://github.com/KhronosGroup/glTF-Validator
TBR: To unblock roll blocked by crash.
Bug: https://github.com/dart-lang/sdk/issues/37753
Change-Id: Ie20f351b16f2f87e92f0731fc96b0a5ea29e0300
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144948
Commit-Queue: Clement Skau <cskau@google.com >
Reviewed-by: Clement Skau <cskau@google.com >
2020-04-29 06:56:14 +00:00
Clement Skau
1bf25798fa
Reland "[VM] Remove unnecessary Closure.clone() from sync*."
...
This reverts commit 430c75b5fa .
Reason for revert: We probably don't care about the dartkb breakages.
Original change's description:
> Revert "[VM] Remove unnecessary Closure.clone() from sync*."
>
> This reverts commit ca94ad7112 .
>
> Reason for revert: Appears to break dartkb.
>
> Original change's description:
> > [VM] Remove unnecessary Closure.clone() from sync*.
> >
> > Instead, this CL wraps sync*'s sync_op in an additional function
> > that captures local copies of the necessary closure state.
> > Notably this state includes the parameters of the original sync* function
> > as these also need to be cloned for each instance.
> >
> >
> > Note: a large number of .expect files have a small number of changes
> > due to the additional wrapper function, as well as some extra plumbing.
> >
> > Bug: https://github.com/dart-lang/sdk/issues/37753
> > Change-Id: If099dbfe9e5d62979626b852386fd0173fc76de5
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136190
> > Commit-Queue: Clement Skau <cskau@google.com >
> > Reviewed-by: Vyacheslav Egorov <vegorov@google.com >
>
> TBR=vegorov@google.com ,cskau@google.com
>
> Change-Id: I89e517196f03622337f909f0fcecbdc77c9dda93
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: https://github.com/dart-lang/sdk/issues/37753
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144920
> Reviewed-by: Clement Skau <cskau@google.com >
> Commit-Queue: Clement Skau <cskau@google.com >
TBR=vegorov@google.com ,cskau@google.com
Change-Id: I78589c83cbb17151ca4ab8f811b4f18f252fb9c1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/37753
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144921
Reviewed-by: Clement Skau <cskau@google.com >
Commit-Queue: Clement Skau <cskau@google.com >
2020-04-28 06:17:20 +00:00
Clement Skau
430c75b5fa
Revert "[VM] Remove unnecessary Closure.clone() from sync*."
...
This reverts commit ca94ad7112 .
Reason for revert: Appears to break dartkb.
Original change's description:
> [VM] Remove unnecessary Closure.clone() from sync*.
>
> Instead, this CL wraps sync*'s sync_op in an additional function
> that captures local copies of the necessary closure state.
> Notably this state includes the parameters of the original sync* function
> as these also need to be cloned for each instance.
>
>
> Note: a large number of .expect files have a small number of changes
> due to the additional wrapper function, as well as some extra plumbing.
>
> Bug: https://github.com/dart-lang/sdk/issues/37753
> Change-Id: If099dbfe9e5d62979626b852386fd0173fc76de5
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136190
> Commit-Queue: Clement Skau <cskau@google.com >
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com >
TBR=vegorov@google.com ,cskau@google.com
Change-Id: I89e517196f03622337f909f0fcecbdc77c9dda93
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/37753
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144920
Reviewed-by: Clement Skau <cskau@google.com >
Commit-Queue: Clement Skau <cskau@google.com >
2020-04-27 07:45:04 +00:00
Clement Skau
ca94ad7112
[VM] Remove unnecessary Closure.clone() from sync*.
...
Instead, this CL wraps sync*'s sync_op in an additional function
that captures local copies of the necessary closure state.
Notably this state includes the parameters of the original sync* function
as these also need to be cloned for each instance.
Note: a large number of .expect files have a small number of changes
due to the additional wrapper function, as well as some extra plumbing.
Bug: https://github.com/dart-lang/sdk/issues/37753
Change-Id: If099dbfe9e5d62979626b852386fd0173fc76de5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136190
Commit-Queue: Clement Skau <cskau@google.com >
Reviewed-by: Vyacheslav Egorov <vegorov@google.com >
2020-04-27 07:37:39 +00:00
Johnni Winther
6c21ed6314
[cfe] Support class hierarchy changes in ChangedStructureNotifier
...
Closes #40707
Change-Id: I0a9e0b11d0f597dfed7182dd869382057d04e5dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144821
Reviewed-by: Jens Johansen <jensj@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2020-04-26 19:51:29 +00:00
Martin Kustermann
e2b6cc93b6
[vm/async] Update async transformation to take NNBD mode into account
...
The removal of unsafeCast causes flutter galley size regressions:
- armv7: -0.43%
- armv8: -0.21%
which we should look into recovering by having better inlining heuristics.
Issue https://github.com/dart-lang/sdk/issues/41373
Closes https://github.com/dart-lang/sdk/issues/41307
Change-Id: I7c0ba4c9598e13f01e807a607c83d50cf03e9abe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142501
Commit-Queue: Martin Kustermann <kustermann@google.com >
Reviewed-by: Alexander Markov <alexmarkov@google.com >
2020-04-11 08:56:52 +00:00
Martin Kustermann
c4a7c3488e
[vm/async] Make async transformer use typed variables, make async patch use function types
...
This gets rid of a slow AssertAssignable (function type test)
in _asyncThenWrapperHelper/_awaitHelper, which currently falls back to the slow table
search:
AssertAssignable
^--> TypeTestingStub
^--> SlowTypeTestStub
^--> Subtype6TestCacheStub
Issue https://github.com/dart-lang/sdk/issues/37668
Change-Id: I3b6517b7e348e39619e8096d6ac2a4b179bb3242
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142022
Commit-Queue: Martin Kustermann <kustermann@google.com >
Reviewed-by: Alexander Markov <alexmarkov@google.com >
Reviewed-by: Clement Skau <cskau@google.com >
2020-04-03 08:28:47 +00:00
Clement Skau
b681bfd8d2
[VM] Fixes bad reuse/typing of temps in async transform invocations.
...
For a method invocation temps might get allocated for both the receiver
and argument(s) so that:
A().foo(await null)
becomes:
Future<void> tmp0
...
tmp0 = A() // <- Type mismatch.
yield ...
tmp0 = tmp0.foo(:result) // <- Correct type.
This happens because the liveness analysis finds that the (previously
dynamic) temps can be reused.
Unfortunately 121988 added typing information to these temps, which
means they can't be simply reused in all cases.
This fix makes the temps dynamic again (by removing the type) but adds
unsafecasts to all VariableGets to propagate the know type.
Bug: https://github.com/flutter/flutter/issues/51828
Change-Id: I89c82763e0d4f8b102bb55dec3b694d017345517
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138500
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Clement Skau <cskau@google.com >
2020-03-06 12:20:45 +00:00
Johnni Winther
c1ff1cbaae
[cfe] Merge clone with existing procedure in mixin transformation
...
This ensure that any existing references to the original procedure
will correctly refer to the cloned procedure after transformation.
Change-Id: I08f561f11e88d717041009e6a9bd9bb6e8054d88
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137976
Reviewed-by: Jens Johansen <jensj@google.com >
Commit-Queue: Johnni Winther <johnniwinther@google.com >
2020-03-03 13:52:11 +00:00
Clement Skau
ad118b1718
[Kernel] Fixes bug in async transform causing reuse of temps.
...
Certain nodes will delimit(..) an Expression to some Statements, which
was resetting the temp nameIndex.
This meant any sub-expressions that generated temps would not cause the
outer expressions to see those already used temps.
Bug: https://github.com/dart-lang/sdk/issues/40662
Change-Id: Ife07052ab756b9d05f34f69380614c7eb7309a4c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136224
Commit-Queue: Clement Skau <cskau@google.com >
Reviewed-by: Vyacheslav Egorov <vegorov@google.com >
2020-02-21 07:35:16 +00:00
Jens Johansen
128771af8a
[CFE] Version 2 of incremental compiler invalidation strategy
...
Change-Id: Iff860e2665dee64fc005a50237ae890986ddb0f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127896
Commit-Queue: Jens Johansen <jensj@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2020-01-16 07:50:39 +00:00
Jens Johansen
db525fe0f9
[kernel] Remove old unused 'method call' transformer
...
Change-Id: I20afd79daa0d3668c96d52fcc83c78fb5e3fb4bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127620
Reviewed-by: Martin Kustermann <kustermann@google.com >
Commit-Queue: Jens Johansen <jensj@google.com >
2019-12-09 10:14:57 +00:00
Samir Jindel
1d4c45d2d0
Re-land "[vm/cfe] Elaborate for-in statements during async transform"
...
This removes the component of the change which updates the kernel binary
format.
Change-Id: I86dbfe0ea61453bbea6eee200743961d0d0c3814
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127002
Commit-Queue: Samir Jindel <sjindel@google.com >
Reviewed-by: Teagan Strickland <sstrickl@google.com >
2019-12-05 14:06:08 +00:00
Clement Skau
f9327d3bac
[SDK] Adds --lazy-async-stack support for async*.
...
Bug: https://github.com/dart-lang/sdk/issues/39525
Change-Id: I53cd334243649901ea8e0f9799d9f41c126e3627
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126729
Commit-Queue: Clement Skau <cskau@google.com >
Reviewed-by: Martin Kustermann <kustermann@google.com >
2019-12-04 12:47:48 +00:00
Clement Skau
89e31069e8
Revert "[vm/cfe] Elaborate for-in statements during async transform"
...
This reverts commit 63333deed6 .
Reason for revert: Causes failures on Flutter HHH CI in the "flutter test hostonly_devicelab_tests" step due to kernel binary format version mismatch.
Original change's description:
> [vm/cfe] Elaborate for-in statements during async transform
>
> This allows us TFA to analyze the iterator calls and we generate much tighter
> code in AOT.
>
> However, due to the increased inlining opportunities, we end up emitting 0.5%
> more code. Inlining of the _GrowableList iterator specifically also includes the
> concurrent modification check and error handling.
>
> Calls to get:iterator, moveNext and get:current account for 7.12% of all InstanceCall
> instructions in Flutter Gallery.
>
> Fixes https://github.com/dart-lang/sdk/issues/39516
> Issue https://github.com/dart-lang/sdk/issues/39566
> Issue https://github.com/dart-lang/sdk/issues/39565
>
> Change-Id: I8dcc08b7571137e869a16ceea8cc73539eb02a5a
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126381
> Commit-Queue: Samir Jindel <sjindel@google.com >
> Reviewed-by: Martin Kustermann <kustermann@google.com >
TBR=kustermann@google.com ,sjindel@google.com ,johnniwinther@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I89b88c3d9f7c743fc340ee73a45c3f57059bcf30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126734
Reviewed-by: Clement Skau <cskau@google.com >
Reviewed-by: Teagan Strickland <sstrickl@google.com >
Reviewed-by: Martin Kustermann <kustermann@google.com >
Commit-Queue: Clement Skau <cskau@google.com >
2019-12-03 12:29:35 +00:00