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

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

Issue 1160313006: Revert "Refactoring resolution of local access and unqualified access of statics" (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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
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 36559276a7d9625beedff83d3f9dc8b3ff055425..b2dcb8aac502618526bb1720db597f8b23d3871b 100644
--- a/pkg/compiler/lib/src/ssa/builder.dart
+++ b/pkg/compiler/lib/src/ssa/builder.dart
@@ -1322,12 +1322,9 @@ class SsaBuilder extends NewResolvedVisitor {
bool meetsHardConstraints() {
if (compiler.disableInlining) return false;
- assert(invariant(
- currentNode != null ? currentNode : element,
- selector != null ||
- Elements.isStaticOrTopLevel(element) ||
- element.isGenerativeConstructorBody,
- message: "Missing selector for inlining of $element."));
+ assert(selector != null
+ || Elements.isStaticOrTopLevel(element)
+ || element.isGenerativeConstructorBody);
if (selector != null && !selector.applies(function, compiler.world)) {
return false;
}
@@ -3249,7 +3246,8 @@ class SsaBuilder extends NewResolvedVisitor {
return pop();
}
- String noSuchMethodTargetSymbolString(Element error, [String prefix]) {
+ String noSuchMethodTargetSymbolString(ErroneousElement error,
+ [String prefix]) {
String result = error.name;
if (prefix == "set") return "$result=";
return result;
@@ -3290,18 +3288,14 @@ class SsaBuilder extends NewResolvedVisitor {
node);
}
- void handleInvalidStaticGet(ast.Send node, Element element) {
- generateThrowNoSuchMethod(
- node,
- noSuchMethodTargetSymbolString(element, 'get'),
- argumentNodes: const Link<ast.Node>());
- }
-
/// Generate read access of an unresolved static or top level entity.
void generateStaticUnresolvedGet(ast.Send node, Element element) {
if (element is ErroneousElement) {
// An erroneous element indicates an unresolved static getter.
- handleInvalidStaticGet(node, element);
+ generateThrowNoSuchMethod(
+ node,
+ noSuchMethodTargetSymbolString(element, 'get'),
+ argumentNodes: const Link<ast.Node>());
} else {
// This happens when [element] has parse errors.
assert(invariant(node, element == null || element.isErroneous));
@@ -5153,22 +5147,6 @@ class SsaBuilder extends NewResolvedVisitor {
}
@override
- void visitTopLevelSetterGet(
- ast.Send node,
- MethodElement setter,
- _) {
- handleInvalidStaticGet(node, setter);
- }
-
- @override
- void visitStaticSetterGet(
- ast.Send node,
- MethodElement setter,
- _) {
- handleInvalidStaticGet(node, setter);
- }
-
- @override
void visitUnresolvedGet(
ast.Send node,
Element element,
@@ -5176,32 +5154,6 @@ class SsaBuilder extends NewResolvedVisitor {
generateStaticUnresolvedGet(node, element);
}
- void handleInvalidStaticInvoke(ast.Send node, Element element) {
- generateThrowNoSuchMethod(node,
- noSuchMethodTargetSymbolString(element),
- argumentNodes: node.arguments);
- }
-
- @override
- void visitStaticSetterInvoke(
- ast.Send node,
- MethodElement setter,
- ast.NodeList arguments,
- CallStructure callStructure,
- _) {
- handleInvalidStaticInvoke(node, setter);
- }
-
- @override
- void visitTopLevelSetterInvoke(
- ast.Send node,
- MethodElement setter,
- ast.NodeList arguments,
- CallStructure callStructure,
- _) {
- handleInvalidStaticInvoke(node, setter);
- }
-
@override
void visitUnresolvedInvoke(
ast.Send node,
@@ -5212,7 +5164,9 @@ class SsaBuilder extends NewResolvedVisitor {
if (element is ErroneousElement) {
// An erroneous element indicates that the funciton could not be
// resolved (a warning has been issued).
- handleInvalidStaticInvoke(node, element);
+ generateThrowNoSuchMethod(node,
+ noSuchMethodTargetSymbolString(element),
+ argumentNodes: node.arguments);
} else {
// TODO(ahe): Do something like [generateWrongArgumentCountError].
stack.add(graph.addConstantNull(compiler));
« no previous file with comments | « pkg/compiler/lib/src/resolution/resolution_common.dart ('k') | tests/compiler/dart2js/diagnose_ambiguous_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698