Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1405)

Unified Diff: pkg/compiler/lib/src/ssa/builder.dart

Issue 964553004: Analyze locals in await for loops as inside a try-finally. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Refer directly to class in dartdoc comment Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/closure.dart ('k') | tests/language/await_for_use_local_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/builder.dart
diff --git a/pkg/compiler/lib/src/ssa/builder.dart b/pkg/compiler/lib/src/ssa/builder.dart
index ccda86e8ef8687dc72a4806f244cac0dae8798ab..d7f44cab2f95e80179866e59bad0725f6c00ef6b 100644
--- a/pkg/compiler/lib/src/ssa/builder.dart
+++ b/pkg/compiler/lib/src/ssa/builder.dart
@@ -6022,7 +6022,16 @@ class SsaBuilder extends ResolvedVisitor {
/// Calls [buildTry] inside a synthetic try block with [buildFinally] in the
/// finally block.
+ ///
+ /// Note that to get the right locals behavior, the code visited by [buildTry]
+ /// and [buildFinally] must have been analyzed as if inside a try-statement by
+ /// [ClosureTranslator].
void buildProtectedByFinally(void buildTry(), void buildFinally()) {
+ // Save the current locals. The finally block must not reuse the existing
+ // locals handler. None of the variables that have been defined in the
+ // body-block will be used, but for loops we will add (unnecessary) phis
+ // that will reference the body variables. This makes it look as if the
+ // variables were used in a non-dominated block.
HBasicBlock enterBlock = openNewBlock();
HTry tryInstruction = new HTry();
close(tryInstruction);
« no previous file with comments | « pkg/compiler/lib/src/closure.dart ('k') | tests/language/await_for_use_local_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698