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

Side by Side Diff: pkg/compiler/lib/src/universe/resolution_world_builder.dart

Issue 2875313002: Access BackendUsage through ClosedWorld (Closed)
Patch Set: Created 3 years, 7 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
OLDNEW
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 part of world_builder; 5 part of world_builder;
6 6
7 abstract class ResolutionWorldBuilder implements WorldBuilder, OpenWorld { 7 abstract class ResolutionWorldBuilder implements WorldBuilder, OpenWorld {
8 /// Set of all local functions in the program. Used by the mirror tracking 8 /// Set of all local functions in the program. Used by the mirror tracking
9 /// system to find all live closure instances. 9 /// system to find all live closure instances.
10 Iterable<Local> get localFunctions; 10 Iterable<Local> get localFunctions;
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 final Set<FunctionEntity> closurizedMembersWithFreeTypeVariables = 328 final Set<FunctionEntity> closurizedMembersWithFreeTypeVariables =
329 new Set<FunctionEntity>(); 329 new Set<FunctionEntity>();
330 330
331 final ElementEnvironment _elementEnvironment; 331 final ElementEnvironment _elementEnvironment;
332 332
333 final CommonElements _commonElements; 333 final CommonElements _commonElements;
334 334
335 final NativeBasicData _nativeBasicData; 335 final NativeBasicData _nativeBasicData;
336 final NativeDataBuilder _nativeDataBuilder; 336 final NativeDataBuilder _nativeDataBuilder;
337 final InterceptorDataBuilder _interceptorDataBuilder; 337 final InterceptorDataBuilder _interceptorDataBuilder;
338 final BackendUsageBuilder _backendUsageBuilder;
338 339
339 final SelectorConstraintsStrategy selectorConstraintsStrategy; 340 final SelectorConstraintsStrategy selectorConstraintsStrategy;
340 341
341 bool hasRuntimeTypeSupport = false; 342 bool hasRuntimeTypeSupport = false;
342 bool hasIsolateSupport = false; 343 bool hasIsolateSupport = false;
343 bool hasFunctionApplySupport = false; 344 bool hasFunctionApplySupport = false;
344 345
345 bool _closed = false; 346 bool _closed = false;
346 ClosedWorld _closedWorldCache; 347 ClosedWorld _closedWorldCache;
347 FunctionSetBuilder _allFunctions; 348 FunctionSetBuilder _allFunctions;
(...skipping 12 matching lines...) Expand all
360 final Set<ConstantValue> _constantValues = new Set<ConstantValue>(); 361 final Set<ConstantValue> _constantValues = new Set<ConstantValue>();
361 362
362 bool get isClosed => _closed; 363 bool get isClosed => _closed;
363 364
364 ResolutionWorldBuilderBase( 365 ResolutionWorldBuilderBase(
365 this._elementEnvironment, 366 this._elementEnvironment,
366 this._commonElements, 367 this._commonElements,
367 this._nativeBasicData, 368 this._nativeBasicData,
368 this._nativeDataBuilder, 369 this._nativeDataBuilder,
369 this._interceptorDataBuilder, 370 this._interceptorDataBuilder,
371 this._backendUsageBuilder,
370 this.selectorConstraintsStrategy) { 372 this.selectorConstraintsStrategy) {
371 _allFunctions = new FunctionSetBuilder(); 373 _allFunctions = new FunctionSetBuilder();
372 } 374 }
373 375
374 Iterable<ClassEntity> get processedClasses => _processedClasses.keys 376 Iterable<ClassEntity> get processedClasses => _processedClasses.keys
375 .where((cls) => _processedClasses[cls].isInstantiated); 377 .where((cls) => _processedClasses[cls].isInstantiated);
376 378
377 ClosedWorld get closedWorldForTesting { 379 ClosedWorld get closedWorldForTesting {
378 if (!_closed) { 380 if (!_closed) {
379 throw new SpannableAssertionFailure( 381 throw new SpannableAssertionFailure(
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
917 } 919 }
918 920
919 abstract class KernelResolutionWorldBuilderBase 921 abstract class KernelResolutionWorldBuilderBase
920 extends ResolutionWorldBuilderBase { 922 extends ResolutionWorldBuilderBase {
921 KernelResolutionWorldBuilderBase( 923 KernelResolutionWorldBuilderBase(
922 ElementEnvironment elementEnvironment, 924 ElementEnvironment elementEnvironment,
923 CommonElements commonElements, 925 CommonElements commonElements,
924 NativeBasicData nativeBasicData, 926 NativeBasicData nativeBasicData,
925 NativeDataBuilder nativeDataBuilder, 927 NativeDataBuilder nativeDataBuilder,
926 InterceptorDataBuilder interceptorDataBuilder, 928 InterceptorDataBuilder interceptorDataBuilder,
929 BackendUsageBuilder backendUsageBuilder,
927 SelectorConstraintsStrategy selectorConstraintsStrategy) 930 SelectorConstraintsStrategy selectorConstraintsStrategy)
928 : super( 931 : super(
929 elementEnvironment, 932 elementEnvironment,
930 commonElements, 933 commonElements,
931 nativeBasicData, 934 nativeBasicData,
932 nativeDataBuilder, 935 nativeDataBuilder,
933 interceptorDataBuilder, 936 interceptorDataBuilder,
937 backendUsageBuilder,
934 selectorConstraintsStrategy); 938 selectorConstraintsStrategy);
935 939
936 @override 940 @override
937 ClosedWorld closeWorld() { 941 ClosedWorld closeWorld() {
938 Map<ClassEntity, Set<ClassEntity>> typesImplementedBySubclasses = 942 Map<ClassEntity, Set<ClassEntity>> typesImplementedBySubclasses =
939 populateHierarchyNodes(); 943 populateHierarchyNodes();
940 _closed = true; 944 _closed = true;
941 return _closedWorldCache = new KernelClosedWorld( 945 return _closedWorldCache = new KernelClosedWorld(
942 commonElements: _commonElements, 946 commonElements: _commonElements,
943 nativeData: _nativeDataBuilder.close(), 947 nativeData: _nativeDataBuilder.close(),
944 interceptorData: _interceptorDataBuilder.close(), 948 interceptorData: _interceptorDataBuilder.close(),
949 backendUsage: _backendUsageBuilder.close(),
945 // TODO(johnniwinther): Compute these. 950 // TODO(johnniwinther): Compute these.
946 constantSystem: null, 951 constantSystem: null,
947 backendUsage: null,
948 resolutionWorldBuilder: this, 952 resolutionWorldBuilder: this,
949 functionSet: _allFunctions.close(), 953 functionSet: _allFunctions.close(),
950 allTypedefs: _allTypedefs, 954 allTypedefs: _allTypedefs,
951 mixinUses: _mixinUses, 955 mixinUses: _mixinUses,
952 typesImplementedBySubclasses: typesImplementedBySubclasses, 956 typesImplementedBySubclasses: typesImplementedBySubclasses,
953 classHierarchyNodes: _classHierarchyNodes, 957 classHierarchyNodes: _classHierarchyNodes,
954 classSets: _classSets); 958 classSets: _classSets);
955 } 959 }
956 960
957 @override 961 @override
958 void registerClass(ClassEntity cls) { 962 void registerClass(ClassEntity cls) {
959 throw new UnimplementedError('KernelResolutionWorldBuilder.registerClass'); 963 throw new UnimplementedError('KernelResolutionWorldBuilder.registerClass');
960 } 964 }
961 } 965 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/universe/element_world_builder.dart ('k') | pkg/compiler/lib/src/universe/world_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698