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

Unified Diff: bin/debug_info.dart

Issue 1300513005: Add constant info to the dart2js_info model (Closed) Base URL: git@github.com:dart-lang/dart2js_info.git@master
Patch Set: Created 5 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
Index: bin/debug_info.dart
diff --git a/bin/debug_info.dart b/bin/debug_info.dart
index c729721f5bddb44f0eaccfc96cd26c3004ae55fb..3fd5ea9c98642bbaf37bf48ae4769b8567469391 100644
--- a/bin/debug_info.dart
+++ b/bin/debug_info.dart
@@ -47,9 +47,14 @@ main(args) {
// Validate that code-size adds up.
int realTotal = info.program.size;
int totalLib = info.libraries.fold(0, (n, lib) => n + lib.size);
- if (totalLib != realTotal) {
- var percent = ((realTotal - totalLib) * 100 / realTotal).toStringAsFixed(2);
- _fail('$percent% size missing (sum of all libs < total)');
+ int constantsSize = info.constants.fold(0, (n, c) => n + c.size);
+ int accounted = totalLib + constantsSize;
+
+ if (accounted != realTotal) {
+ var percent = ((realTotal - accounted) * 100 / realTotal)
+ .toStringAsFixed(2);
+ _fail('$percent% size missing: $accounted (all libs + consts) '
+ '< $realTotal (total)');
}
var missingTotal = tracker.missing.values.fold(0, (a, b) => a + b);
if (missingTotal > 0) {
« no previous file with comments | « README.md ('k') | bin/library_size_split.dart » ('j') | bin/library_size_split.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698