| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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.kernel.frontend_strategy; | 5 library dart2js.kernel.frontend_strategy; |
| 6 | 6 |
| 7 import '../closure.dart'; | 7 import '../closure.dart'; |
| 8 import '../common.dart'; | 8 import '../common.dart'; |
| 9 import '../common_elements.dart'; | 9 import '../common_elements.dart'; |
| 10 import '../common/backend_api.dart'; | 10 import '../common/backend_api.dart'; |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 } | 91 } |
| 92 | 92 |
| 93 /// Computes the main function from [mainLibrary] adding additional world | 93 /// Computes the main function from [mainLibrary] adding additional world |
| 94 /// impact to [impactBuilder]. | 94 /// impact to [impactBuilder]. |
| 95 FunctionEntity computeMain( | 95 FunctionEntity computeMain( |
| 96 LibraryEntity mainLibrary, WorldImpactBuilder impactBuilder) { | 96 LibraryEntity mainLibrary, WorldImpactBuilder impactBuilder) { |
| 97 return elementEnvironment.mainFunction; | 97 return elementEnvironment.mainFunction; |
| 98 } | 98 } |
| 99 | 99 |
| 100 MirrorsDataBuilder createMirrorsDataBuilder() { | 100 MirrorsDataBuilder createMirrorsDataBuilder() { |
| 101 return new MirrorsDataBuilderImpl(elementMap.commonElements); | 101 return new MirrorsDataBuilderImpl(elementEnvironment, commonElements); |
| 102 } | 102 } |
| 103 | 103 |
| 104 MirrorsResolutionAnalysis createMirrorsResolutionAnalysis( | 104 MirrorsResolutionAnalysis createMirrorsResolutionAnalysis( |
| 105 JavaScriptBackend backend) { | 105 JavaScriptBackend backend) { |
| 106 return new MirrorsResolutionAnalysisImpl(); | 106 return new MirrorsResolutionAnalysisImpl(); |
| 107 } | 107 } |
| 108 | 108 |
| 109 RuntimeTypesNeedBuilder createRuntimeTypesNeedBuilder() { | 109 RuntimeTypesNeedBuilder createRuntimeTypesNeedBuilder() { |
| 110 return new RuntimeTypesNeedBuilderImpl( | 110 return new RuntimeTypesNeedBuilderImpl( |
| 111 elementEnvironment, _elementMap.types); | 111 elementEnvironment, _elementMap.types); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 @override | 174 @override |
| 175 WorldImpact run() { | 175 WorldImpact run() { |
| 176 _nativeMemberResolver.resolveNativeMember(element); | 176 _nativeMemberResolver.resolveNativeMember(element); |
| 177 ResolutionImpact impact = _elementMap.computeWorldImpact(element); | 177 ResolutionImpact impact = _elementMap.computeWorldImpact(element); |
| 178 return _impactTransformer.transformResolutionImpact(impact); | 178 return _impactTransformer.transformResolutionImpact(impact); |
| 179 } | 179 } |
| 180 } | 180 } |
| 181 | 181 |
| 182 /// Mock implementation of [MirrorsDataImpl]. | 182 /// Mock implementation of [MirrorsDataImpl]. |
| 183 class MirrorsDataBuilderImpl extends MirrorsDataImpl { | 183 class MirrorsDataBuilderImpl extends MirrorsDataImpl { |
| 184 MirrorsDataBuilderImpl(CommonElements commonElements) | 184 MirrorsDataBuilderImpl( |
| 185 : super(null, null, commonElements); | 185 ElementEnvironment elementEnvironment, CommonElements commonElements) |
| 186 : super(null, null, elementEnvironment, commonElements); |
| 186 | 187 |
| 187 @override | 188 @override |
| 188 void registerUsedMember(MemberEntity member) {} | 189 void registerUsedMember(MemberEntity member) {} |
| 189 | 190 |
| 190 @override | 191 @override |
| 191 void computeMembersNeededForReflection( | 192 void computeMembersNeededForReflection( |
| 192 ResolutionWorldBuilder worldBuilder, ClosedWorld closedWorld) { | 193 ResolutionWorldBuilder worldBuilder, ClosedWorld closedWorld) { |
| 193 // TODO(redemption): Support dart:mirrors. | 194 // TODO(redemption): Support dart:mirrors. |
| 194 createImmutableSets(); | 195 createImmutableSets(); |
| 195 } | 196 } |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 int get preMirrorsMethodCount { | 229 int get preMirrorsMethodCount { |
| 229 // TODO(redemption): Implement this. | 230 // TODO(redemption): Implement this. |
| 230 return null; | 231 return null; |
| 231 } | 232 } |
| 232 | 233 |
| 233 @override | 234 @override |
| 234 void onQueueEmpty(Enqueuer enqueuer, Iterable<ClassEntity> recentClasses) { | 235 void onQueueEmpty(Enqueuer enqueuer, Iterable<ClassEntity> recentClasses) { |
| 235 // TODO(redemption): Implement this. | 236 // TODO(redemption): Implement this. |
| 236 } | 237 } |
| 237 } | 238 } |
| OLD | NEW |