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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart

Issue 12210142: Implement is-checks against type variables. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix a long line. Created 7 years, 9 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
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 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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 } 210 }
211 return true; 211 return true;
212 } 212 }
213 213
214 DartBackend(Compiler compiler, List<String> strips) 214 DartBackend(Compiler compiler, List<String> strips)
215 : tasks = <CompilerTask>[], 215 : tasks = <CompilerTask>[],
216 forceStripTypes = strips.indexOf('types') != -1, 216 forceStripTypes = strips.indexOf('types') != -1,
217 stripAsserts = strips.indexOf('asserts') != -1, 217 stripAsserts = strips.indexOf('asserts') != -1,
218 super(compiler); 218 super(compiler);
219 219
220 void addBackendRtiDependencies(World world) {}
221
220 void enqueueHelpers(ResolutionEnqueuer world) { 222 void enqueueHelpers(ResolutionEnqueuer world) {
221 // Right now resolver doesn't always resolve interfaces needed 223 // Right now resolver doesn't always resolve interfaces needed
222 // for literals, so force them. TODO(antonm): fix in the resolver. 224 // for literals, so force them. TODO(antonm): fix in the resolver.
223 final LITERAL_TYPE_NAMES = const [ 225 final LITERAL_TYPE_NAMES = const [
224 'Map', 'List', 'num', 'int', 'double', 'bool' 226 'Map', 'List', 'num', 'int', 'double', 'bool'
225 ]; 227 ];
226 final coreLibrary = compiler.coreLibrary; 228 final coreLibrary = compiler.coreLibrary;
227 for (final name in LITERAL_TYPE_NAMES) { 229 for (final name in LITERAL_TYPE_NAMES) {
228 ClassElement classElement = coreLibrary.findLocal(new SourceString(name)); 230 ClassElement classElement = coreLibrary.findLocal(new SourceString(name));
229 classElement.ensureResolved(compiler); 231 classElement.ensureResolved(compiler);
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 } 585 }
584 586
585 compareElements(e0, e1) { 587 compareElements(e0, e1) {
586 int result = compareBy((e) => e.getLibrary().canonicalUri.toString())(e0, e1); 588 int result = compareBy((e) => e.getLibrary().canonicalUri.toString())(e0, e1);
587 if (result != 0) return result; 589 if (result != 0) return result;
588 return compareBy((e) => e.position().charOffset)(e0, e1); 590 return compareBy((e) => e.position().charOffset)(e0, e1);
589 } 591 }
590 592
591 List<Element> sortElements(Iterable<Element> elements) => 593 List<Element> sortElements(Iterable<Element> elements) =>
592 sorted(elements, compareElements); 594 sorted(elements, compareElements);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698