| 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 js_backend.backend; | 5 library js_backend.backend; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../common/backend_api.dart' | 8 import '../common/backend_api.dart' |
| 9 show ForeignResolver, NativeRegistry, ImpactTransformer; | 9 show ForeignResolver, NativeRegistry, ImpactTransformer; |
| 10 import '../common/codegen.dart' show CodegenWorkItem; | 10 import '../common/codegen.dart' show CodegenWorkItem; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 | 125 |
| 126 // Returns `true`/`false` if we have a cached decision. | 126 // Returns `true`/`false` if we have a cached decision. |
| 127 // Returns `null` otherwise. | 127 // Returns `null` otherwise. |
| 128 bool canInline(FunctionEntity element, {bool insideLoop}) { | 128 bool canInline(FunctionEntity element, {bool insideLoop}) { |
| 129 assert(checkFunction(element)); | 129 assert(checkFunction(element)); |
| 130 int decision = _cachedDecisions[element]; | 130 int decision = _cachedDecisions[element]; |
| 131 | 131 |
| 132 if (decision == null) { | 132 if (decision == null) { |
| 133 // These synthetic elements are not yet present when we initially compute | 133 // These synthetic elements are not yet present when we initially compute |
| 134 // this cache from metadata annotations, so look for their parent. | 134 // this cache from metadata annotations, so look for their parent. |
| 135 if (element is ConstructorBodyElement) { | 135 if (element is ConstructorBodyEntity) { |
| 136 ConstructorBodyElement body = element; | 136 ConstructorBodyEntity body = element; |
| 137 decision = _cachedDecisions[body.constructor]; | 137 decision = _cachedDecisions[body.constructor]; |
| 138 } | 138 } |
| 139 if (decision == null) { | 139 if (decision == null) { |
| 140 decision = _unknown; | 140 decision = _unknown; |
| 141 } | 141 } |
| 142 } | 142 } |
| 143 | 143 |
| 144 if (insideLoop) { | 144 if (insideLoop) { |
| 145 switch (decision) { | 145 switch (decision) { |
| 146 case _mustNotInline: | 146 case _mustNotInline: |
| (...skipping 1256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1403 | 1403 |
| 1404 bool canUseAliasedSuperMember(MemberEntity member, Selector selector) { | 1404 bool canUseAliasedSuperMember(MemberEntity member, Selector selector) { |
| 1405 return !selector.isGetter; | 1405 return !selector.isGetter; |
| 1406 } | 1406 } |
| 1407 | 1407 |
| 1408 /// Returns `true` if [member] is called from a subclass via `super`. | 1408 /// Returns `true` if [member] is called from a subclass via `super`. |
| 1409 bool isAliasedSuperMember(MemberEntity member) { | 1409 bool isAliasedSuperMember(MemberEntity member) { |
| 1410 return _aliasedSuperMembers.contains(member); | 1410 return _aliasedSuperMembers.contains(member); |
| 1411 } | 1411 } |
| 1412 } | 1412 } |
| OLD | NEW |