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

Side by Side Diff: pkg/compiler/lib/src/dart_backend/backend.dart

Issue 878843003: Support enums in dart2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 5 years, 10 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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 226
227 int totalSize = outputter.assembleProgram( 227 int totalSize = outputter.assembleProgram(
228 libraries: compiler.libraryLoader.libraries, 228 libraries: compiler.libraryLoader.libraries,
229 instantiatedClasses: compiler.resolverWorld.directlyInstantiatedClasses, 229 instantiatedClasses: compiler.resolverWorld.directlyInstantiatedClasses,
230 resolvedElements: compiler.enqueuer.resolution.resolvedElements, 230 resolvedElements: compiler.enqueuer.resolution.resolvedElements,
231 usedTypeLiterals: usedTypeLiterals, 231 usedTypeLiterals: usedTypeLiterals,
232 postProcessElementAst: postProcessElementAst, 232 postProcessElementAst: postProcessElementAst,
233 computeElementAst: computeElementAst, 233 computeElementAst: computeElementAst,
234 shouldOutput: shouldOutput, 234 shouldOutput: shouldOutput,
235 isSafeToRemoveTypeDeclarations: isSafeToRemoveTypeDeclarations, 235 isSafeToRemoveTypeDeclarations: isSafeToRemoveTypeDeclarations,
236 sortElements: sortElements, 236 sortElements: Elements.sortedByPosition,
237 mirrorRenamer: mirrorRenamer, 237 mirrorRenamer: mirrorRenamer,
238 mainFunction: compiler.mainFunction, 238 mainFunction: compiler.mainFunction,
239 outputUri: compiler.outputUri); 239 outputUri: compiler.outputUri);
240 240
241 // Output verbose info about size ratio of resulting bundle to all 241 // Output verbose info about size ratio of resulting bundle to all
242 // referenced non-platform sources. 242 // referenced non-platform sources.
243 logResultBundleSizeInfo( 243 logResultBundleSizeInfo(
244 outputter.libraryInfo.userLibraries, 244 outputter.libraryInfo.userLibraries,
245 outputter.elementInfo.topLevelElements, 245 outputter.elementInfo.topLevelElements,
246 totalSize); 246 totalSize);
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 result.sort(comparison); 461 result.sort(comparison);
462 return result; 462 return result;
463 } 463 }
464 464
465 compareElements(e0, e1) { 465 compareElements(e0, e1) {
466 int result = compareBy((e) => e.library.canonicalUri.toString())(e0, e1); 466 int result = compareBy((e) => e.library.canonicalUri.toString())(e0, e1);
467 if (result != 0) return result; 467 if (result != 0) return result;
468 return compareBy((e) => e.position.charOffset)(e0, e1); 468 return compareBy((e) => e.position.charOffset)(e0, e1);
469 } 469 }
470 470
471 List<Element> sortElements(Iterable<Element> elements) =>
472 sorted(elements, compareElements);
473
474 /// [ConstantCompilerTask] for compilation of constants for the Dart backend. 471 /// [ConstantCompilerTask] for compilation of constants for the Dart backend.
475 /// 472 ///
476 /// Since this task needs no distinction between frontend and backend constants 473 /// Since this task needs no distinction between frontend and backend constants
477 /// it also serves as the [BackendConstantEnvironment]. 474 /// it also serves as the [BackendConstantEnvironment].
478 class DartConstantTask extends ConstantCompilerTask 475 class DartConstantTask extends ConstantCompilerTask
479 implements BackendConstantEnvironment { 476 implements BackendConstantEnvironment {
480 final DartConstantCompiler constantCompiler; 477 final DartConstantCompiler constantCompiler;
481 478
482 DartConstantTask(Compiler compiler) 479 DartConstantTask(Compiler compiler)
483 : this.constantCompiler = new DartConstantCompiler(compiler), 480 : this.constantCompiler = new DartConstantCompiler(compiler),
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 } 541 }
545 542
546 void traceGraph(String title, var irObject) { 543 void traceGraph(String title, var irObject) {
547 compiler.tracer.traceGraph(title, irObject); 544 compiler.tracer.traceGraph(title, irObject);
548 } 545 }
549 546
550 DartTypes get dartTypes => compiler.types; 547 DartTypes get dartTypes => compiler.types;
551 548
552 InternalErrorFunction get internalError => compiler.internalError; 549 InternalErrorFunction get internalError => compiler.internalError;
553 } 550 }
OLDNEW
« no previous file with comments | « pkg/analyzer2dart/lib/src/modely.dart ('k') | pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698