| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 /// Analysis to determine how to generate code for `LookupMap`s. | 5 /// Analysis to determine how to generate code for `LookupMap`s. |
| 6 library compiler.src.js_backend.lookup_map_analysis; | 6 library compiler.src.js_backend.lookup_map_analysis; |
| 7 | 7 |
| 8 import '../common.dart'; | 8 import '../common.dart'; |
| 9 import '../common/registry.dart' show Registry; | 9 import '../common/registry.dart' show Registry; |
| 10 import '../compiler.dart' show Compiler; | 10 import '../compiler.dart' show Compiler; |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 | 300 |
| 301 _lookupMaps.values.forEach((info) { | 301 _lookupMaps.values.forEach((info) { |
| 302 assert (!info.emitted); | 302 assert (!info.emitted); |
| 303 info.emitted = true; | 303 info.emitted = true; |
| 304 info._prepareForEmission(); | 304 info._prepareForEmission(); |
| 305 }); | 305 }); |
| 306 | 306 |
| 307 // When --verbose is passed, we show the total number and set of keys that | 307 // When --verbose is passed, we show the total number and set of keys that |
| 308 // were tree-shaken from lookup maps. | 308 // were tree-shaken from lookup maps. |
| 309 Compiler compiler = backend.compiler; | 309 Compiler compiler = backend.compiler; |
| 310 if (compiler.verbose) { | 310 if (compiler.options.verbose) { |
| 311 var sb = new StringBuffer(); | 311 var sb = new StringBuffer(); |
| 312 int count = 0; | 312 int count = 0; |
| 313 for (var info in _lookupMaps.values) { | 313 for (var info in _lookupMaps.values) { |
| 314 for (var key in info.unusedEntries.keys) { | 314 for (var key in info.unusedEntries.keys) { |
| 315 if (count != 0) sb.write(','); | 315 if (count != 0) sb.write(','); |
| 316 sb.write(key.unparse()); | 316 sb.write(key.unparse()); |
| 317 count++; | 317 count++; |
| 318 } | 318 } |
| 319 } | 319 } |
| 320 reporter.log(count == 0 | 320 reporter.log(count == 0 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 } | 435 } |
| 436 } else { | 436 } else { |
| 437 original.fields[analysis.entriesField] = | 437 original.fields[analysis.entriesField] = |
| 438 new ListConstantValue(listType, keyValuePairs); | 438 new ListConstantValue(listType, keyValuePairs); |
| 439 } | 439 } |
| 440 } | 440 } |
| 441 } | 441 } |
| 442 | 442 |
| 443 final _validLookupMapVersionConstraint = | 443 final _validLookupMapVersionConstraint = |
| 444 new VersionConstraint.parse('^0.0.1'); | 444 new VersionConstraint.parse('^0.0.1'); |
| OLD | NEW |