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 part of dart_backend; | 5 part of dart_backend; |
6 | 6 |
7 // TODO(ahe): This class is simply wrong. This backend should use | 7 // TODO(ahe): This class is simply wrong. This backend should use |
8 // elements when it can, not AST nodes. Perhaps a [Map<Element, | 8 // elements when it can, not AST nodes. Perhaps a [Map<Element, |
9 // TreeElements>] is what is needed. | 9 // TreeElements>] is what is needed. |
10 class ElementAst { | 10 class ElementAst { |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 'Map', 'List', 'num', 'int', 'double', 'bool' | 126 'Map', 'List', 'num', 'int', 'double', 'bool' |
127 ]; | 127 ]; |
128 final coreLibrary = compiler.coreLibrary; | 128 final coreLibrary = compiler.coreLibrary; |
129 for (final name in LITERAL_TYPE_NAMES) { | 129 for (final name in LITERAL_TYPE_NAMES) { |
130 ClassElement classElement = coreLibrary.findLocal(name); | 130 ClassElement classElement = coreLibrary.findLocal(name); |
131 classElement.ensureResolved(compiler); | 131 classElement.ensureResolved(compiler); |
132 } | 132 } |
133 // Enqueue the methods that the VM might invoke on user objects because | 133 // Enqueue the methods that the VM might invoke on user objects because |
134 // we don't trust the resolution to always get these included. | 134 // we don't trust the resolution to always get these included. |
135 world.registerInvocation( | 135 world.registerInvocation( |
136 new Selector.call("toString", null, 0)); | 136 null, new Selector.call("toString", null, 0)); |
137 world.registerInvokedGetter( | 137 world.registerInvokedGetter( |
138 new Selector.getter("hashCode", null)); | 138 null, new Selector.getter("hashCode", null)); |
139 world.registerInvocation( | 139 world.registerInvocation( |
140 new Selector.binaryOperator("==")); | 140 null, new Selector.binaryOperator("==")); |
141 world.registerInvocation( | 141 world.registerInvocation( |
142 new Selector.call("compareTo", null, 1)); | 142 null, new Selector.call("compareTo", null, 1)); |
143 } | 143 } |
144 | 144 |
145 void codegen(CodegenWorkItem work) { } | 145 void codegen(CodegenWorkItem work) { } |
146 | 146 |
147 bool isUserLibrary(LibraryElement lib) => !lib.isPlatformLibrary; | 147 bool isUserLibrary(LibraryElement lib) => !lib.isPlatformLibrary; |
148 | 148 |
149 /** | 149 /** |
150 * Tells whether we should output given element. Corelib classes like | 150 * Tells whether we should output given element. Corelib classes like |
151 * Object should not be in the resulting code. | 151 * Object should not be in the resulting code. |
152 */ | 152 */ |
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
663 } | 663 } |
664 | 664 |
665 Constant compileMetadata(MetadataAnnotation metadata, | 665 Constant compileMetadata(MetadataAnnotation metadata, |
666 Node node, | 666 Node node, |
667 TreeElements elements) { | 667 TreeElements elements) { |
668 return measure(() { | 668 return measure(() { |
669 return constantCompiler.compileMetadata(metadata, node, elements); | 669 return constantCompiler.compileMetadata(metadata, node, elements); |
670 }); | 670 }); |
671 } | 671 } |
672 } | 672 } |
OLD | NEW |