Commit Graph

1885 Commits

Author SHA1 Message Date
Vyacheslav Egorov d8d7af15ce [vm] Migrate away from native 'name' syntax.
As part of deprecating support for native extensions we are also
migrating away from legacy VM-specific `native 'name'` syntax
towards metadata based encoding which does not require any special
syntax.

This CL is a step 1 in migration:

- introduces support for `@pragma('vm:external-name', 'name')`
which serves as a direct replacement for `native 'name'`;
- all core libraries and tests are migrated to use the annotation;

Once this CL lands and rolls we will edit internal and external embedders
to eliminate uses of the native keyword (step 2) and finally remove
support for native keyword across our parsers (step 3).

TEST=ci

Bug: https://github.com/dart-lang/sdk/issues/28791
Change-Id: Id6dea878db82dd4fd81149243c425b5c5dc6df86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212461
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-09-08 13:39:34 +00:00
Johnni Winther fbc70d8be6 [cfe] Don't replace concrete stubs with abstract methods in mixin transformation
Closes #46389
Closes #46390

Change-Id: If3446d08d0feaf8f778dc396bbed1ebb1c5c0bc7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212745
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-09-08 12:43:35 +00:00
Johnni Winther 8c6ba91e98 [cfe] Add AsExpression to forwarding super stubs where needed
Change-Id: I87cda549802f4cde8ed9b5ee56b3dfbea69a0e0d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212588
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-09-08 08:42:36 +00:00
Johnni Winther bc1c71fd9b [cfe] Handle un-inlined fields/locals in eager instantiation constantification
Closes #47108

TEST=existing

Change-Id: I590939161cde1316eede7d828dff5fe6ac2790fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212577
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-09-07 15:14:36 +00:00
Dmitry Stefantsov 0a9d14a8e3 [cfe] Adjust computation of nullability in flatten
Closes #47057.

Bug: https://github.com/dart-lang/sdk/issues/47057
Change-Id: Iad719192d0ecbe97461bfed868899072a6dd52e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212467
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2021-09-07 10:40:44 +00:00
Ahmed Ashour f1ded6af56 Remove import dart:core
Fixes #47092

TEST=existing

Change-Id: I3c5c0a1ec5e0426642a5dc70aa9a0391a143ed93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212298
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-09-06 11:57:40 +00:00
Daco Harkes 2b5adb7231 [vm] Implement constant Maps in the VM
This CL changes the frontend to emit map and set constants which are
then processed by the constant reader in the VM.

This CL also introduces support for sending the const maps and sets
in messages between isolates and saving it in snapshots.

TEST=tests/language/const/map_test.dart (et al, for lookups)
TEST=tests/lib/isolate/message3_test.dart (et al, for isolate messages)
TEST=tools/test.py -c dartkp (for consts from clustered snapshot)
TEST=tools/test.py -n app_jitk-linux-debug-x64 (for consts from app
     jit snapshots)
TEST=Building the SDK which uses const Maps in clustered snapshots.

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

Change-Id: I1f8150a8aba8298c4e64d2571dd147743526135a
Cq-Include-Trybots: luci.dart.try:analyzer-nnbd-linux-release-try,app-kernel-linux-debug-x64-try,dart-sdk-linux-try,front-end-nnbd-linux-release-x64-try,pkg-linux-debug-try,vm-canary-linux-debug-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-checked-linux-release-x64-try,vm-kernel-linux-debug-x64c-try,vm-kernel-linux-debug-x64-try,vm-kernel-linux-debug-simarm64c-try,vm-kernel-nnbd-linux-release-simarm-try,vm-kernel-optcounter-threshold-linux-release-x64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64c-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-tsan-linux-release-x64-try,vm-kernel-tsan-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203765
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-09-06 06:28:59 +00:00
Dmitry Stefantsov 6050b7e06f [cfe] Remove kernel-semantics.tex
Closes #47066.

Bug: https://github.com/dart-lang/sdk/issues/47066
Change-Id: Ia8d3397f33f049776587a4a650f4d249c9eaecb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212285
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-09-02 13:54:15 +00:00
Johnni Winther 4ff04f641b [kernel] Add always_declare_return_types lint
Change-Id: Icdcc648f42393b28daf648f752e3b4d61f51aa10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212043
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-09-01 16:50:27 +00:00
Johnni Winther 93c531f1a0 [cfe] Move force* flags from TargetFlags to TestTargetFlags
TEST=existing

Change-Id: I3db6f5bdd72ca6303766b6524df19e66b1ba1cc7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212001
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-09-01 13:29:26 +00:00
Johnni Winther 097a511d9f [kernel] Add annotate_overrides lint
Change-Id: I1fffd60eeb14ecd6d5ba30cd584a75ddd4a8acfc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212005
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-09-01 11:45:17 +00:00
Johnni Winther 1556299acf [cfe] Handle redirecting factory invocation in metadata
Closes #47036

Change-Id: I2c482df3b2c5c9bdca672167d03c7d77563cb12f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211822
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-08-30 17:20:37 +00:00
Johnni Winther ce4e7705f2 [cfe] Handle explicit instantiation in implicit creation syntax
Closes #46719
Closes #46887

Change-Id: I4ad0f1bb4ab847a44f749113c6446f62a474143c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211260
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-08-26 11:59:48 +00:00
Jens Johansen c0a9d571ce [kernel] Add 'dill_forensic' tool
Tool will try to extract useful information from invalid (e.g. partial
or wrong version) dill.
This is a first stab and could possibly be extended and improved in the
future.

Change-Id: Ib381794a3fe80036bb845800488fa0e1a7f04f83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211241
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-08-25 11:37:42 +00:00
Johnni Winther ae4543fcb9 [cfe] Report all compile-time errors found during constant evaluation
Closes #46925

Change-Id: I81e97cae05c39c24b24dae82a222f857d4730ac7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210465
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-08-24 11:42:53 +00:00
Johnni Winther b54269e255 [cfe] Updates cf. equivalence visitors comments
Change-Id: Ib5990cf1434ce07019e9602150df66b359476095
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210863
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-08-24 10:37:49 +00:00
Johnni Winther 6ee9cd0df1 [cfe] Add preamble to visitor generators
Change-Id: I3d0e873f7e4b03e107cb713ec375e0078e2de1a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211002
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-08-24 10:36:58 +00:00
Johnni Winther 5e7b7dbcda [cfe] Add clone test for file offsets
Change-Id: Ic6049f8262119f8d77c926ce4606c50b8323a327
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210380
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-08-18 22:18:35 +00:00
Johnni Winther c13746df2b [cfe] Add NodeCreator and clone test
Change-Id: I3b0f9c716a25eed05e83dbd653f50a478242a7a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210240
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-08-18 15:21:03 +00:00
Alexander Thomas d2bd43f43e [python3] Migrate PRESUBMIT.py files
* Force depot_tools to use python3 results (USE_PYTHON3=True).
* Fixes the dart format presubmit check.
* Remove broken DOM tools presubmit check.

TEST=Manually provoked errors and ran git cl presubmit -v -f.

Cq-Include-Trybots: luci.dart.try.shared:presubmit-try
Change-Id: I8ba46e2ae1640f1b2f82e18bc8024e0aa4838b2b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210123
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2021-08-16 08:29:54 +00:00
Dmitry Stefantsov 6393841036 [cfe] Account for InvalidType at nestedness level in UP and DOWN
Closes #46863.

Bug: https://github.com/dart-lang/sdk/issues/46863
Change-Id: I0cc60251f80406baa955131978cd6cbd029b228e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209700
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2021-08-11 09:40:31 +00:00
Alexander Thomas c040c050d6 [release] Bump language version to 2.15
TEST=Standard CQ.
Change-Id: Ib50b4d23f25ea4bd074904a87068a4a8774932aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209561
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-08-10 13:06:53 +00:00
Stephen Adams c9ebc7c13f [dart2js/kernel] Fix poor code with nested List.generate
Cloning of InstanceInvocation kernel ast nodes was dropping the
isInvariant and isBoundSafe flags, causing the nested List.generate
expansion to not be as well optimized. `-O3` and `-O4` were 'hiding'
the problem by removing the checks anyway.

Change-Id: Id20f2eb4ef5396691a2dd5cbdd847e2d361a21d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209442
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-08-09 20:38:50 +00:00
Dmitry Stefantsov f77f8e5871 [cfe] Add type checks on tearing off instance members
Closes #46784.

Bug: https://github.com/dart-lang/sdk/issues/46784
Change-Id: I7637618be0686bbffe6eb18a19049ec5da6059aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208881
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2021-08-06 15:19:35 +00:00
Alexander Markov 300a2ea952 [cfe] Create normal bodies for redirecting factories
Replace bogus body created for redirecting factories with a
normal body which calls target factory or constructor and
forwards all arguments. Such a body can be used by back-ends
if they choose to treat redirecting factories as ordinary
factories.

TEST=ci
Fixes https://github.com/dart-lang/sdk/issues/41915
Issue https://github.com/dart-lang/sdk/issues/46231

Change-Id: I62c83bcc9005995e85de049d3d929ca86a75297f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208681
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-08-04 17:51:07 +00:00
Johnni Winther 5dc4d65114 [kernel] Add InvalidExpression.expression
... and use this to wrap expressions instead of Let

TEST=existing

Change-Id: I6d1f5cfa4693222840d6cb406790c39c6ae63e5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208580
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-08-04 08:40:18 +00:00
Riley Porter cf3387efd3 Remove Link depenedency in Tagging debug class.
Change-Id: Iabd0edb24eee278c3f12a9f61fe535645e1f26d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208761
Commit-Queue: Riley Porter <rileyporter@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-08-03 00:32:22 +00:00
Johnni Winther 8038ecab65 [cfe] Generate equivalence visitor
+ use it to allow discrepancy in incremental_dart2js_load_from_dill_test

Change-Id: I0adad30af1e502d81e870b26eb63a03b70e42333
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205796
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-08-02 19:50:20 +00:00
Riley Porter b36dcbf00b [ddc] Print AST of compiled libraries with summarize-text flag.
Moves dart2js DebugPrinter and Indentation to pkg/kernel/lib/text
and produces the AST of compiled libraries when ddc is run using
the --summarize-text flag.

Change-Id: I195ff99a0929ac12791b4f7b6c5e755b19065c23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208460
Commit-Queue: Riley Porter <rileyporter@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-08-02 17:36:10 +00:00
Johnni Winther cb3a9b0043 [cfe] Remove old method invocation encoding nodes
TEST=existing

Change-Id: I05ee649ecfa7945e2e0f5e5d09441d8916a9c46e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208185
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-07-28 15:44:04 +00:00
Johnni Winther 16ebd4fe57 [cfe] Add InternalMethodInvocation, InternalPropertyGet and InternalPropertySet
- to replace internal use of the old method invocation encoding.

Change-Id: I7ca876d28beec265f1a143ce5f29deb9e61616d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208184
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-07-28 10:13:34 +00:00
Johnni Winther 286702df6b [kernel] Migrate tests
Change-Id: If426fc15f7bce54b51eaac3354061684cd5b0e17
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207129
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-07-27 12:35:37 +00:00
Johnni Winther eb1a2166cd [cfe] Fix sound mode failures
Closes #46704

Change-Id: I39b05b8432a8c316c4bca8679531d663e46817a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208084
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-07-26 15:14:17 +00:00
Johnni Winther ca8ea1d936 [cfe] Reimplement typedef tearoff lowering
Using top level procedures generated for each constructor in the
targeted class.

Closes #46676

Change-Id: I42e98254e5cdb8922fafd29e0170dd70ef3e693e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207961
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-07-23 14:29:37 +00:00
Johnni Winther 66f6a490d7 [cfe] Handle TypedefTearOff(Constant) in constant evaluation
+ fix bug in TypedefTearOff.getStaticType and implement
TypedefTearConstant.hashCode to match operator==

Closes #46674

Change-Id: I95d9e058865b7290208429f671e8f276b1d7993c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207660
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-07-22 18:09:29 +00:00
Alexander Markov 3a96674d3d Migrate pkg/vm to null safety, part 2
TEST=ci
Issue: https://github.com/dart-lang/sdk/issues/46620

Change-Id: I18bab8755bfa937b6de07a738e3f22309240da22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207365
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-07-22 17:30:49 +00:00
Johnni Winther fac1174b28 [cfe] Support lowering for redirecting factory tear offs
- including refactoring to reuse functionality in
  constructor_tearoff_lowering.dart

Change-Id: I7d9cad93a2cf7b809eb7726fbef7bf5a57a2ae82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207303
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-07-20 15:58:40 +00:00
Johnni Winther 761eb28fd8 [cfe] Support new nodes in text serialization
Change-Id: I351e97c6547ef6196b8e081271640ed4fa39f651
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207301
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-07-20 13:58:00 +00:00
Johnni Winther 8674c7da89 [cfe] Generate RedirectingFactoryTearOff(Constant)
Change-Id: I8bf989921916ced48d583b9278d0ab8b1da03dd5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207300
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-07-20 12:44:00 +00:00
Johnni Winther 970ea21f49 [cfe] Handle constructor tear off in constant evaluation
- including updates to ast-to-text

TEST=existing

Change-Id: I4c9ccca1da3956d10f4ebb6e27f894463dd303ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207082
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-07-20 09:15:20 +00:00
Johnni Winther 4ca415a9fa [kernel] Update FunctionNode.computeFunctionType for constructor tear offs
FunctionNode.computeFunctionType didn't handle constructors for generic
classes and would fail to substitute type parameters from the enclosing
class.

Change-Id: Ia16ea55ce774597590e6e7da7af066b5c66dfe67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207123
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-07-20 07:08:00 +00:00
Alexander Markov 8e1fbc9ab3 Migrate pkg/vm to null safety, part 1
TEST=ci
Issue: https://github.com/dart-lang/sdk/issues/46620

Change-Id: I2ad3f3aac03c8c13d2562a385a5b6636675401f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207362
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-07-20 06:49:20 +00:00
Johnni Winther faed4bacb3 [cfe] Add RedirectingFactoryTearOff(Constant)
+ rename RedirectingFactoryConstructor to RedirectingFactory
+ change encoding of RedirectingFactory to use FunctionNode

TEST=existing

Change-Id: I80778acc215a36ab6b87518824389a293b96f0a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206780
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-07-19 16:46:29 +00:00
Johnni Winther 8ea5fc2773 [cfe] Add flag for lowering redirecting factories
+ handle constructor tear offs in part files

Change-Id: Id3100ebbabb1c125b18c52cca7cb06871ed0f726
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206621
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-07-19 14:25:39 +00:00
Dmitry Stefantsov ff2be51b1f [cfe] Generate TypedefTearOff nodes on the output
Change-Id: I4b4a25137bffb0fa284a94908b05fef9b9e5c5da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206370
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-07-13 09:13:15 +00:00
Clement Skau ffde1585da [VM] Removes types from reused temps in async.
When we detect that a temporary variable is being reused
with a different type, we change the type of the temp
to dynamic.
This allows us to retain types for any non-reused temps.

For any dynamic temps we still have type information available
for use sites, which we can pass on via unsafeCast.

One drawback of this approach is that we don't know ahead
of time which temps are reused, and get turned into dynamic,
so we have to unsafeCast all uses.


This change is similar to what was done in:
https://dart-review.googlesource.com/c/sdk/+/138500

TEST=Adds tests/language/vm/regress_flutter_85311_test.dart,
updates relevant expect files.

Bug: https://github.com/flutter/flutter/issues/85311
Change-Id: I821c5266327892d5c3fd5bae1bebba7f3fe3931b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205647
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2021-07-12 08:55:53 +00:00
Johnni Winther a0d57b0a4d [cfe] Initial implementation for constructor tear off lowering
TEST=pkg/front_end/testcases/constructor_tearoffs/lowering/*

Change-Id: Ie8a36df4068093dc4d239b48c31f47d03054ba2b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206080
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-07-08 11:05:04 +00:00
Johnni Winther 093bfcd883 [cfe] Migrate remaining front_end/lib/ libraries
Change-Id: Ia6efe9046b80709605aef1e7f38fce523baafa91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206081
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-07-07 19:11:04 +00:00
Johnni Winther 49e2148dea [cfe] Migrate wave 10 aka the big one
Change-Id: I77a1996fe3ebd3605efc5afc6ff3308f6ebc3cac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205580
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-07-07 15:18:02 +00:00
Dmitry Stefantsov 5a9ffe55a8 [cfe] Add generation of ConstructorTearOff nodes
Change-Id: Ice66a1cdde0e4858528ec0bbc0a85054b08228c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206040
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-07-06 11:31:50 +00:00