Skip to content

Commit

Permalink
Flow analysis: implement the new attachFinally algorithm.
Browse files Browse the repository at this point in the history
When dart-lang/language#1274 (Infer
non-nullability from local boolean variables) is fixed, this algorithm
will replace the `restrict` algorithm is currently used at the bottom
of a try/finally statement to combine the flow models from the `try`
and `finally` blocks.  The new algorithm has very similar behavior to
the old one, however since it is based on SSA nodes it (a) is able to
make slightly more promotions than the old one, and (b) will be able
to properly update SSA nodes so that local boolean variables assigned
inside a `try` block will be able to used for promotion after the
`finally` block.

The new functionality is hidden behind a flag for now, so there's no
customer-visible change yet.

Bug: dart-lang/language#1274
Change-Id: I1d37f981688f58da1e5c6c7eee48f2319c997cef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174960
Reviewed-by: Johnni Winther <[email protected]>
  • Loading branch information
stereotype441 authored and [email protected] committed Dec 17, 2020
1 parent bb7081c commit afc9a4e
Show file tree
Hide file tree
Showing 5 changed files with 701 additions and 38 deletions.
Loading

0 comments on commit afc9a4e

Please sign in to comment.