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

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

Issue 2963983002: Further splitting of inference type-info (Closed)
Patch Set: Updated cf. comments. Created 3 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
« no previous file with comments | « pkg/compiler/lib/src/inferrer/type_graph_nodes.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/inferrer/type_system.dart
diff --git a/pkg/compiler/lib/src/inferrer/type_system.dart b/pkg/compiler/lib/src/inferrer/type_system.dart
index 41979790116d57bdb1b9a5bd43bc6d5990c7f6b4..14703c1350f02ec762c726136467e61454f2c683 100644
--- a/pkg/compiler/lib/src/inferrer/type_system.dart
+++ b/pkg/compiler/lib/src/inferrer/type_system.dart
@@ -353,13 +353,17 @@ class TypeSystem {
});
}
- String getInferredSignatureOf(FunctionElement function) {
- ElementTypeInformation info;
- if (function.isLocal) {
- info = getInferredTypeOfLocalFunction(function);
- } else {
- info = getInferredTypeOfMember(function as MethodElement);
- }
+ String getInferredSignatureOfLocalFunction(LocalFunctionElement function) {
+ return _getInferredSignatureOf(
+ getInferredTypeOfLocalFunction(function), function);
+ }
+
+ String getInferredSignatureOfMethod(MethodElement function) {
+ return _getInferredSignatureOf(getInferredTypeOfMember(function), function);
+ }
+
+ String _getInferredSignatureOf(
+ ElementTypeInformation info, FunctionElement function) {
FunctionElement impl = function.implementation;
FunctionSignature signature = impl.functionSignature;
var res = "";
@@ -420,7 +424,20 @@ class TypeSystem {
new ListTypeInformation(currentMember, mask, element, length);
}
- TypeInformation allocateClosure(ast.Node node, Element element) {
+ /// Creates a [TypeInformation] object for the local function [element] of
+ /// a function expression or local function declaration used as a closure.
+ TypeInformation allocateClosureForLocalFunction(
+ ast.Node node, LocalFunctionElement element) {
+ TypeInformation result =
+ new LocalFunctionClosureTypeInformation(currentMember, node, element);
+ allocatedClosures.add(result);
+ return result;
+ }
+
+ /// Creates a [TypeInformation] object for the closurization of a static or
+ /// top-level method [element] used a function constant.
+ TypeInformation allocateClosureForMethod(
+ ast.Node node, MethodElement element) {
TypeInformation result =
new ClosureTypeInformation(currentMember, node, element);
allocatedClosures.add(result);
« no previous file with comments | « pkg/compiler/lib/src/inferrer/type_graph_nodes.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698