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

Unified Diff: sdk/lib/_internal/compiler/implementation/compilation_info.dart

Issue 382063002: Redo "Information about which functions require other functions is gathered in the enqueuer." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase Created 6 years, 5 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: sdk/lib/_internal/compiler/implementation/compilation_info.dart
diff --git a/sdk/lib/_internal/compiler/implementation/compilation_info.dart b/sdk/lib/_internal/compiler/implementation/compilation_info.dart
new file mode 100644
index 0000000000000000000000000000000000000000..befa90f294cf71081c28b712960195944ccea95e
--- /dev/null
+++ b/sdk/lib/_internal/compiler/implementation/compilation_info.dart
@@ -0,0 +1,63 @@
+library dart2js.compilation_info;
+
+import 'dart2jslib.dart';
+import 'elements/elements.dart';
+import 'tree/tree.dart';
+
+
+class CompilationInformation {
+ static const DUMP_COMPILATION_INFO_DATABASE = true;
+
+ CompilationInformation._internal();
+
+ factory CompilationInformation(Enqueuer enqueuer) {
+ if (DUMP_COMPILATION_INFO_DATABASE) {
+ return new _CompilationInformation(enqueuer);
+ } else {
+ return new CompilationInformation._internal();
+ }
+ }
+
+
+ Map<String, Map<dynamic, Set>> relations = {};
+
+ void enqueues(Element function, Element source) {}
+ void addsToWorkList(Element context, Element element) {}
+ void registerCallSite(TreeElements context, Send node) {}
+}
+
+
+class _CompilationInformation implements CompilationInformation {
+ final String prefix;
+
+ Map<String, Map<dynamic, Set>> relations = {};
+
+ _CompilationInformation(Enqueuer enqueuer)
+ : prefix = enqueuer.isResolutionQueue ? 'resolution' : 'codegen';
+
+ Set<CallSite> callSites = new Set<CallSite>();
+
+ put(String relation, target, source) {
+ relations.putIfAbsent(relation, () => {})
+ .putIfAbsent(target, () => new Set())
+ .add(source);
+ }
+
+ enqueues(Element function, Element source) {
+ put('enqueues', function, source);
+ }
+
+ addsToWorkList(Element context, Element element) {
+ put('addsToWorklist', context, element);
+ }
+
+ registerCallSite(TreeElements context, Send node) {
+ callSites.add(new CallSite(context, node));
+ }
+}
+
+class CallSite {
+ final TreeElements context;
+ final Send node;
+ CallSite(this.context, this.node);
+}

Powered by Google App Engine
This is Rietveld 408576698