Commit Graph

1521 Commits

Author SHA1 Message Date
Dmitry Stefantsov c0e7543c98 [cfe] Add support for InterfaceTypes in round-trip serialization
Change-Id: Ie39848adf7c72e9171e6551717a67ae070c66985
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145802
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2020-05-01 12:03:44 +00:00
Dmitry Stefantsov b67a1313ae [cfe] Add an option to inspect internal state of text serialization
The option is added to the unit testing framework and is supposed to
be used locally.

Change-Id: Ia043ca35d27c15e597fe1b66429f923ccb24f3dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144825
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2020-04-29 10:36:40 +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
Johnni Winther 3f18d37333 [cfe] Implement NNBD_TOP_MERGE update
Change-Id: I6b204b5d7def6a9d1dd4709e47f95eb102741489
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144763
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-04-27 16:28:08 +00:00
Johnni Winther 3c0e9642d2 [cfe] Ensure default type on generic forwarding stubs/method signatures
Change-Id: Iad6246c55f45953bffe2c3de4a2e30a32db347d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144820
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-04-27 16:25:18 +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
Dmitry Stefantsov 52df6d0eb7 [cfe] Clean up the remaining TextSerializationFailure statuses
Change-Id: I96ea244589ae9c103b0f061198ebd0b57b8184d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144401
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2020-04-23 06:28:48 +00:00
Dmitry Stefantsov 64b8ded48b [cfe] Leave unrecognized types in substitution unchanged
The CL allows type substitution to run over types with implementations
of DartType unknown to it.  Such types will be left unchanged in the
substituted type.

Closes #41199.

Bug: https://github.com/dart-lang/sdk/issues/41199
Change-Id: I335056ff02576d621a815dbd14fad3b3ffab017e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144361
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-04-22 13:18:07 +00:00
Aske Simon Christensen 8800e65ae1 [kernel] Specialized string (de)serialization.
This makes the string (de)serialization independent of the core library
UTF-8 encoder/decoder so we can change that without affecting kernel
serialization.

It also speeds up serialization and deserialization by a few percent.

Change-Id: I347e471ed0174cc5cb191335dd7c47e6eb3dad59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140293
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2020-04-22 11:46:24 +00:00
Dmitry Stefantsov 56df960ddf [cfe] Refine text serialization testing: skip free variables
The CL reduces the number of false positive cases in the round-trip
serialization unit testing by refining the verifier analysis.  Not it
doesn't attempt to make the round trip over the sub-trees containing
free variables.

Change-Id: Ib6fb2e72f7543ea7d99c5273c337801f3ad1bec4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144285
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2020-04-22 10:27:08 +00:00
Jens Johansen 4084c4cc24 [kernel/CFE] Use kernel 'Version' class for versions
Define a "Version" class in kernel that allows easy comparison between
versions (e.g. a < b, a >= b etc).

Use this Version class in CFE.

Change-Id: I2f382e7bb3c2083258743b9b66a909a88d575dbc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144283
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-04-21 09:44:52 +00:00
Dmitry Stefantsov 5b342eb9a3 [cfe] Refine analysis of text serialization verifier
The verifier now determined what is supported for the serialization
more precisely, resulting in less TextSerializationFailures in the
unit tests.

Change-Id: I3728f56c9cb5042420b6a13acb2ed06f4be6a924
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143809
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-04-20 10:01:46 +00:00
Dmitry Stefantsov d5dea0056b [cfe] Improve diagnostics on text serialization failures
This CL also includes the following changes:
- The .registerTags() method is added to the Case combinator.
- The actual canonical names' root is passed into the deserializer.
- Some text serialization failures are fixed and the corresponding
status entries in text_serialization.status removed.

Change-Id: I222dfa3fc348dddf83e0c6edb92f15d08b8e73e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143803
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2020-04-17 10:53:47 +00:00
Jens Johansen a85a7fc254 [kernel/CFE] Better mixed compilation mode handling
* Throw a specific error on mixed compilation mode; let the incremental
  compiler ignore that error when trying to initialize (i.e. it doesn't
  initialize from it, but it doesn't show any warning either).
* Allow some mixed mode stuff: Eventually the SDK should be in agnostic
  mode, so we should allow mixing agnostic with non-agnostic.

Fixes #41493.

Change-Id: Idb33fb31afe6bbba6d74134cb722ca825751898b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143583
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-04-17 10:22:46 +00:00
Dmitry Stefantsov ae0eca8318 [cfe] Add text serialization support for libraries
Change-Id: Ia36efcc433df573abf2f82c1b402fa031276c652
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143587
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2020-04-17 07:27:06 +00:00
Dmitry Stefantsov 3fa2d81240 [cfe] Add serialization support for top-level methods
Change-Id: Ie2f949142dc8fd97a0ad937b1ccc38918f3aae87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143584
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2020-04-16 10:52:01 +00:00
Alexander Thomas 3c85da7778 [release] Bump version to 2.9
Change-Id: I2fc393cbb7a9111f4c09db6a2a7a202eeb88992c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142996
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-04-15 18:36:42 +00:00
Johnni Winther eb18db2116 [cfe,kernel] Add Field.isInternalImplementation
This bit is required to support synthesized field used for the late
lowering. These fields should not be seen as part of the interface,
that is, classes that implement the class declaring the late field should
not be required to override these fields.

Closes #41436

Change-Id: I9a98322bdd1842b46bde34fff1176a7577672e0f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142998
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-04-15 13:46:43 +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
Anna Gringauze 9f65693f57 Use offset for detecting scope in ExpressionCompiler
ExpressionCompiler currently translates offsets of scopes to line
numbers during the binary search in the library in order to find
the inner-most scope containing the line where debugger has stopped.
This results in many offset-to-line translations per evaluation request,
each translation also performing a binary search in Source.lineStarts
table.

To make scope lookup more efficient, this change uses Source.lineStarts
table to find the offset for the debugger stop once, and uses integer
offset comparisons instead in the scope binary search.

Closes: https://github.com/dart-lang/sdk/issues/40281
Change-Id: I72052b144d15acef684a5f8d29b40f6c5774b723
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142461
Commit-Queue: Anna Gringauze <annagrin@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-04-09 22:29:14 +00:00
Johnni Winther 0d16ff6d86 [cfe] Handle static type of access on Never
Closes #41273

Change-Id: Ia236481ab47033198d7952086cdf5c9c8f5a34b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142366
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-04-08 08:46:02 +00:00
Johnni Winther 04b6c6a116 [cfe] Handle Null <: Never in mixed inheritance bounds check
Change-Id: I994f76b3b4f6d498a8e41f7e34849616960dca08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142368
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-04-06 15:18:31 +00:00
Johnni Winther 32f82b5852 [CFE] Add NNBD compilation mode into kernel component
Fixes https://github.com/dart-lang/sdk/issues/41311

Change-Id: I2f4345f8ca7a31da705fcae37a28a8b801feb5e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142149
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-04-06 14:00:01 +00:00
Johnni Winther a7f1a5e677 [cfe] Handle A extends FutureOr<B> <: FutureOr<B>
Change-Id: Ib5580328f006b033b2c004083b575a2cf5aed551
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141541
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-04-05 06:31:19 +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
Johnni Winther 46bb15edf3 [cfe] Fix inheritance test data discrepancies.
Change-Id: I367aace60324a7755f795d2f24aaf0d138bc8d59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141602
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-04-02 13:14:39 +00:00
Johnni Winther 0a9e57419b [kernel] Make verbose qualified names conditional in toStringInternal
Including the library name/uri in types and member names makes these
unreadable in most cases. This changes that default toStringInternal
to omit the library name/uri but supports a verbose mode that includes
the library name/uri for debugging the rare occasions where they matter.

Change-Id: I783e8bd0ac5d2f19c3051e8e7f226b240c8d1bc8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141546
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-03-30 08:41:15 +00:00
Jens Johansen 3e053b7da2 [kernel] Polish toString implementation on AST nodes
Change-Id: I0c21ded156243d8f8ff178d1b31bf0512758ebe1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141101
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-03-27 07:33:38 +00:00
Johnni Winther d2e96aa6d3 [cfe] Report error on (un)assigned late variables
Closes #40601
Closes #41103
Closes #40946

Change-Id: I1a28f497ffe0be3d1f9e673f1e8be7a518bbfc7e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140403
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-03-23 14:48:53 +00:00
Jens Johansen feefcf0c94 [kernel/CFE] Simplified toString on (ast) nodes
This is a bare-bones implementation (and test) for having an explicit
toString on all `Node`s.
This can then be extended as-needed to better suit our debugging
purposes. It's not allowed to leak, though.

Change-Id: I8d3f5a9cd13b292ed7a6bf33762e507286f3fa7d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139805
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-03-23 10:25:23 +00:00
Dmitry Stefantsov dea82cc39a [cfe] Make instantiation-to-bound algorithm NNBD-aware
Closes #40764.

Bug: https://github.com/dart-lang/sdk/issues/40764
Change-Id: Ia9eff062f54632edbdb26937879742d7a813a07c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139643
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-03-20 09:03:41 +00:00
Jens Johansen 532a602fef [kernel] Rewrite verify test
Prerequisite for changing toString on ast nodes.

Change-Id: I295e201df160b158b4ea709c61e525206efb5523
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140063
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-03-20 06:46:50 +00:00
Johnni Winther 6dff390dec [cfe] Compute consolidated supertypes
Change-Id: Ifa2303afd61af184b171f13f5959b0786273cedb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140041
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-03-19 15:26:09 +00:00
Dmitry Stefantsov 928f9fc932 [cfe] Remove flag --force-nnbd-checks
The checks are now always enabled for the "non-nullable" experiment

Closes #40980.

Bug: https://github.com/dart-lang/sdk/issues/40980
Change-Id: I32a141a93f0ba86ebdab554e1f312c2147927993
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139440
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2020-03-16 15:01:38 +00:00
Johnni Winther e865bd89d1 [cfe] Normalize nullabilities in opt out libraries
Closes #40526

Change-Id: Idf40bd430fad0f08d7cc117f988bfc5e2b432a46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139200
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-03-12 21:58:17 +00:00
Johnni Winther ae2a25c537 [cfe] Handle FutureOr in late lowering
Closes #40783

Change-Id: Ia3afff050df8719bd7574c753639cde1ca321eff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138930
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-03-12 21:55:46 +00:00
Dmitry Stefantsov 029c8f1cee [cfe] Use Supertype instead of InterfaceType in ClassHierarchyBuilder
Change-Id: I1a11ce32237480c0eddf50a7a86cd56b89116e77
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138801
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-03-09 12:57:17 +00:00
Jens Johansen e8c58a7a3d [CFE] Add ability to compare CompilerOptions
This is (intended to be) a small step towards removing the batch compiler.

Change-Id: I201c56b6d33420f91d2f4b989682670cd8d6a387
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138508
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-03-09 09:11:57 +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
Jens Johansen 4e2a1a1b0f [CFE/kernel] Generate dart files with versions in them from tools/experimental_features.yaml
Use the version from tools/experimental_features.yaml as the current
language version (as specified in kernel).

Use the "enabledIn" from tools/experimental_features.yaml to write out
the major and minor version for enabling features. This replaces the
hard-coding of when nnbd is enabled (in front-end).

Change-Id: I5b5dd7c2bb0c1a412ef1e660dfbe61e227193e1b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138284
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-03-04 14:15:05 +00:00
Jens Johansen 70b4ffae4b [kernel] Delete limited_ast_to_binary.dart
Change-Id: I11277942cd8bb9f3f3b875233934ec0281c0369b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138085
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-03-04 11:45:55 +00:00
Jens Johansen 12df258354 [kernel] Small cleanup of binary printer
Change-Id: I3d5f6d145811e24fa4cb2936fb8fedf1c00d86b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138084
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-03-04 11:43:35 +00:00
Jens Johansen 1b41780198 [kernel] Investigative inspection into BinaryPrinter
This CL investigates some properties around the BinaryPrinter in the form
of non-optional-assert-like-things.
Said another way, if the assumptions added here are wrong, we'll crash,
but if the bots doesn't explode the assumptions are probably true and
we can procede from there.

Change-Id: Ia366be0e81164a4004f6d6764002cbb0f7383008
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137978
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-03-04 07:21:03 +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
Johnni Winther fbe9f6115d [cfe] Handle Object* in NNBD_TOP_MERGE
Closes #40481

Change-Id: I5f1060b137e9855106873b2173930d3ebed69930
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137921
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-03-02 12:15:50 +00:00