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

Unified Diff: sdk/lib/_internal/compiler/implementation/ir/ir_builder.dart

Issue 233153002: Support assignment to parameters in the dart2dart backend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed argument order. Oops. Created 6 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 | « sdk/lib/_internal/compiler/implementation/dart_backend/dart_tree.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/ir/ir_builder.dart
diff --git a/sdk/lib/_internal/compiler/implementation/ir/ir_builder.dart b/sdk/lib/_internal/compiler/implementation/ir/ir_builder.dart
index 758a0c971bbb5e7bc48ad31dc5e58cf78fb15fee..7057a5504a20b48230475302e44b897bf3a0e5eb 100644
--- a/sdk/lib/_internal/compiler/implementation/ir/ir_builder.dart
+++ b/sdk/lib/_internal/compiler/implementation/ir/ir_builder.dart
@@ -351,13 +351,7 @@ class IrBuilder extends ResolvedVisitor<ir.Definition> {
ir.Definition visitGetterSend(ast.Send node) {
Element element = elements[node];
- if ((element != null && element.isForeign(compiler))
- || Elements.isStaticOrTopLevelField(element)
- || Elements.isInstanceSend(node, elements)
- || Elements.isStaticOrTopLevelFunction(element)
- || Elements.isErroneousElement(element)) {
- return giveup();
- }
+ if (!Elements.isLocal(element)) return giveup();
return assignedVars[variableIndex[element]];
}
@@ -420,6 +414,17 @@ class IrBuilder extends ResolvedVisitor<ir.Definition> {
return giveup();
}
+ ir.Definition visitSendSet(ast.SendSet node) {
+ Element element = elements[node];
+ if (!Elements.isLocal(element)) return giveup();
+ if (node.assignmentOperator.source != '=') return giveup();
+ // Exactly one argument expected for a simple assignment.
+ assert(!node.arguments.isEmpty && node.arguments.tail.isEmpty);
+ ir.Definition result = node.arguments.head.accept(this);
+ assignedVars[variableIndex[element]] = result;
+ return result;
+ }
+
static final String ABORT_IRNODE_BUILDER = "IrNode builder aborted";
ir.Definition giveup() => throw ABORT_IRNODE_BUILDER;
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/dart_backend/dart_tree.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698