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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/compilation_info.dart

Issue 430913002: Better dependency tracking (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fix self critiques Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 library dart2js.compilation_info;
2
3 import 'dart2jslib.dart';
4 import 'elements/elements.dart';
5 import 'tree/tree.dart';
6
7
8 abstract class CompilationInformation {
9 factory CompilationInformation(Enqueuer enqueuer, bool dumpInfoEnabled) {
10 if (dumpInfoEnabled) {
11 return new _CompilationInformation(enqueuer);
12 } else {
13 return new _EmptyCompilationInformation();
14 }
15 }
16
17 Map<Element, Set<Element>> get enqueuesMap;
18 Map<Element, Set<Element>> get addsToWorkListMap;
19
20 void enqueues(Element function, Element source) {}
21 void addsToWorkList(Element context, Element element) {}
22 void registerCallSite(TreeElements context, Send node) {}
23 }
24
25 class _EmptyCompilationInformation implements CompilationInformation {
26 _EmptyCompilationInformation();
27 Map<Element, Set<Element>> get enqueuesMap => <Element, Set<Element>>{};
28 Map<Element, Set<Element>> get addsToWorkListMap => <Element, Set<Element>>{};
29
30 void enqueues(Element function, Element source) {}
31 void addsToWorkList(Element context, Element element) {}
32 void registerCallSite(TreeElements context, Send node) {}
33 }
34
35
36 class _CompilationInformation implements CompilationInformation {
37 final String prefix;
38
39 final Map<Element, Set<Element>> enqueuesMap = {};
40 final Map<Element, Set<Element>> addsToWorkListMap = {};
41
42 _CompilationInformation(Enqueuer enqueuer)
43 : prefix = enqueuer.isResolutionQueue ? 'resolution' : 'codegen';
44
45 Set<CallSite> callSites = new Set<CallSite>();
46
47 enqueues(Element function, Element source) {
48 enqueuesMap.putIfAbsent(function, () => new Set())
49 .add(source);
50 }
51
52 addsToWorkList(Element context, Element element) {
53 addsToWorkListMap.putIfAbsent(context, () => new Set())
54 .add(element);
55 }
56
57 registerCallSite(TreeElements context, Send node) {
58 callSites.add(new CallSite(context, node));
59 }
60 }
61
62 class CallSite {
63 final TreeElements context;
64 final Send node;
65 CallSite(this.context, this.node);
66 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698