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

Unified Diff: pkg/compiler/lib/src/closure.dart

Issue 2939163002: Modify backend strategy and how we access the closure converter. (Closed)
Patch Set: . 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/backend_strategy.dart ('k') | pkg/compiler/lib/src/compiler.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/closure.dart
diff --git a/pkg/compiler/lib/src/closure.dart b/pkg/compiler/lib/src/closure.dart
index 2ae7bd0834f8299928f9fc134e72774a6f2c9520..c69a01510b29c4277aadc82cb45fd0e8f3636073 100644
--- a/pkg/compiler/lib/src/closure.dart
+++ b/pkg/compiler/lib/src/closure.dart
@@ -4,7 +4,7 @@
import 'common/names.dart' show Identifiers;
import 'common/resolution.dart' show ParsingContext, Resolution;
-import 'common/tasks.dart' show CompilerTask;
+import 'common/tasks.dart' show CompilerTask, Measurer;
import 'common.dart';
import 'compiler.dart' show Compiler;
import 'constants/expressions.dart';
@@ -23,6 +23,15 @@ import 'tree/tree.dart';
import 'util/util.dart';
import 'world.dart' show ClosedWorldRefiner;
+abstract class ClosureConversionTask<T> extends CompilerTask
+ implements ClosureDataLookup<T> {
+ ClosureConversionTask(Measurer measurer) : super(measurer);
+
+ //void analyzeClosures();
+ void convertClosures(Iterable<MemberEntity> processedEntities,
+ ClosedWorldRefiner closedWorldRefiner);
+}
+
/// Class that provides information for how closures are rewritten/represented
/// to preserve Dart semantics when compiled to JavaScript. Given a particular
/// node to look up, it returns a information about the internal representation
@@ -198,7 +207,7 @@ class ClosureRepresentationInfo {
bool get isClosure => false;
}
-class ClosureTask extends CompilerTask implements ClosureDataLookup<Node> {
+class ClosureTask extends ClosureConversionTask<Node> {
Map<Node, ClosureScope> _closureInfoMap = <Node, ClosureScope>{};
Map<Element, ClosureClassMap> _closureMappingCache =
<Element, ClosureClassMap>{};
@@ -211,6 +220,11 @@ class ClosureTask extends CompilerTask implements ClosureDataLookup<Node> {
DiagnosticReporter get reporter => compiler.reporter;
+ void convertClosures(Iterable<MemberEntity> processedEntities,
+ ClosedWorldRefiner closedWorldRefiner) {
+ createClosureClasses(closedWorldRefiner);
+ }
+
ClosureAnalysisInfo getClosureAnalysisInfo(Node node) {
var value = _closureInfoMap[node];
return value == null ? const ClosureAnalysisInfo() : value;
« no previous file with comments | « pkg/compiler/lib/src/backend_strategy.dart ('k') | pkg/compiler/lib/src/compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698