| OLD | NEW |
| 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 library dart2js.common.codegen; | 5 library dart2js.common.codegen; |
| 6 | 6 |
| 7 import '../elements/elements.dart' | 7 import '../elements/elements.dart' |
| 8 show AsyncMarker, ClassElement, LocalFunctionElement, MemberElement; | 8 show AsyncMarker, ClassElement, LocalFunctionElement; |
| 9 import '../elements/entities.dart'; | 9 import '../elements/entities.dart'; |
| 10 import '../elements/types.dart' show DartType, InterfaceType; | 10 import '../elements/types.dart' show DartType, InterfaceType; |
| 11 import '../universe/use.dart' show ConstantUse, DynamicUse, StaticUse, TypeUse; | 11 import '../universe/use.dart' show ConstantUse, DynamicUse, StaticUse, TypeUse; |
| 12 import '../universe/world_impact.dart' | 12 import '../universe/world_impact.dart' |
| 13 show WorldImpact, WorldImpactBuilderImpl, WorldImpactVisitor; | 13 show WorldImpact, WorldImpactBuilderImpl, WorldImpactVisitor; |
| 14 import '../util/enumset.dart'; | 14 import '../util/enumset.dart'; |
| 15 import '../util/util.dart' show Pair, Setlet; | 15 import '../util/util.dart' show Pair, Setlet; |
| 16 import 'work.dart' show WorkItem; | 16 import 'work.dart' show WorkItem; |
| 17 | 17 |
| 18 class CodegenImpact extends WorldImpact { | 18 class CodegenImpact extends WorldImpact { |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 Iterable<AsyncMarker> get asyncMarkers { | 103 Iterable<AsyncMarker> get asyncMarkers { |
| 104 return _asyncMarkers != null | 104 return _asyncMarkers != null |
| 105 ? _asyncMarkers.iterable(AsyncMarker.values) | 105 ? _asyncMarkers.iterable(AsyncMarker.values) |
| 106 : const <AsyncMarker>[]; | 106 : const <AsyncMarker>[]; |
| 107 } | 107 } |
| 108 } | 108 } |
| 109 | 109 |
| 110 // TODO(johnniwinther): Split this class into interface and implementation. | 110 // TODO(johnniwinther): Split this class into interface and implementation. |
| 111 // TODO(johnniwinther): Move this implementation to the JS backend. | 111 // TODO(johnniwinther): Move this implementation to the JS backend. |
| 112 class CodegenRegistry { | 112 class CodegenRegistry { |
| 113 final MemberElement currentElement; | 113 final MemberEntity currentElement; |
| 114 final _CodegenImpact worldImpact; | 114 final _CodegenImpact worldImpact; |
| 115 | 115 |
| 116 CodegenRegistry(MemberElement currentElement) | 116 CodegenRegistry(this.currentElement) |
| 117 : this.currentElement = currentElement, | 117 : this.worldImpact = new _CodegenImpact(); |
| 118 this.worldImpact = new _CodegenImpact(); | |
| 119 | 118 |
| 120 bool get isForResolution => false; | 119 bool get isForResolution => false; |
| 121 | 120 |
| 122 String toString() => 'CodegenRegistry for $currentElement'; | 121 String toString() => 'CodegenRegistry for $currentElement'; |
| 123 | 122 |
| 124 @deprecated | 123 @deprecated |
| 125 void registerInstantiatedClass(ClassElement element) { | 124 void registerInstantiatedClass(ClassElement element) { |
| 126 registerInstantiation(element.rawType); | 125 registerInstantiation(element.rawType); |
| 127 } | 126 } |
| 128 | 127 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 | 168 |
| 170 void registerAsyncMarker(AsyncMarker asyncMarker) { | 169 void registerAsyncMarker(AsyncMarker asyncMarker) { |
| 171 worldImpact.registerAsyncMarker(asyncMarker); | 170 worldImpact.registerAsyncMarker(asyncMarker); |
| 172 } | 171 } |
| 173 } | 172 } |
| 174 | 173 |
| 175 /// [WorkItem] used exclusively by the [CodegenEnqueuer]. | 174 /// [WorkItem] used exclusively by the [CodegenEnqueuer]. |
| 176 abstract class CodegenWorkItem extends WorkItem { | 175 abstract class CodegenWorkItem extends WorkItem { |
| 177 CodegenRegistry get registry; | 176 CodegenRegistry get registry; |
| 178 } | 177 } |
| OLD | NEW |