| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 library analyzer_impl; | 5 library analyzer_impl; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 import 'dart:io'; | 9 import 'dart:io'; |
| 10 | 10 |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 | 299 |
| 300 _printColdPerf() { | 300 _printColdPerf() { |
| 301 // print cold VM performance numbers | 301 // print cold VM performance numbers |
| 302 int totalTime = JavaSystem.currentTimeMillis() - startTime; | 302 int totalTime = JavaSystem.currentTimeMillis() - startTime; |
| 303 int ioTime = PerformanceStatistics.io.result; | 303 int ioTime = PerformanceStatistics.io.result; |
| 304 int scanTime = PerformanceStatistics.scan.result; | 304 int scanTime = PerformanceStatistics.scan.result; |
| 305 int parseTime = PerformanceStatistics.parse.result; | 305 int parseTime = PerformanceStatistics.parse.result; |
| 306 int resolveTime = PerformanceStatistics.resolve.result; | 306 int resolveTime = PerformanceStatistics.resolve.result; |
| 307 int errorsTime = PerformanceStatistics.errors.result; | 307 int errorsTime = PerformanceStatistics.errors.result; |
| 308 int hintsTime = PerformanceStatistics.hints.result; | 308 int hintsTime = PerformanceStatistics.hints.result; |
| 309 int angularTime = PerformanceStatistics.angular.result; | |
| 310 stdout.writeln("io-cold:$ioTime"); | 309 stdout.writeln("io-cold:$ioTime"); |
| 311 stdout.writeln("scan-cold:$scanTime"); | 310 stdout.writeln("scan-cold:$scanTime"); |
| 312 stdout.writeln("parse-cold:$parseTime"); | 311 stdout.writeln("parse-cold:$parseTime"); |
| 313 stdout.writeln("resolve-cold:$resolveTime"); | 312 stdout.writeln("resolve-cold:$resolveTime"); |
| 314 stdout.writeln("errors-cold:$errorsTime"); | 313 stdout.writeln("errors-cold:$errorsTime"); |
| 315 stdout.writeln("hints-cold:$hintsTime"); | 314 stdout.writeln("hints-cold:$hintsTime"); |
| 316 stdout.writeln("angular-cold:$angularTime"); | |
| 317 stdout.writeln("other-cold:${totalTime | 315 stdout.writeln("other-cold:${totalTime |
| 318 - (ioTime + scanTime + parseTime + resolveTime + errorsTime + hintsTime | 316 - (ioTime + scanTime + parseTime + resolveTime + errorsTime + hintsTime)
}"); |
| 319 + angularTime)}"); | |
| 320 stdout.writeln("total-cold:$totalTime"); | 317 stdout.writeln("total-cold:$totalTime"); |
| 321 } | 318 } |
| 322 | 319 |
| 323 _printErrorsAndPerf() { | 320 _printErrorsAndPerf() { |
| 324 // The following is a hack. We currently print out to stderr to ensure that | 321 // The following is a hack. We currently print out to stderr to ensure that |
| 325 // when in batch mode we print to stderr, this is because the prints from | 322 // when in batch mode we print to stderr, this is because the prints from |
| 326 // batch are made to stderr. The reason that options.shouldBatch isn't used | 323 // batch are made to stderr. The reason that options.shouldBatch isn't used |
| 327 // is because when the argument flags are constructed in BatchRunner and | 324 // is because when the argument flags are constructed in BatchRunner and |
| 328 // passed in from batch mode which removes the batch flag to prevent the | 325 // passed in from batch mode which removes the batch flag to prevent the |
| 329 // "cannot have the batch flag and source file" error message. | 326 // "cannot have the batch flag and source file" error message. |
| 330 IOSink sink = options.machineFormat ? stderr : stdout; | 327 IOSink sink = options.machineFormat ? stderr : stdout; |
| 331 | 328 |
| 332 // print errors | 329 // print errors |
| 333 ErrorFormatter formatter = | 330 ErrorFormatter formatter = |
| 334 new ErrorFormatter(sink, options, _isDesiredError); | 331 new ErrorFormatter(sink, options, _isDesiredError); |
| 335 formatter.formatErrors(errorInfos); | 332 formatter.formatErrors(errorInfos); |
| 336 | 333 |
| 337 // print performance numbers | 334 // print performance numbers |
| 338 if (options.perf || options.warmPerf) { | 335 if (options.perf || options.warmPerf) { |
| 339 int totalTime = JavaSystem.currentTimeMillis() - startTime; | 336 int totalTime = JavaSystem.currentTimeMillis() - startTime; |
| 340 int ioTime = PerformanceStatistics.io.result; | 337 int ioTime = PerformanceStatistics.io.result; |
| 341 int scanTime = PerformanceStatistics.scan.result; | 338 int scanTime = PerformanceStatistics.scan.result; |
| 342 int parseTime = PerformanceStatistics.parse.result; | 339 int parseTime = PerformanceStatistics.parse.result; |
| 343 int resolveTime = PerformanceStatistics.resolve.result; | 340 int resolveTime = PerformanceStatistics.resolve.result; |
| 344 int errorsTime = PerformanceStatistics.errors.result; | 341 int errorsTime = PerformanceStatistics.errors.result; |
| 345 int hintsTime = PerformanceStatistics.hints.result; | 342 int hintsTime = PerformanceStatistics.hints.result; |
| 346 int angularTime = PerformanceStatistics.angular.result; | |
| 347 stdout.writeln("io:$ioTime"); | 343 stdout.writeln("io:$ioTime"); |
| 348 stdout.writeln("scan:$scanTime"); | 344 stdout.writeln("scan:$scanTime"); |
| 349 stdout.writeln("parse:$parseTime"); | 345 stdout.writeln("parse:$parseTime"); |
| 350 stdout.writeln("resolve:$resolveTime"); | 346 stdout.writeln("resolve:$resolveTime"); |
| 351 stdout.writeln("errors:$errorsTime"); | 347 stdout.writeln("errors:$errorsTime"); |
| 352 stdout.writeln("hints:$hintsTime"); | 348 stdout.writeln("hints:$hintsTime"); |
| 353 stdout.writeln("angular:$angularTime"); | |
| 354 stdout.writeln("other:${totalTime | 349 stdout.writeln("other:${totalTime |
| 355 - (ioTime + scanTime + parseTime + resolveTime + errorsTime + hintsTim
e | 350 - (ioTime + scanTime + parseTime + resolveTime + errorsTime + hintsTim
e)}"); |
| 356 + angularTime)}"); | |
| 357 stdout.writeln("total:$totalTime"); | 351 stdout.writeln("total:$totalTime"); |
| 358 } | 352 } |
| 359 } | 353 } |
| 360 | 354 |
| 361 /** | 355 /** |
| 362 * Compute the severity of the error; however, if | 356 * Compute the severity of the error; however, if |
| 363 * [enableTypeChecks] is false, then de-escalate checked-mode compile time | 357 * [enableTypeChecks] is false, then de-escalate checked-mode compile time |
| 364 * errors to a severity of [ErrorSeverity.INFO]. | 358 * errors to a severity of [ErrorSeverity.INFO]. |
| 365 */ | 359 */ |
| 366 static ErrorSeverity computeSeverity(AnalysisError error, | 360 static ErrorSeverity computeSeverity(AnalysisError error, |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 } | 440 } |
| 447 } | 441 } |
| 448 | 442 |
| 449 @override | 443 @override |
| 450 void logInformation2(String message, Object exception) { | 444 void logInformation2(String message, Object exception) { |
| 451 if (log) { | 445 if (log) { |
| 452 stdout.writeln(message); | 446 stdout.writeln(message); |
| 453 } | 447 } |
| 454 } | 448 } |
| 455 } | 449 } |
| OLD | NEW |