Skip to content

Commit 5a067e9

Browse files
alexmarkovCommit Bot
authored and
Commit Bot
committed
Describe new async/async*/sync* implementation in CHANGELOG.
Issue: #48378 Change-Id: I0cfff561a06c402603ad4f2b977821b572cb6e21 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250408 Reviewed-by: Slava Egorov <[email protected]> Auto-Submit: Alexander Markov <[email protected]> Commit-Queue: Alexander Markov <[email protected]>
1 parent 37a1052 commit 5a067e9

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,29 @@
3434

3535
- Deprecates `BidirectionalIterator`.
3636

37+
### Dart VM
38+
39+
Implementation of `async`/`async*`/`sync*` is revamped in Dart VM,
40+
both in JIT and AOT modes. This also affects Flutter except Flutter Web.
41+
42+
Besides smaller code size and better performance of async methods,
43+
the new implementation carries a few subtle changes in behavior:
44+
45+
- If `async` method returns before reaching the first `await`, it now returns a completed Future.
46+
Previously `async` methods completed resulting Future in separate microtasks.
47+
48+
- Stack traces no longer have duplicate entries for `async` methods.
49+
50+
- New implementation now correctly throws an error if `null` occurs as
51+
an argument of a logical expression (`&&` and `||`) which also contains
52+
an `await`.
53+
54+
- New implementation avoids unnecessary extending the liveness of local
55+
variables in `async`/`async*`/`sync*` methods, which means that unused
56+
objects stored in local variables in such methods might be garbage
57+
collected earlier than they were before
58+
(see issue [#36983](https://github.com/dart-lang/sdk/issues/36983) for details).
59+
3760
## 2.18.0
3861

3962
### Language

0 commit comments

Comments
 (0)