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

Unified Diff: pkg/compiler/lib/src/dump_info.dart

Issue 832363002: 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
Index: pkg/compiler/lib/src/dump_info.dart
diff --git a/pkg/compiler/lib/src/dump_info.dart b/pkg/compiler/lib/src/dump_info.dart
index c59ea596ab48213d27935bc65f222db80e3eed4b..f21d3fc3e821c7082cb2580521443f171a91a8e0 100644
--- a/pkg/compiler/lib/src/dump_info.dart
+++ b/pkg/compiler/lib/src/dump_info.dart
@@ -86,20 +86,13 @@ class ElementToJsonVisitor extends ElementVisitor<Map<String, dynamic>> {
final Map<Element, Map<String, dynamic>> jsonCache = {};
- int programSize;
+ final int programSize;
String dart2jsVersion;
- ElementToJsonVisitor(this.compiler);
+ ElementToJsonVisitor(this.compiler, this.programSize);
void run() {
Backend backend = compiler.backend;
- if (backend is JavaScriptBackend) {
- // Add up the sizes of all output-buffers.
- programSize = backend.emitter.oldEmitter.outputBuffers.values.fold(0,
- (a, b) => a + b.length);
- } else {
- programSize = compiler.assembledCode.length;
- }
dart2jsVersion = compiler.hasBuildId ? compiler.buildId : null;
@@ -555,14 +548,14 @@ class DumpInfoTask extends CompilerTask {
return sb;
}
- void collectInfo() {
- infoCollector = new ElementToJsonVisitor(compiler)..run();
+ void collectInfo(int programSize) {
+ infoCollector = new ElementToJsonVisitor(compiler, programSize)..run();
}
- void dumpInfo() {
+ void dumpInfo(int programSize) {
measure(() {
if (infoCollector == null) {
- collectInfo();
+ collectInfo(programSize);
}
StringBuffer jsonBuffer = new StringBuffer();

Powered by Google App Engine
This is Rietveld 408576698