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

Unified Diff: pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart

Issue 1970703002: Store ResolvedAst on AstElement (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 4 years, 7 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/elements/modelx.dart ('k') | pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart
diff --git a/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart b/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart
index 307857286ca4c930a02cee95839521a828580d82..a65d3e37454b10d0f29a8960e08d8301d9706fca 100644
--- a/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart
+++ b/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart
@@ -47,10 +47,6 @@ abstract class InferrerEngine<T, V extends TypeSystem>
CoreTypes get coreTypes => compiler.coreTypes;
- ResolvedAst getResolvedAst(Element element) {
- return compiler.backend.frontend.getResolvedAst(element.declaration);
- }
-
/**
* Records the default type of parameter [parameter].
*/
@@ -268,7 +264,7 @@ abstract class InferrerEngine<T, V extends TypeSystem>
throw "updateSelector for IR node $node";
}
ast.Node astNode = node;
- TreeElements elements = getResolvedAst(owner).elements;
+ TreeElements elements = owner.resolvedAst.elements;
if (astNode.asSendSet() != null) {
if (selector.isSetter || selector.isIndexSet) {
elements.setTypeMask(node, mask);
@@ -359,12 +355,9 @@ class SimpleTypeInferrerVisitor<T>
compiler,
handler);
- ResolvedAst getResolvedAst(Element element) {
- return compiler.backend.frontend.getResolvedAst(element.declaration);
- }
-
- void analyzeSuperConstructorCall(Element target, ArgumentsTypes arguments) {
- ResolvedAst resolvedAst = getResolvedAst(target);
+ void analyzeSuperConstructorCall(
+ AstElement target, ArgumentsTypes arguments) {
+ ResolvedAst resolvedAst = target.resolvedAst;
inferrer.analyze(resolvedAst, arguments);
isThisExposed = isThisExposed || inferrer.checkIfExposesThis(target);
}
@@ -487,7 +480,7 @@ class SimpleTypeInferrerVisitor<T>
cls.forEachInstanceField((_, FieldElement field) {
if (field.isFinal) return;
T type = locals.fieldScope.readField(field);
- ResolvedAst resolvedAst = getResolvedAst(field);
+ ResolvedAst resolvedAst = field.resolvedAst;
if (type == null && resolvedAst.body == null) {
inferrer.recordTypeOfNonFinalField(
spannable, field, types.nullType);
@@ -565,7 +558,7 @@ class SimpleTypeInferrerVisitor<T>
LocalsHandler closureLocals =
new LocalsHandler<T>.from(locals, node, useOtherTryBlock: false);
SimpleTypeInferrerVisitor visitor = new SimpleTypeInferrerVisitor<T>(
- element, getResolvedAst(element), compiler, inferrer, closureLocals);
+ element, element.resolvedAst, compiler, inferrer, closureLocals);
visitor.run();
inferrer.recordReturnType(element, visitor.returnType);
@@ -667,7 +660,7 @@ class SimpleTypeInferrerVisitor<T>
if (isThisExposed) return;
inferrer.forEachElementMatching(selector, mask, (element) {
if (element.isField) {
- ResolvedAst elementResolvedAst = getResolvedAst(element);
+ ResolvedAst elementResolvedAst = element.resolvedAst;
if (!selector.isSetter &&
isInClassOrSubclass(element) &&
!element.isFinal &&
« no previous file with comments | « pkg/compiler/lib/src/elements/modelx.dart ('k') | pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698