OLD | NEW |
(Empty) | |
| 1 library dart2js.compilation_info; |
| 2 |
| 3 import 'dart2jslib.dart'; |
| 4 import 'elements/elements.dart'; |
| 5 import 'tree/tree.dart'; |
| 6 |
| 7 |
| 8 class CompilationInformation { |
| 9 static const DUMP_COMPILATION_INFO_DATABASE = true; |
| 10 |
| 11 CompilationInformation._internal(); |
| 12 |
| 13 factory CompilationInformation(Enqueuer enqueuer) { |
| 14 if (DUMP_COMPILATION_INFO_DATABASE) { |
| 15 return new _CompilationInformation(enqueuer); |
| 16 } else { |
| 17 return new CompilationInformation._internal(); |
| 18 } |
| 19 } |
| 20 |
| 21 |
| 22 Map<String, Map<dynamic, Set>> relations = {}; |
| 23 |
| 24 void enqueues(Element function, Element source) {} |
| 25 void addsToWorkList(Element context, Element element) {} |
| 26 void registerCallSite(TreeElements context, Send node) {} |
| 27 } |
| 28 |
| 29 |
| 30 class _CompilationInformation implements CompilationInformation { |
| 31 final String prefix; |
| 32 |
| 33 Map<String, Map<dynamic, Set>> relations = {}; |
| 34 |
| 35 _CompilationInformation(Enqueuer enqueuer) |
| 36 : prefix = enqueuer.isResolutionQueue ? 'resolution' : 'codegen'; |
| 37 |
| 38 Set<CallSite> callSites = new Set<CallSite>(); |
| 39 |
| 40 put(String relation, target, source) { |
| 41 relations.putIfAbsent(relation, () => {}) |
| 42 .putIfAbsent(target, () => new Set()) |
| 43 .add(source); |
| 44 } |
| 45 |
| 46 enqueues(Element function, Element source) { |
| 47 put('enqueues', function, source); |
| 48 } |
| 49 |
| 50 addsToWorkList(Element context, Element element) { |
| 51 put('addsToWorklist', context, element); |
| 52 } |
| 53 |
| 54 registerCallSite(TreeElements context, Send node) { |
| 55 callSites.add(new CallSite(context, node)); |
| 56 } |
| 57 } |
| 58 |
| 59 class CallSite { |
| 60 final TreeElements context; |
| 61 final Send node; |
| 62 CallSite(this.context, this.node); |
| 63 } |
OLD | NEW |