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 library analyzer.src.context.context; | 5 library analyzer.src.context.context; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:collection'; | 8 import 'dart:collection'; |
9 | 9 |
10 import 'package:analyzer/instrumentation/instrumentation.dart'; | 10 import 'package:analyzer/instrumentation/instrumentation.dart'; |
(...skipping 1859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1870 } | 1870 } |
1871 // do resolution | 1871 // do resolution |
1872 Stopwatch perfCounter = new Stopwatch()..start(); | 1872 Stopwatch perfCounter = new Stopwatch()..start(); |
1873 PoorMansIncrementalResolver resolver = new PoorMansIncrementalResolver( | 1873 PoorMansIncrementalResolver resolver = new PoorMansIncrementalResolver( |
1874 typeProvider, | 1874 typeProvider, |
1875 unitSource, | 1875 unitSource, |
1876 null, | 1876 null, |
1877 sourceEntry, | 1877 sourceEntry, |
1878 unitEntry, | 1878 unitEntry, |
1879 oldUnit, | 1879 oldUnit, |
1880 analysisOptions.incrementalApi, | 1880 analysisOptions.incrementalApi); |
1881 analysisOptions); | |
1882 bool success = resolver.resolve(newCode); | 1881 bool success = resolver.resolve(newCode); |
1883 AnalysisEngine.instance.instrumentationService.logPerformance( | 1882 AnalysisEngine.instance.instrumentationService.logPerformance( |
1884 AnalysisPerformanceKind.INCREMENTAL, | 1883 AnalysisPerformanceKind.INCREMENTAL, |
1885 perfCounter, | 1884 perfCounter, |
1886 'success=$success,context_id=$_id,code_length=${newCode.length}'); | 1885 'success=$success,context_id=$_id,code_length=${newCode.length}'); |
1887 if (!success) { | 1886 if (!success) { |
1888 return false; | 1887 return false; |
1889 } | 1888 } |
1890 // if validation, remember the result, but throw it away | 1889 // if validation, remember the result, but throw it away |
1891 if (analysisOptions.incrementalValidation) { | 1890 if (analysisOptions.incrementalValidation) { |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2089 new PendingFuture<T>(_context, target, computeValue); | 2088 new PendingFuture<T>(_context, target, computeValue); |
2090 if (!pendingFuture.evaluate(entry)) { | 2089 if (!pendingFuture.evaluate(entry)) { |
2091 _context._pendingFutureTargets | 2090 _context._pendingFutureTargets |
2092 .putIfAbsent(target, () => <PendingFuture>[]) | 2091 .putIfAbsent(target, () => <PendingFuture>[]) |
2093 .add(pendingFuture); | 2092 .add(pendingFuture); |
2094 scheduleComputation(); | 2093 scheduleComputation(); |
2095 } | 2094 } |
2096 return pendingFuture.future; | 2095 return pendingFuture.future; |
2097 } | 2096 } |
2098 } | 2097 } |
OLD | NEW |