| 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.dart'; | 8 import 'common.dart'; |
| 9 import 'constants/constant_system.dart'; | 9 import 'constants/constant_system.dart'; |
| 10 import 'common_elements.dart' show CommonElements; | 10 import 'common_elements.dart' show CommonElements; |
| (...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1031 } | 1031 } |
| 1032 } else { | 1032 } else { |
| 1033 sideEffects.add(getSideEffectsOfElement(e)); | 1033 sideEffects.add(getSideEffectsOfElement(e)); |
| 1034 } | 1034 } |
| 1035 } | 1035 } |
| 1036 return sideEffects; | 1036 return sideEffects; |
| 1037 } | 1037 } |
| 1038 | 1038 |
| 1039 SideEffects getSideEffectsOfElement(Entity element) { | 1039 SideEffects getSideEffectsOfElement(Entity element) { |
| 1040 assert(_checkEntity(element)); | 1040 assert(_checkEntity(element)); |
| 1041 return _sideEffects.putIfAbsent(element, () { | 1041 return _sideEffects.putIfAbsent(element, _makeSideEffects); |
| 1042 return new SideEffects(); | |
| 1043 }); | |
| 1044 } | 1042 } |
| 1045 | 1043 |
| 1044 static _makeSideEffects() => new SideEffects(); |
| 1045 |
| 1046 @override | 1046 @override |
| 1047 SideEffects getCurrentlyKnownSideEffects(Entity element) { | 1047 SideEffects getCurrentlyKnownSideEffects(Entity element) { |
| 1048 return getSideEffectsOfElement(element); | 1048 return getSideEffectsOfElement(element); |
| 1049 } | 1049 } |
| 1050 | 1050 |
| 1051 void registerSideEffects(Entity element, SideEffects effects) { | 1051 void registerSideEffects(Entity element, SideEffects effects) { |
| 1052 assert(_checkEntity(element)); | 1052 assert(_checkEntity(element)); |
| 1053 if (_sideEffectsFreeElements.contains(element)) return; | 1053 if (_sideEffectsFreeElements.contains(element)) return; |
| 1054 _sideEffects[element] = effects; | 1054 _sideEffects[element] = effects; |
| 1055 } | 1055 } |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1339 @override | 1339 @override |
| 1340 void registerClosureClass(ClassElement cls) { | 1340 void registerClosureClass(ClassElement cls) { |
| 1341 throw new UnimplementedError('KernelClosedWorld.registerClosureClass'); | 1341 throw new UnimplementedError('KernelClosedWorld.registerClosureClass'); |
| 1342 } | 1342 } |
| 1343 | 1343 |
| 1344 @override | 1344 @override |
| 1345 bool hasElementIn(ClassEntity cls, Selector selector, Entity element) { | 1345 bool hasElementIn(ClassEntity cls, Selector selector, Entity element) { |
| 1346 throw new UnimplementedError('KernelClosedWorld.hasElementIn'); | 1346 throw new UnimplementedError('KernelClosedWorld.hasElementIn'); |
| 1347 } | 1347 } |
| 1348 } | 1348 } |
| OLD | NEW |