Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: lib/compiler/implementation/resolver.dart

Issue 10917254: Move registering of interceptors to the JsBackend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address Kasper's comment. Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « lib/compiler/implementation/js_backend/backend.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 1722 world.registerUsedSelector(selector);
1723 if (target == null) {
ngeoffray 2012/10/08 13:50:39 Where is that check now?
karlklose 2012/10/08 13:59:36 I added it back. Thanks for catching that.
1724 // 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
1726 // for that send, register it.
1727 var interceptor =
1728 new Interceptors(compiler).getStaticInterceptorBySelector(selector);
1729 if (interceptor !== null) {
1730 world.registerStaticUse(interceptor);
1731 }
1732 }
1733 } 1723 }
1734 1724
1735 visitLiteralInt(LiteralInt node) { 1725 visitLiteralInt(LiteralInt node) {
1736 } 1726 }
1737 1727
1738 visitLiteralDouble(LiteralDouble node) { 1728 visitLiteralDouble(LiteralDouble node) {
1739 } 1729 }
1740 1730
1741 visitLiteralBool(LiteralBool node) { 1731 visitLiteralBool(LiteralBool node) {
1742 } 1732 }
(...skipping 1394 matching lines...) Expand 10 before | Expand all | Expand 10 after
3137 return result; 3127 return result;
3138 } 3128 }
3139 Element lookup(SourceString name) => localLookup(name); 3129 Element lookup(SourceString name) => localLookup(name);
3140 Element lexicalLookup(SourceString name) => localLookup(name); 3130 Element lexicalLookup(SourceString name) => localLookup(name);
3141 3131
3142 Element add(Element newElement) { 3132 Element add(Element newElement) {
3143 throw "Cannot add an element in a patch library scope"; 3133 throw "Cannot add an element in a patch library scope";
3144 } 3134 }
3145 String toString() => 'PatchLibraryScope($origin,$patch)'; 3135 String toString() => 'PatchLibraryScope($origin,$patch)';
3146 } 3136 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/js_backend/backend.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698