| 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.world; | 5 library dart2js.world; |
| 6 | 6 |
| 7 import 'closure.dart' show ClosureClassElement, SynthesizedCallMethodElementX; | 7 import 'closure.dart' show ClosureClassElement, SynthesizedCallMethodElementX; |
| 8 import 'common/backend_api.dart' show BackendClasses; | 8 import 'common/backend_api.dart' show BackendClasses; |
| 9 import 'common.dart'; | 9 import 'common.dart'; |
| 10 import 'constants/constant_system.dart'; | 10 import 'constants/constant_system.dart'; |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 | 291 |
| 292 /// Returns a string representation of the closed world. | 292 /// Returns a string representation of the closed world. |
| 293 /// | 293 /// |
| 294 /// If [cls] is provided, the dump will contain only classes related to [cls]. | 294 /// If [cls] is provided, the dump will contain only classes related to [cls]. |
| 295 String dump([ClassElement cls]); | 295 String dump([ClassElement cls]); |
| 296 } | 296 } |
| 297 | 297 |
| 298 /// Interface for computing side effects and uses of elements. This is used | 298 /// Interface for computing side effects and uses of elements. This is used |
| 299 /// during type inference to compute the [ClosedWorld] for code generation. | 299 /// during type inference to compute the [ClosedWorld] for code generation. |
| 300 abstract class ClosedWorldRefiner { | 300 abstract class ClosedWorldRefiner { |
| 301 /// The closed world being refined. |
| 302 ClosedWorld get closedWorld; |
| 303 |
| 301 /// Registers the side [effects] of executing [element]. | 304 /// Registers the side [effects] of executing [element]. |
| 302 void registerSideEffects(Element element, SideEffects effects); | 305 void registerSideEffects(Element element, SideEffects effects); |
| 303 | 306 |
| 304 /// Registers the executing of [element] as without side effects. | 307 /// Registers the executing of [element] as without side effects. |
| 305 void registerSideEffectsFree(Element element); | 308 void registerSideEffectsFree(Element element); |
| 306 | 309 |
| 307 /// Returns the currently known side effects of executing [element]. | 310 /// Returns the currently known side effects of executing [element]. |
| 308 SideEffects getCurrentlyKnownSideEffects(Element element); | 311 SideEffects getCurrentlyKnownSideEffects(Element element); |
| 309 | 312 |
| 310 /// Registers that [element] might be passed to `Function.apply`. | 313 /// Registers that [element] might be passed to `Function.apply`. |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 this._resolverWorld = resolverWorld, | 412 this._resolverWorld = resolverWorld, |
| 410 this._allTypedefs = allTypedefs, | 413 this._allTypedefs = allTypedefs, |
| 411 this._mixinUses = mixinUses, | 414 this._mixinUses = mixinUses, |
| 412 this._typesImplementedBySubclasses = typesImplementedBySubclasses, | 415 this._typesImplementedBySubclasses = typesImplementedBySubclasses, |
| 413 this._classHierarchyNodes = classHierarchyNodes, | 416 this._classHierarchyNodes = classHierarchyNodes, |
| 414 this._classSets = classSets { | 417 this._classSets = classSets { |
| 415 _commonMasks = new CommonMasks(this); | 418 _commonMasks = new CommonMasks(this); |
| 416 _allFunctions = functionSetBuilder.close(this); | 419 _allFunctions = functionSetBuilder.close(this); |
| 417 } | 420 } |
| 418 | 421 |
| 422 @override |
| 423 ClosedWorld get closedWorld => this; |
| 424 |
| 419 /// Cache of [FlatTypeMask]s grouped by the 8 possible values of the | 425 /// Cache of [FlatTypeMask]s grouped by the 8 possible values of the |
| 420 /// `FlatTypeMask.flags` property. | 426 /// `FlatTypeMask.flags` property. |
| 421 final List<Map<ClassElement, TypeMask>> _canonicalizedTypeMasks = | 427 final List<Map<ClassElement, TypeMask>> _canonicalizedTypeMasks = |
| 422 new List<Map<ClassElement, TypeMask>>.filled(8, null); | 428 new List<Map<ClassElement, TypeMask>>.filled(8, null); |
| 423 | 429 |
| 424 FunctionSet get allFunctions => _allFunctions; | 430 FunctionSet get allFunctions => _allFunctions; |
| 425 | 431 |
| 426 CommonMasks get commonMasks { | 432 CommonMasks get commonMasks { |
| 427 assert(isClosed); | 433 assert(isClosed); |
| 428 return _commonMasks; | 434 return _commonMasks; |
| (...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1103 return getMightBePassedToApply(element.expression); | 1109 return getMightBePassedToApply(element.expression); |
| 1104 } | 1110 } |
| 1105 return functionsThatMightBePassedToApply.contains(element); | 1111 return functionsThatMightBePassedToApply.contains(element); |
| 1106 } | 1112 } |
| 1107 | 1113 |
| 1108 @override | 1114 @override |
| 1109 bool getCurrentlyKnownMightBePassedToApply(Element element) { | 1115 bool getCurrentlyKnownMightBePassedToApply(Element element) { |
| 1110 return getMightBePassedToApply(element); | 1116 return getMightBePassedToApply(element); |
| 1111 } | 1117 } |
| 1112 } | 1118 } |
| OLD | NEW |