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

Unified Diff: pkg/compiler/lib/src/dart_backend/outputter.dart

Issue 824103005: Revert "Remove Compiler.assembledCode." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/dart_backend/backend.dart ('k') | pkg/compiler/lib/src/dump_info.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/dart_backend/outputter.dart
diff --git a/pkg/compiler/lib/src/dart_backend/outputter.dart b/pkg/compiler/lib/src/dart_backend/outputter.dart
index d41d604bb1e88cfb0a96a00de47f2ec54bf97e03..4b8f22d9735c504f8449d01a6a82563fb1bd7975 100644
--- a/pkg/compiler/lib/src/dart_backend/outputter.dart
+++ b/pkg/compiler/lib/src/dart_backend/outputter.dart
@@ -55,9 +55,7 @@ class DartOutputter {
///
/// The [sortElements] function is used to sort [instantiatedClasses] and
/// [resolvedElements] in the generated output.
- ///
- /// Returns the total size of the generated code.
- int assembleProgram({
+ String assembleProgram({
MirrorRenamer mirrorRenamer: const MirrorRenamer(),
Iterable<LibraryElement> libraries,
Iterable<Element> instantiatedClasses,
@@ -122,15 +120,12 @@ class DartOutputter {
forceStripTypes: forceStripTypes,
isSafeToRemoveTypeDeclarations: isSafeToRemoveTypeDeclarations);
+ String assembledCode;
if (outputAst) {
- String code = astOutput(listener, elementInfo);
- outputProvider("", "dart")
- ..add(code)
- ..close();
- return code.length;
+ assembledCode = astOutput(listener, elementInfo);
} else {
output = new MainOutputGenerator();
- return output.generateCode(
+ assembledCode = output.generateCode(
libraryInfo,
elementInfo,
collector,
@@ -143,6 +138,7 @@ class DartOutputter {
forceStripTypes: forceStripTypes,
enableMinification: enableMinification);
}
+ return assembledCode;
}
static PlaceholderCollector collectPlaceholders(
@@ -435,8 +431,7 @@ class MainOutputGenerator {
new Map<ClassNode, List<Node>>();
final List<Node> topLevelNodes = <Node>[];
- /// Generates the code and returns the total size.
- int generateCode(
+ String generateCode(
LibraryInfo libraryInfo,
ElementInfo elementInfo,
PlaceholderCollector collector,
@@ -544,6 +539,7 @@ class MainOutputGenerator {
}
int totalSize = 0;
+ String assembledCode;
if (multiFile) {
for(LibraryElement outputLibrary in libraryInfo.userLibraries) {
// TODO(sigurdm): Make the unparser output directly into the buffer
@@ -554,15 +550,17 @@ class MainOutputGenerator {
..add(code)
..close();
}
+ // TODO(sigurdm): We should get rid of compiler.assembledCode.
+ assembledCode = unparsers[mainFunction.library].result;
} else {
- String code = mainUnparser.result;
+ assembledCode = mainUnparser.result;
outputProvider("", "dart")
- ..add(code)
+ ..add(assembledCode)
..close();
- totalSize = code.length;
+ totalSize = assembledCode.length;
}
- return totalSize;
+ return assembledCode;
}
}
« no previous file with comments | « pkg/compiler/lib/src/dart_backend/backend.dart ('k') | pkg/compiler/lib/src/dump_info.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698