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

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

Issue 1220043005: dart2js send stats, includes: (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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 | « DEPS ('k') | pkg/compiler/lib/src/resolution/tree_elements.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 88d1be1c5b1b024d2bbc9499fb630a5c511f52a0..09c1f35502fd51dcaac40e5d93926c47ac5fbc9d 100644
--- a/pkg/compiler/lib/src/dump_info.dart
+++ b/pkg/compiler/lib/src/dump_info.dart
@@ -31,6 +31,7 @@ import 'js_emitter/full_emitter/emitter.dart' as full show
import 'js/js.dart' as jsAst;
import 'universe/universe.dart' show
UniverseSelector;
+import 'stats/builder.dart';
class ElementInfoCollector extends BaseElementVisitor<Info, dynamic> {
final Compiler compiler;
@@ -226,6 +227,8 @@ class ElementInfoCollector extends BaseElementVisitor<Info, dynamic> {
FunctionInfo visitFunctionElement(FunctionElement element, _) {
int size = compiler.dumpInfoTask.sizeOf(element);
+ // TODO(sigmund): consider adding a small info to represent unreachable
+ // code here.
if (size == 0 && !shouldKeep(element)) return null;
String name = element.name;
@@ -317,6 +320,9 @@ class ElementInfoCollector extends BaseElementVisitor<Info, dynamic> {
}
info.closures = nestedClosures;
result.functions.add(info);
+ if (const bool.fromEnvironment('send_stats')) {
+ info.measurements = collectSendMeasurements(element, compiler);
+ }
return info;
}
@@ -486,16 +492,9 @@ class DumpInfoTask extends CompilerTask {
return sb.toString();
}
- void collectInfo() {
- infoCollector = new ElementInfoCollector(compiler)..run();
- }
-
void dumpInfo() {
measure(() {
- if (infoCollector == null) {
- collectInfo();
- }
-
+ infoCollector = new ElementInfoCollector(compiler)..run();
StringBuffer jsonBuffer = new StringBuffer();
dumpInfoJson(jsonBuffer);
compiler.outputProvider('', 'info.json')
« no previous file with comments | « DEPS ('k') | pkg/compiler/lib/src/resolution/tree_elements.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698