| 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 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1061 | 1061 |
| 1062 void registerSideEffectsFree(Element element) { | 1062 void registerSideEffectsFree(Element element) { |
| 1063 sideEffects[element.declaration] = new SideEffects.empty(); | 1063 sideEffects[element.declaration] = new SideEffects.empty(); |
| 1064 sideEffectsFreeElements.add(element); | 1064 sideEffectsFreeElements.add(element); |
| 1065 } | 1065 } |
| 1066 | 1066 |
| 1067 SideEffects getSideEffectsOfSelector(Selector selector, TypeMask mask) { | 1067 SideEffects getSideEffectsOfSelector(Selector selector, TypeMask mask) { |
| 1068 // We're not tracking side effects of closures. | 1068 // We're not tracking side effects of closures. |
| 1069 if (selector.isClosureCall) return new SideEffects(); | 1069 if (selector.isClosureCall) return new SideEffects(); |
| 1070 SideEffects sideEffects = new SideEffects.empty(); | 1070 SideEffects sideEffects = new SideEffects.empty(); |
| 1071 for (Element e in allFunctions.filter(selector, mask)) { | 1071 for (MemberElement e in allFunctions.filter(selector, mask)) { |
| 1072 if (e.isField) { | 1072 if (e.isField) { |
| 1073 if (selector.isGetter) { | 1073 if (selector.isGetter) { |
| 1074 if (!fieldNeverChanges(e)) { | 1074 if (!fieldNeverChanges(e)) { |
| 1075 sideEffects.setDependsOnInstancePropertyStore(); | 1075 sideEffects.setDependsOnInstancePropertyStore(); |
| 1076 } | 1076 } |
| 1077 } else if (selector.isSetter) { | 1077 } else if (selector.isSetter) { |
| 1078 sideEffects.setChangesInstanceProperty(); | 1078 sideEffects.setChangesInstanceProperty(); |
| 1079 } else { | 1079 } else { |
| 1080 assert(selector.isCall); | 1080 assert(selector.isCall); |
| 1081 sideEffects.setAllSideEffects(); | 1081 sideEffects.setAllSideEffects(); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 1111 return getMightBePassedToApply(element.expression); | 1111 return getMightBePassedToApply(element.expression); |
| 1112 } | 1112 } |
| 1113 return functionsThatMightBePassedToApply.contains(element); | 1113 return functionsThatMightBePassedToApply.contains(element); |
| 1114 } | 1114 } |
| 1115 | 1115 |
| 1116 @override | 1116 @override |
| 1117 bool getCurrentlyKnownMightBePassedToApply(Element element) { | 1117 bool getCurrentlyKnownMightBePassedToApply(Element element) { |
| 1118 return getMightBePassedToApply(element); | 1118 return getMightBePassedToApply(element); |
| 1119 } | 1119 } |
| 1120 } | 1120 } |
| OLD | NEW |