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

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

Issue 1292673005: Refactor handling of unqualified static updates. (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/registry.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..83d75805d34a78e33cae4ac2628a65d9ca4cf8ec 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));
@@ -6462,7 +6468,7 @@ class SsaBuilder extends ast.Visitor
ast.Node rhs,
_) {
generateIsDeferredLoadedCheckOfSend(node);
- generateNonInstanceSetter(node, getter, visitAndPop(rhs));
+ generateNoSuchSetter(node, getter, visitAndPop(rhs));
}
@override
@@ -6482,7 +6488,7 @@ class SsaBuilder extends ast.Visitor
ast.Node rhs,
_) {
generateIsDeferredLoadedCheckOfSend(node);
- generateNonInstanceSetter(node, function, visitAndPop(rhs));
+ generateNoSuchSetter(node, function, visitAndPop(rhs));
}
@override
@@ -6512,7 +6518,7 @@ class SsaBuilder extends ast.Visitor
ast.Node rhs,
_) {
generateIsDeferredLoadedCheckOfSend(node);
- generateNonInstanceSetter(node, getter, visitAndPop(rhs));
+ generateNoSuchSetter(node, getter, visitAndPop(rhs));
}
@override
@@ -6532,7 +6538,7 @@ class SsaBuilder extends ast.Visitor
ast.Node rhs,
_) {
generateIsDeferredLoadedCheckOfSend(node);
- generateNonInstanceSetter(node, function, visitAndPop(rhs));
+ generateNoSuchSetter(node, function, visitAndPop(rhs));
}
@override
« no previous file with comments | « pkg/compiler/lib/src/resolution/registry.dart ('k') | tests/compiler/dart2js/resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698