Index: pkg/analyzer/lib/src/dart/analysis/file_state.dart |
diff --git a/pkg/analyzer/lib/src/dart/analysis/file_state.dart b/pkg/analyzer/lib/src/dart/analysis/file_state.dart |
index 93ac117499661dc09c6ef711b5b69d8b3a9dbe08..f441c981033fccc578defb0069a08d363ff80656 100644 |
--- a/pkg/analyzer/lib/src/dart/analysis/file_state.dart |
+++ b/pkg/analyzer/lib/src/dart/analysis/file_state.dart |
@@ -381,13 +381,24 @@ class FileState { |
* Return a new parsed unresolved [CompilationUnit]. |
*/ |
CompilationUnit parse(AnalysisErrorListener errorListener) { |
+ return PerformanceStatistics.parse.makeCurrentWhile(() { |
+ return _parse(errorListener); |
+ }); |
+ } |
+ |
+ CompilationUnit _parse(AnalysisErrorListener errorListener) { |
AnalysisOptions analysisOptions = _fsState._analysisOptions; |
if (USE_FASTA_PARSER) { |
try { |
- fasta.ScannerResult scanResult = fasta.scan(_contentBytes, |
+ fasta.ScannerResult scanResult = |
+ PerformanceStatistics.scan.makeCurrentWhile(() { |
+ return fasta.scan( |
+ _contentBytes, |
includeComments: true, |
- scanGenericMethodComments: analysisOptions.strongMode); |
+ scanGenericMethodComments: analysisOptions.strongMode, |
+ ); |
+ }); |
var astBuilder = new fasta.AstBuilder( |
new ErrorReporter(errorListener, source), |
@@ -415,7 +426,9 @@ class FileState { |
CharSequenceReader reader = new CharSequenceReader(content); |
Scanner scanner = new Scanner(source, reader, errorListener); |
scanner.scanGenericMethodComments = analysisOptions.strongMode; |
- Token token = scanner.tokenize(); |
+ Token token = PerformanceStatistics.scan.makeCurrentWhile(() { |
+ return scanner.tokenize(); |
+ }); |
LineInfo lineInfo = new LineInfo(scanner.lineStarts); |
Parser parser = new Parser(source, errorListener); |