| 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 } | 104 } |
| 105 | 105 |
| 106 DartBackend(Compiler compiler, List<String> strips, {bool multiFile}) | 106 DartBackend(Compiler compiler, List<String> strips, {bool multiFile}) |
| 107 : tasks = <CompilerTask>[], | 107 : tasks = <CompilerTask>[], |
| 108 stripAsserts = strips.indexOf('asserts') != -1, | 108 stripAsserts = strips.indexOf('asserts') != -1, |
| 109 constantCompilerTask = new DartConstantTask(compiler), | 109 constantCompilerTask = new DartConstantTask(compiler), |
| 110 outputter = new DartOutputter( | 110 outputter = new DartOutputter( |
| 111 compiler.reporter, compiler.outputProvider, | 111 compiler.reporter, compiler.outputProvider, |
| 112 forceStripTypes: strips.indexOf('types') != -1, | 112 forceStripTypes: strips.indexOf('types') != -1, |
| 113 multiFile: multiFile, | 113 multiFile: multiFile, |
| 114 enableMinification: compiler.enableMinification), | 114 enableMinification: compiler.options.enableMinification), |
| 115 super(compiler) { | 115 super(compiler) { |
| 116 impactTransformer = new DartImpactTransformer(this); | 116 impactTransformer = new DartImpactTransformer(this); |
| 117 } | 117 } |
| 118 | 118 |
| 119 | 119 |
| 120 DiagnosticReporter get reporter => compiler.reporter; | 120 DiagnosticReporter get reporter => compiler.reporter; |
| 121 | 121 |
| 122 Resolution get resolution => compiler.resolution; | 122 Resolution get resolution => compiler.resolution; |
| 123 | 123 |
| 124 bool classNeedsRti(ClassElement cls) => false; | 124 bool classNeedsRti(ClassElement cls) => false; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 instantiatedClasses: compiler.resolverWorld.directlyInstantiatedClasses, | 187 instantiatedClasses: compiler.resolverWorld.directlyInstantiatedClasses, |
| 188 resolvedElements: compiler.enqueuer.resolution.processedElements, | 188 resolvedElements: compiler.enqueuer.resolution.processedElements, |
| 189 usedTypeLiterals: usedTypeLiterals, | 189 usedTypeLiterals: usedTypeLiterals, |
| 190 postProcessElementAst: postProcessElementAst, | 190 postProcessElementAst: postProcessElementAst, |
| 191 computeElementAst: computeElementAst, | 191 computeElementAst: computeElementAst, |
| 192 shouldOutput: shouldOutput, | 192 shouldOutput: shouldOutput, |
| 193 isSafeToRemoveTypeDeclarations: isSafeToRemoveTypeDeclarations, | 193 isSafeToRemoveTypeDeclarations: isSafeToRemoveTypeDeclarations, |
| 194 sortElements: Elements.sortedByPosition, | 194 sortElements: Elements.sortedByPosition, |
| 195 mirrorRenamer: mirrorRenamer, | 195 mirrorRenamer: mirrorRenamer, |
| 196 mainFunction: compiler.mainFunction, | 196 mainFunction: compiler.mainFunction, |
| 197 outputUri: compiler.outputUri); | 197 outputUri: compiler.options.outputUri); |
| 198 | 198 |
| 199 // Output verbose info about size ratio of resulting bundle to all | 199 // Output verbose info about size ratio of resulting bundle to all |
| 200 // referenced non-platform sources. | 200 // referenced non-platform sources. |
| 201 logResultBundleSizeInfo( | 201 logResultBundleSizeInfo( |
| 202 outputter.libraryInfo.userLibraries, | 202 outputter.libraryInfo.userLibraries, |
| 203 outputter.elementInfo.topLevelElements, | 203 outputter.elementInfo.topLevelElements, |
| 204 totalSize); | 204 totalSize); |
| 205 | 205 |
| 206 return totalSize; | 206 return totalSize; |
| 207 } | 207 } |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 } | 547 } |
| 548 | 548 |
| 549 // TODO(johnniwinther): Remove this when values are computed from the | 549 // TODO(johnniwinther): Remove this when values are computed from the |
| 550 // expressions. | 550 // expressions. |
| 551 @override | 551 @override |
| 552 void copyConstantValues(DartConstantTask task) { | 552 void copyConstantValues(DartConstantTask task) { |
| 553 constantCompiler.constantValueMap.addAll( | 553 constantCompiler.constantValueMap.addAll( |
| 554 task.constantCompiler.constantValueMap); | 554 task.constantCompiler.constantValueMap); |
| 555 } | 555 } |
| 556 } | 556 } |
| OLD | NEW |