Index: pkg/compiler/lib/src/inferrer/locals_handler.dart |
diff --git a/pkg/compiler/lib/src/inferrer/locals_handler.dart b/pkg/compiler/lib/src/inferrer/locals_handler.dart |
index ab1c713c3e578d2fd7cb962beaa262b88bfd3a13..ed04230b6dbb4861cd68692b44c0f2f5ac2deae4 100644 |
--- a/pkg/compiler/lib/src/inferrer/locals_handler.dart |
+++ b/pkg/compiler/lib/src/inferrer/locals_handler.dart |
@@ -104,7 +104,7 @@ class VariableScope { |
/// Tracks initializers via initializations and assignments. |
class FieldInitializationScope { |
- final TypeSystem types; |
+ final TypeSystem<Node> types; |
Map<Element, TypeInformation> fields; |
bool isThisExposed; |
@@ -243,7 +243,7 @@ class ArgumentsTypesIterator implements Iterator<TypeInformation> { |
*/ |
class LocalsHandler { |
final CompilerOptions options; |
- final TypeSystem types; |
+ final TypeSystem<Node> types; |
final InferrerEngine inferrer; |
final VariableScope locals; |
final Map<Local, FieldEntity> captured; |
@@ -326,7 +326,8 @@ class LocalsHandler { |
type = types.addPhiInput( |
local, |
types.allocatePhi( |
- locals.block, local, types.narrowNotNull(currentType)), |
+ locals.block, local, types.narrowNotNull(currentType), |
+ isTry: locals.block is TryStatement), |
type); |
} |
locals[local] = type; |
@@ -345,8 +346,9 @@ class LocalsHandler { |
// the right phi for it. |
TypeInformation existing = tryBlock.locals.parent[local]; |
if (existing != null) { |
- TypeInformation phiType = |
- types.allocatePhi(tryBlock.locals.block, local, existing); |
+ TypeInformation phiType = types.allocatePhi( |
+ tryBlock.locals.block, local, existing, |
+ isTry: tryBlock.locals.block is TryStatement); |
TypeInformation inputType = types.addPhiInput(local, phiType, type); |
tryBlock.locals.parent[local] = inputType; |
} |
@@ -505,7 +507,8 @@ class LocalsHandler { |
if (myType == null) return; |
TypeInformation newType; |
if (seen != null && !seen.contains(local)) { |
- newType = types.allocatePhi(locals.block, local, otherType); |
+ newType = types.allocatePhi(locals.block, local, otherType, |
+ isTry: locals.block is TryStatement); |
seen.add(local); |
} else { |
newType = types.addPhiInput(local, myType, otherType); |
@@ -533,7 +536,8 @@ class LocalsHandler { |
void startLoop(Node loop) { |
locals.forEachLocal((Local variable, TypeInformation type) { |
- TypeInformation newType = types.allocateLoopPhi(loop, variable, type); |
+ TypeInformation newType = types.allocateLoopPhi(loop, variable, type, |
+ isTry: loop is TryStatement); |
if (newType != type) { |
locals[variable] = newType; |
} |