| 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 abstract class TreeElements { | 5 abstract class TreeElements { |
| 6 Element operator[](Node node); | 6 Element operator[](Node node); |
| 7 Selector getSelector(Send send); | 7 Selector getSelector(Send send); |
| 8 DartType getType(TypeAnnotation annotation); | 8 DartType getType(TypeAnnotation annotation); |
| 9 bool isParameterChecked(Element element); | 9 bool isParameterChecked(Element element); |
| 10 } | 10 } |
| (...skipping 1701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1712 } | 1712 } |
| 1713 } else if (Elements.isStaticOrTopLevel(target)) { | 1713 } else if (Elements.isStaticOrTopLevel(target)) { |
| 1714 // TODO(kasperl): It seems like we're not supposed to register | 1714 // TODO(kasperl): It seems like we're not supposed to register |
| 1715 // the use of classes. Wouldn't it be simpler if we just did? | 1715 // the use of classes. Wouldn't it be simpler if we just did? |
| 1716 if (!target.isClass()) { | 1716 if (!target.isClass()) { |
| 1717 // [target] might be the implementation element and only declaration | 1717 // [target] might be the implementation element and only declaration |
| 1718 // elements may be registered. | 1718 // elements may be registered. |
| 1719 world.registerStaticUse(target.declaration); | 1719 world.registerStaticUse(target.declaration); |
| 1720 } | 1720 } |
| 1721 } | 1721 } |
| 1722 | |
| 1723 if (target == null) { | 1722 if (target == null) { |
| 1724 // If we haven't found an element for this send, it might be a | 1723 // If we haven't found an element for this send, it might be a |
| 1725 // dynamic send on a primitive value. If there is an interceptor | 1724 // dynamic send on a primitive value. Register the selector with |
| 1726 // for that send, register it. | 1725 // the world to add an interceptor, if necessary. |
| 1727 var interceptor = | 1726 world.registerUsedSelector(selector); |
| 1728 new Interceptors(compiler).getStaticInterceptorBySelector(selector); | |
| 1729 if (interceptor !== null) { | |
| 1730 world.registerStaticUse(interceptor); | |
| 1731 } | |
| 1732 } | 1727 } |
| 1733 } | 1728 } |
| 1734 | 1729 |
| 1735 visitLiteralInt(LiteralInt node) { | 1730 visitLiteralInt(LiteralInt node) { |
| 1736 } | 1731 } |
| 1737 | 1732 |
| 1738 visitLiteralDouble(LiteralDouble node) { | 1733 visitLiteralDouble(LiteralDouble node) { |
| 1739 } | 1734 } |
| 1740 | 1735 |
| 1741 visitLiteralBool(LiteralBool node) { | 1736 visitLiteralBool(LiteralBool node) { |
| (...skipping 1395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3137 return result; | 3132 return result; |
| 3138 } | 3133 } |
| 3139 Element lookup(SourceString name) => localLookup(name); | 3134 Element lookup(SourceString name) => localLookup(name); |
| 3140 Element lexicalLookup(SourceString name) => localLookup(name); | 3135 Element lexicalLookup(SourceString name) => localLookup(name); |
| 3141 | 3136 |
| 3142 Element add(Element newElement) { | 3137 Element add(Element newElement) { |
| 3143 throw "Cannot add an element in a patch library scope"; | 3138 throw "Cannot add an element in a patch library scope"; |
| 3144 } | 3139 } |
| 3145 String toString() => 'PatchLibraryScope($origin,$patch)'; | 3140 String toString() => 'PatchLibraryScope($origin,$patch)'; |
| 3146 } | 3141 } |
| OLD | NEW |