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

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

Issue 1303503002: Refactor updates of locals. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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/resolution/members.dart ('k') | tests/compiler/dart2js/resolver_test.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 6021ffcbecdb4207af86a1ec257d66a322da61fe..2560ada8870bc0408f46fe10cd7a99f95b4489dd 100644
--- a/pkg/compiler/lib/src/ssa/builder.dart
+++ b/pkg/compiler/lib/src/ssa/builder.dart
@@ -3613,6 +3613,17 @@ class SsaBuilder extends ast.Visitor
stack.add(value);
}
+ void generateNoSuchSetter(ast.Node location,
+ Element element,
+ HInstruction value) {
+ List<HInstruction> arguments =
+ value == null ? const <HInstruction>[] : <HInstruction>[value];
+ // An erroneous element indicates an unresolved static setter.
+ generateThrowNoSuchMethod(
+ location, noSuchMethodTargetSymbolString(element, 'set'),
+ argumentValues: arguments);
+ }
+
void generateNonInstanceSetter(ast.SendSet send,
Element element,
HInstruction value,
@@ -3634,12 +3645,7 @@ class SsaBuilder extends ast.Visitor
stack.add(value);
} else if (Elements.isErroneous(element)) {
if (element is ErroneousElement) {
- List<HInstruction> arguments =
- send == null ? const <HInstruction>[] : <HInstruction>[value];
- // An erroneous element indicates an unresolved static setter.
- generateThrowNoSuchMethod(
- location, noSuchMethodTargetSymbolString(element, 'set'),
- argumentValues: arguments);
+ generateNoSuchSetter(location, element, send == null ? null : value);
} else {
// TODO(ahe): Do something like [generateWrongArgumentCountError].
stack.add(graph.addConstantNull(compiler));
@@ -6405,7 +6411,7 @@ class SsaBuilder extends ast.Visitor
ParameterElement parameter,
ast.Node rhs,
_) {
- generateNonInstanceSetter(node, parameter, visitAndPop(rhs));
+ generateNoSuchSetter(node, parameter, visitAndPop(rhs));
}
@override
@@ -6423,7 +6429,7 @@ class SsaBuilder extends ast.Visitor
LocalVariableElement variable,
ast.Node rhs,
_) {
- generateNonInstanceSetter(node, variable, visitAndPop(rhs));
+ generateNoSuchSetter(node, variable, visitAndPop(rhs));
}
@override
@@ -6432,7 +6438,7 @@ class SsaBuilder extends ast.Visitor
LocalFunctionElement function,
ast.Node rhs,
_) {
- generateNonInstanceSetter(node, function, visitAndPop(rhs));
+ generateNoSuchSetter(node, function, visitAndPop(rhs));
}
@override
@@ -6933,13 +6939,14 @@ class SsaBuilder extends ast.Visitor
!link.isEmpty;
link = link.tail) {
ast.Node definition = link.head;
+ LocalElement local = elements[definition];
if (definition is ast.Identifier) {
HInstruction initialValue = graph.addConstantNull(compiler);
- LocalElement local = elements[definition];
localsHandler.updateLocal(local, initialValue);
} else {
- assert(definition is ast.SendSet);
- visitSendSet(definition);
+ ast.SendSet node = definition;
+ generateNonInstanceSetter(
+ node, local, visitAndPop(node.arguments.first));
pop(); // Discard value.
}
}
« no previous file with comments | « pkg/compiler/lib/src/resolution/members.dart ('k') | tests/compiler/dart2js/resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698