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

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

Issue 2777093010: Use entities in NoSuchMethodRegistry (Closed)
Patch Set: Move as cast. Created 3 years, 9 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/kernel/world_builder.dart ('k') | pkg/compiler/lib/src/ssa/kernel_ast_adapter.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 a493c86f3a0576d2b548d8cd39290a9b6eff510f..c957ed0c2340f50a401eb4e2e6df4057037cc251 100644
--- a/pkg/compiler/lib/src/ssa/builder.dart
+++ b/pkg/compiler/lib/src/ssa/builder.dart
@@ -264,8 +264,8 @@ class SsaBuilder extends ast.Visitor
/// Note: this helper is used selectively. When we know that we are in a
/// context were we don't expect to see a constructor body element, we
/// directly fetch the data from the global inference results.
- GlobalTypeInferenceElementResult _resultOf(AstElement element) =>
- inferenceResults.resultOf(
+ GlobalTypeInferenceElementResult _resultOf(MemberElement element) =>
+ inferenceResults.resultOfMember(
element is ConstructorBodyElementX ? element.constructor : element);
/// Build the graph for [target].
@@ -462,7 +462,7 @@ class SsaBuilder extends ast.Visitor
// A generative constructor body is not seen by global analysis,
// so we should not query for its type.
if (!function.isGenerativeConstructorBody) {
- if (inferenceResults.resultOf(function).throwsAlways) {
+ if (inferenceResults.resultOfMember(function).throwsAlways) {
isReachable = false;
return false;
}
@@ -596,7 +596,7 @@ class SsaBuilder extends ast.Visitor
bool isFunctionCalledOnce(MethodElement element) {
// ConstructorBodyElements are not in the type inference graph.
if (element is ConstructorBodyElement) return false;
- return inferenceResults.resultOf(element).isCalledOnce;
+ return inferenceResults.resultOfMember(element).isCalledOnce;
}
bool isCalledOnce(MethodElement element) {
@@ -968,7 +968,7 @@ class SsaBuilder extends ast.Visitor
ResolvedAst oldResolvedAst = resolvedAst;
resolvedAst = callee.resolvedAst;
final oldElementInferenceResults = elementInferenceResults;
- elementInferenceResults = inferenceResults.resultOf(callee);
+ elementInferenceResults = inferenceResults.resultOfMember(callee);
ClosureClassMap oldClosureData = localsHandler.closureData;
ClosureClassMap newClosureData =
compiler.closureToClassMapper.getClosureToClassMapping(resolvedAst);
@@ -1143,7 +1143,7 @@ class SsaBuilder extends ast.Visitor
ResolvedAst savedResolvedAst = resolvedAst;
resolvedAst = fieldResolvedAst;
final oldElementInferenceResults = elementInferenceResults;
- elementInferenceResults = inferenceResults.resultOf(member);
+ elementInferenceResults = inferenceResults.resultOfMember(member);
// In case the field initializer uses closures, run the
// closure to class mapper.
compiler.closureToClassMapper.getClosureToClassMapping(resolvedAst);
@@ -2096,7 +2096,7 @@ class SsaBuilder extends ast.Visitor
// handler in the case of lists, because the constant handler
// does not look at elements in the list.
TypeMask type =
- TypeMaskFactory.inferredTypeForElement(field, globalInferenceResults);
+ TypeMaskFactory.inferredTypeForMember(field, globalInferenceResults);
if (!type.containsAll(closedWorld) && !instruction.isConstantNull()) {
// TODO(13429): The inferrer should know that an element
// cannot be null.
@@ -2124,14 +2124,14 @@ class SsaBuilder extends ast.Visitor
// creating an [HStatic].
HInstruction instruction = new HStatic(
field,
- TypeMaskFactory.inferredTypeForElement(
+ TypeMaskFactory.inferredTypeForMember(
field, globalInferenceResults))
..sourceInformation = sourceInformation;
push(instruction);
}
} else {
HInstruction instruction = new HLazyStatic(field,
- TypeMaskFactory.inferredTypeForElement(field, globalInferenceResults))
+ TypeMaskFactory.inferredTypeForMember(field, globalInferenceResults))
..sourceInformation = sourceInformation;
push(instruction);
}
@@ -4161,7 +4161,7 @@ class SsaBuilder extends ast.Visitor
inputs.addAll(arguments);
TypeMask type;
if (!element.isGetter && selector.isGetter) {
- type = TypeMaskFactory.inferredTypeForElement(
+ type = TypeMaskFactory.inferredTypeForMember(
element, globalInferenceResults);
} else if (element.isFunction) {
type = TypeMaskFactory.inferredReturnTypeForElement(
« no previous file with comments | « pkg/compiler/lib/src/kernel/world_builder.dart ('k') | pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698