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

Unified Diff: sdk/lib/_internal/compiler/implementation/dump_info.dart

Issue 486313003: Clean up dump-info and js_backend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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 | « no previous file | sdk/lib/_internal/compiler/implementation/js_backend/backend.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/dump_info.dart
diff --git a/sdk/lib/_internal/compiler/implementation/dump_info.dart b/sdk/lib/_internal/compiler/implementation/dump_info.dart
index c125f21bf2b8734df0c74d8b137a29bb497418ca..4abbcaaf96a2ea0777819eb336483c0873d8ae08 100644
--- a/sdk/lib/_internal/compiler/implementation/dump_info.dart
+++ b/sdk/lib/_internal/compiler/implementation/dump_info.dart
@@ -75,11 +75,10 @@ class GroupedIdMapper {
}
class ElementToJsonVisitor extends ElementVisitor<Map<String, dynamic>> {
- GroupedIdMapper mapper = new GroupedIdMapper();
- Compiler compiler;
+ final GroupedIdMapper mapper = new GroupedIdMapper();
+ final Compiler compiler;
- Map<Element, Map<String, dynamic>> jsonCache = {};
- Map<Element, jsAst.Expression> codeCache;
+ final Map<Element, Map<String, dynamic>> jsonCache = {};
int programSize;
DateTime compilationMoment;
@@ -87,9 +86,9 @@ class ElementToJsonVisitor extends ElementVisitor<Map<String, dynamic>> {
Duration compilationDuration;
Duration dumpInfoDuration;
- ElementToJsonVisitor(Compiler compiler) {
- this.compiler = compiler;
+ ElementToJsonVisitor(this.compiler);
+ void run() {
Backend backend = compiler.backend;
if (backend is JavaScriptBackend) {
// Add up the sizes of all output-buffers.
@@ -99,7 +98,6 @@ class ElementToJsonVisitor extends ElementVisitor<Map<String, dynamic>> {
programSize = compiler.assembledCode.length;
}
-
compilationMoment = new DateTime.now();
dart2jsVersion = compiler.hasBuildId ? compiler.buildId : null;
compilationDuration = compiler.totalCompileTime.elapsed;
@@ -109,6 +107,7 @@ class ElementToJsonVisitor extends ElementVisitor<Map<String, dynamic>> {
}
dumpInfoDuration = new DateTime.now().difference(compilationMoment);
+
}
// If keeping the element is in question (like if a function has a size
@@ -534,7 +533,7 @@ class DumpInfoTask extends CompilerTask {
}
void collectInfo() {
- infoCollector = new ElementToJsonVisitor(compiler);
+ infoCollector = new ElementToJsonVisitor(compiler)..run();
}
void dumpInfo() {
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/js_backend/backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698