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 cf1dcbd0f5eb758bc53465b3b86384fd610b8c91..1943e06c96f520ac9b7fefaea911f96d6a0a2ee3 100644 |
--- a/pkg/compiler/lib/src/ssa/builder.dart |
+++ b/pkg/compiler/lib/src/ssa/builder.dart |
@@ -274,13 +274,19 @@ class SsaBuilder extends ast.Visitor |
sourceInformationFactory.createBuilderForContext(resolvedAst); |
graph.sourceInformation = |
sourceInformationBuilder.buildVariableDeclaration(); |
- localsHandler = new LocalsHandler(this, target, null, |
- closedWorld.nativeData, closedWorld.interceptorData); |
+ localsHandler = new LocalsHandler( |
+ this, |
+ target, |
+ target.memberContext, |
+ target.contextClass, |
+ null, |
+ closedWorld.nativeData, |
+ closedWorld.interceptorData); |
loopHandler = new SsaLoopHandler(this); |
typeBuilder = new TypeBuilder(this); |
} |
- Element get targetElement => target; |
+ MemberElement get targetElement => target; |
/// Reference to resolved elements in [target]'s AST. |
TreeElements get elements => resolvedAst.elements; |
@@ -854,11 +860,12 @@ class SsaBuilder extends ast.Visitor |
{ResolutionInterfaceType instanceType}) { |
ResolvedAst resolvedAst = function.resolvedAst; |
assert(resolvedAst != null); |
- localsHandler = new LocalsHandler( |
- this, function, instanceType, nativeData, interceptorData); |
+ localsHandler = new LocalsHandler(this, function, function.memberContext, |
+ function.contextClass, instanceType, nativeData, interceptorData); |
localsHandler.closureData = |
closureToClassMapper.getClosureToClassMapping(resolvedAst); |
- returnLocal = new SyntheticLocal("result", function); |
+ returnLocal = |
+ new SyntheticLocal("result", function, function.memberContext); |
localsHandler.updateLocal(returnLocal, graph.addConstantNull(closedWorld)); |
inTryStatement = false; // TODO(lry): why? Document. |
@@ -5508,8 +5515,9 @@ class SsaBuilder extends ast.Visitor |
// <declaredIdentifier> = a[i]; |
// <body> |
// } |
- Element loopVariable = elements.getForInVariable(node); |
- SyntheticLocal indexVariable = new SyntheticLocal('_i', loopVariable); |
+ ExecutableElement loopVariable = elements.getForInVariable(node); |
+ SyntheticLocal indexVariable = |
+ new SyntheticLocal('_i', loopVariable, loopVariable.memberContext); |
TypeMask boolType = commonMasks.boolType; |
// These variables are shared by initializer, condition, body and update. |
@@ -6233,8 +6241,7 @@ class SsaBuilder extends ast.Visitor |
startCatchBlock = graph.addNewBlock(); |
open(startCatchBlock); |
// Note that the name of this local is irrelevant. |
- SyntheticLocal local = |
- new SyntheticLocal('exception', localsHandler.executableContext); |
+ SyntheticLocal local = localsHandler.createLocal('exception'); |
exception = new HLocalValue(local, commonMasks.nonNullType); |
add(exception); |
HInstruction oldRethrowableException = rethrowableException; |