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

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

Issue 1053673004: Handle local get through semantic visitor methods. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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/inferrer/simple_types_inferrer.dart ('k') | no next file » | 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 195b1889b24fde56b7a157ad1c86cce0e7428ea6..2a9b2d79a5aa4ea5b4b0fc7ad2b8eae006b5df6d 100644
--- a/pkg/compiler/lib/src/ssa/builder.dart
+++ b/pkg/compiler/lib/src/ssa/builder.dart
@@ -3302,11 +3302,35 @@ class SsaBuilder extends NewResolvedVisitor {
stack.add(graph.addConstantNull(compiler));
}
} else {
- LocalElement local = element;
- stack.add(localsHandler.readLocal(local));
+ if (send.asSendSet() == null) {
+ internalError(send, "Unhandled local: $element");
+ }
+ // TODO(johnniwinther): Remove this when [generateGetter] is no longer
+ // called from [visitSendSet] (for compound assignments).
+ handleLocalGet(element);
}
}
+ /// Read a local variable, function or parameter.
+ void handleLocalGet(LocalElement local) {
+ stack.add(localsHandler.readLocal(local));
+ }
+
+ @override
+ void visitLocalVariableGet(ast.Send node, LocalVariableElement variable, _) {
+ handleLocalGet(variable);
+ }
+
+ @override
+ void visitParameterGet(ast.Send node, ParameterElement parameter, _) {
+ handleLocalGet(parameter);
+ }
+
+ @override
+ void visitLocalFunctionGet(ast.Send node, LocalFunctionElement function, _) {
+ handleLocalGet(function);
+ }
+
void generateInstanceSetterWithCompiledReceiver(ast.Send send,
HInstruction receiver,
HInstruction value,
« no previous file with comments | « pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698