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

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

Issue 2901823002: Type .targetElement as MemberEntity (Closed)
Patch Set: Created 3 years, 7 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/elements/elements.dart ('k') | pkg/compiler/lib/src/ssa/builder_kernel.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 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;
« no previous file with comments | « pkg/compiler/lib/src/elements/elements.dart ('k') | pkg/compiler/lib/src/ssa/builder_kernel.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698