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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/compiler.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
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart2js; 5 part of dart2js;
6 6
7 /** 7 /**
8 * If true, print a warning for each method that was resolved, but not 8 * If true, print a warning for each method that was resolved, but not
9 * compiled. 9 * compiled.
10 */ 10 */
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 } 46 }
47 47
48 bool isAnalyzed() => resolutionTree != null; 48 bool isAnalyzed() => resolutionTree != null;
49 } 49 }
50 50
51 // TODO(johnniwinther): Split this class into interface and implementation. 51 // TODO(johnniwinther): Split this class into interface and implementation.
52 // TODO(johnniwinther): Move this implementation to the JS backend. 52 // TODO(johnniwinther): Move this implementation to the JS backend.
53 class CodegenRegistry extends Registry { 53 class CodegenRegistry extends Registry {
54 final Compiler compiler; 54 final Compiler compiler;
55 final TreeElements treeElements; 55 final TreeElements treeElements;
56 DependencyInformation dependencyInfo;
sra1 2014/07/30 21:43:48 Allocate it (the only DependencyInformation) here,
Ty Overby (Google) 2014/08/01 16:39:37 Done. I got rid of DependencyInformation and use D
56 57
57 CodegenRegistry(this.compiler, this.treeElements); 58 CodegenRegistry(this.compiler, this.treeElements) {
59 this.dependencyInfo = compiler.enqueuer.codegen.dependencyInfo;
60 }
58 61
59 bool get isForResolution => false; 62 bool get isForResolution => false;
60 63
61 Element get currentElement => treeElements.currentElement; 64 Element get currentElement => treeElements.currentElement;
62 65
63 // TODO(johnniwinther): Remove this getter when [Registry] creates a 66 // TODO(johnniwinther): Remove this getter when [Registry] creates a
64 // dependency node. 67 // dependency node.
65 Setlet<Element> get otherDependencies => treeElements.otherDependencies; 68 Setlet<Element> get otherDependencies => treeElements.otherDependencies;
66 69
67 CodegenEnqueuer get world => compiler.enqueuer.codegen; 70 CodegenEnqueuer get world => compiler.enqueuer.codegen;
68 js_backend.JavaScriptBackend get backend => compiler.backend; 71 js_backend.JavaScriptBackend get backend => compiler.backend;
69 72
70 void registerDependency(Element element) { 73 void registerDependency(Element element) {
71 treeElements.registerDependency(element); 74 treeElements.registerDependency(element);
72 } 75 }
73 76
74 void registerInstantiatedClass(ClassElement element) { 77 void registerInstantiatedClass(ClassElement element) {
75 world.registerInstantiatedClass(element, this); 78 world.registerInstantiatedClass(element, this);
76 } 79 }
77 80
78 void registerInstantiatedType(InterfaceType type) { 81 void registerInstantiatedType(InterfaceType type) {
79 world.registerInstantiatedType(type, this); 82 world.registerInstantiatedType(type, this);
80 } 83 }
81 84
82 void registerStaticUse(Element element) { 85 void registerStaticUse(Element element) {
83 world.registerStaticUse(element); 86 world.registerStaticUse(element);
84 } 87 }
85 88
86 void registerDynamicInvocation(Selector selector) { 89 void registerDynamicInvocation(Selector selector) {
87 world.registerDynamicInvocation(currentElement, selector); 90 world.registerDynamicInvocation(currentElement, selector);
sra1 2014/07/30 21:43:48 dependencyInfo.elementUsesSelector(currentElement,
Ty Overby (Google) 2014/08/01 16:39:37 Done.
88 } 91 }
89 92
90 void registerDynamicSetter(Selector selector) { 93 void registerDynamicSetter(Selector selector) {
91 world.registerDynamicSetter(currentElement, selector); 94 world.registerDynamicSetter(currentElement, selector);
sra1 2014/07/30 21:43:48 dependencyInfo.elementUsesSelector(currentElement,
Ty Overby (Google) 2014/08/01 16:39:37 Done.
92 } 95 }
93 96
94 void registerDynamicGetter(Selector selector) { 97 void registerDynamicGetter(Selector selector) {
95 world.registerDynamicGetter(currentElement, selector); 98 world.registerDynamicGetter(currentElement, selector);
sra1 2014/07/30 21:43:48 dependencyInfo.elementUsesSelector(currentElement,
Ty Overby (Google) 2014/08/01 16:39:37 Done.
96 } 99 }
97 100
98 void registerGetterForSuperMethod(Element element) { 101 void registerGetterForSuperMethod(Element element) {
99 world.registerGetterForSuperMethod(element); 102 world.registerGetterForSuperMethod(element);
100 } 103 }
101 104
102 void registerFieldGetter(Element element) { 105 void registerFieldGetter(Element element) {
103 world.registerFieldGetter(element); 106 world.registerFieldGetter(element);
104 } 107 }
105 108
(...skipping 1962 matching lines...) Expand 10 before | Expand all | Expand 10 after
2068 static NullSink outputProvider(String name, String extension) { 2071 static NullSink outputProvider(String name, String extension) {
2069 return new NullSink('$name.$extension'); 2072 return new NullSink('$name.$extension');
2070 } 2073 }
2071 } 2074 }
2072 2075
2073 /// Information about suppressed warnings and hints for a given library. 2076 /// Information about suppressed warnings and hints for a given library.
2074 class SuppressionInfo { 2077 class SuppressionInfo {
2075 int warnings = 0; 2078 int warnings = 0;
2076 int hints = 0; 2079 int hints = 0;
2077 } 2080 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698