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

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

Issue 2981423003: Move .getLocalFunction from KernelToElementMap to KernelToLocalsMap (Closed)
Patch Set: Updated cf. comments Created 3 years, 5 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/kernel/element_map_impl.dart ('k') | pkg/compiler/lib/src/ssa/kernel_ast_adapter.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_kernel.dart
diff --git a/pkg/compiler/lib/src/ssa/builder_kernel.dart b/pkg/compiler/lib/src/ssa/builder_kernel.dart
index d8bf389c78644c63550203e3249d39beb1b46133..48e2ac45545d6a9a70de22c756c65171f06d8fbb 100644
--- a/pkg/compiler/lib/src/ssa/builder_kernel.dart
+++ b/pkg/compiler/lib/src/ssa/builder_kernel.dart
@@ -376,7 +376,7 @@ class KernelSsaGraphBuilder extends ir.Visitor
ConstructorEntity constructorElement = _elementMap.getConstructor(body);
void handleParameter(ir.VariableDeclaration node) {
- Local parameter = localsMap.getLocal(node);
+ Local parameter = localsMap.getLocalVariable(node);
// If [parameter] is boxed, it will be a field in the box passed as the
// last parameter. So no need to directly pass it.
if (!localsHandler.isBoxed(parameter)) {
@@ -636,7 +636,7 @@ class KernelSsaGraphBuilder extends ir.Visitor
ir.Constructor caller) {
var index = 0;
void handleParameter(ir.VariableDeclaration node) {
- Local parameter = localsMap.getLocal(node);
+ Local parameter = localsMap.getLocalVariable(node);
HInstruction argument = arguments[index++];
// Because we are inlining the initializer, we must update
// what was given as parameter. This will be used in case
@@ -726,7 +726,7 @@ class KernelSsaGraphBuilder extends ir.Visitor
Map<Local, TypeMask> parameterMap = <Local, TypeMask>{};
if (function != null) {
void handleParameter(ir.VariableDeclaration node) {
- Local local = localsMap.getLocal(node);
+ Local local = localsMap.getLocalVariable(node);
parameterMap[local] =
_typeInferenceMap.getInferredTypeOfParameter(local);
}
@@ -1041,7 +1041,8 @@ class KernelSsaGraphBuilder extends ir.Visitor
HInstruction value = new HIndex(array, index, null, type);
add(value);
- Local loopVariableLocal = localsMap.getLocal(forInStatement.variable);
+ Local loopVariableLocal =
+ localsMap.getLocalVariable(forInStatement.variable);
localsHandler.updateLocal(loopVariableLocal, value);
// Hint to name loop value after name of loop variable.
if (loopVariableLocal is! SyntheticLocal) {
@@ -1108,7 +1109,8 @@ class KernelSsaGraphBuilder extends ir.Visitor
TypeMask mask = _typeInferenceMap.typeOfIteratorCurrent(forInStatement);
_pushDynamicInvocation(forInStatement, mask, [iterator],
selector: Selectors.current);
- Local loopVariableLocal = localsMap.getLocal(forInStatement.variable);
+ Local loopVariableLocal =
+ localsMap.getLocalVariable(forInStatement.variable);
HInstruction value = pop();
localsHandler.updateLocal(loopVariableLocal, value);
// Hint to name loop value after name of loop variable.
@@ -1156,7 +1158,7 @@ class KernelSsaGraphBuilder extends ir.Visitor
_pushDynamicInvocation(forInStatement, mask, [streamIterator],
selector: Selectors.current);
localsHandler.updateLocal(
- localsMap.getLocal(forInStatement.variable), pop());
+ localsMap.getLocalVariable(forInStatement.variable), pop());
forInStatement.body.accept(this);
}
@@ -2209,7 +2211,7 @@ class KernelSsaGraphBuilder extends ir.Visitor
return;
}
- Local local = localsMap.getLocal(variableGet.variable);
+ Local local = localsMap.getLocalVariable(variableGet.variable);
stack.add(localsHandler.readLocal(local));
}
@@ -2257,7 +2259,7 @@ class KernelSsaGraphBuilder extends ir.Visitor
@override
void visitVariableDeclaration(ir.VariableDeclaration declaration) {
- Local local = localsMap.getLocal(declaration);
+ Local local = localsMap.getLocalVariable(declaration);
if (declaration.initializer == null) {
HInstruction initialValue = graph.addConstantNull(closedWorld);
localsHandler.updateLocal(local, initialValue);
@@ -2273,7 +2275,7 @@ class KernelSsaGraphBuilder extends ir.Visitor
}
void _visitLocalSetter(ir.VariableDeclaration variable, HInstruction value) {
- Local local = localsMap.getLocal(variable);
+ Local local = localsMap.getLocalVariable(variable);
// Give the value a name if it doesn't have one already.
if (value.sourceElement == null) {
@@ -2944,7 +2946,7 @@ class KernelSsaGraphBuilder extends ir.Visitor
@override
visitFunctionNode(ir.FunctionNode node) {
- Local methodElement = _elementMap.getLocalFunction(node.parent);
+ Local methodElement = localsMap.getLocalFunction(node.parent);
ClosureRepresentationInfo closureInfo =
closureDataLookup.getClosureRepresentationInfo(methodElement);
ClassEntity closureClassEntity = closureInfo.closureClassEntity;
@@ -2965,7 +2967,7 @@ class KernelSsaGraphBuilder extends ir.Visitor
visitFunctionDeclaration(ir.FunctionDeclaration declaration) {
assert(isReachable);
declaration.function.accept(this);
- Local localFunction = _elementMap.getLocalFunction(declaration);
+ Local localFunction = localsMap.getLocalFunction(declaration);
localsHandler.updateLocal(localFunction, pop());
}
@@ -3498,7 +3500,7 @@ class TryCatchFinallyBuilder {
catchesIndex++;
if (catchBlock.exception != null) {
Local exceptionVariable =
- kernelBuilder.localsMap.getLocal(catchBlock.exception);
+ kernelBuilder.localsMap.getLocalVariable(catchBlock.exception);
kernelBuilder.localsHandler
.updateLocal(exceptionVariable, unwrappedException);
}
@@ -3510,7 +3512,7 @@ class TryCatchFinallyBuilder {
kernelBuilder._commonElements.traceFromException));
HInstruction traceInstruction = kernelBuilder.pop();
Local traceVariable =
- kernelBuilder.localsMap.getLocal(catchBlock.stackTrace);
+ kernelBuilder.localsMap.getLocalVariable(catchBlock.stackTrace);
kernelBuilder.localsHandler
.updateLocal(traceVariable, traceInstruction);
}
« no previous file with comments | « pkg/compiler/lib/src/kernel/element_map_impl.dart ('k') | pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698