| 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 1761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1772 */ | 1772 */ |
| 1773 void _sourceRemoved(Source source) { | 1773 void _sourceRemoved(Source source) { |
| 1774 _cache.remove(source); | 1774 _cache.remove(source); |
| 1775 _removeFromPriorityOrder(source); | 1775 _removeFromPriorityOrder(source); |
| 1776 } | 1776 } |
| 1777 | 1777 |
| 1778 /** | 1778 /** |
| 1779 * TODO(scheglov) A hackish, limited incremental resolution implementation. | 1779 * TODO(scheglov) A hackish, limited incremental resolution implementation. |
| 1780 */ | 1780 */ |
| 1781 bool _tryPoorMansIncrementalResolution(Source unitSource, String newCode) { | 1781 bool _tryPoorMansIncrementalResolution(Source unitSource, String newCode) { |
| 1782 if (AnalysisEngine.instance.limitInvalidationInTaskModel) { | |
| 1783 return false; | |
| 1784 } | |
| 1785 return PerformanceStatistics.incrementalAnalysis.makeCurrentWhile(() { | 1782 return PerformanceStatistics.incrementalAnalysis.makeCurrentWhile(() { |
| 1786 incrementalResolutionValidation_lastUnitSource = null; | 1783 incrementalResolutionValidation_lastUnitSource = null; |
| 1787 incrementalResolutionValidation_lastLibrarySource = null; | 1784 incrementalResolutionValidation_lastLibrarySource = null; |
| 1788 incrementalResolutionValidation_lastUnit = null; | 1785 incrementalResolutionValidation_lastUnit = null; |
| 1789 // prepare the entry | 1786 // prepare the entry |
| 1790 CacheEntry sourceEntry = _cache.get(unitSource); | 1787 CacheEntry sourceEntry = _cache.get(unitSource); |
| 1791 if (sourceEntry == null) { | 1788 if (sourceEntry == null) { |
| 1792 return false; | 1789 return false; |
| 1793 } | 1790 } |
| 1794 // prepare the (only) library source | 1791 // prepare the (only) library source |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2027 new PendingFuture<T>(_context, target, computeValue); | 2024 new PendingFuture<T>(_context, target, computeValue); |
| 2028 if (!pendingFuture.evaluate(entry)) { | 2025 if (!pendingFuture.evaluate(entry)) { |
| 2029 _context._pendingFutureTargets | 2026 _context._pendingFutureTargets |
| 2030 .putIfAbsent(target, () => <PendingFuture>[]) | 2027 .putIfAbsent(target, () => <PendingFuture>[]) |
| 2031 .add(pendingFuture); | 2028 .add(pendingFuture); |
| 2032 scheduleComputation(); | 2029 scheduleComputation(); |
| 2033 } | 2030 } |
| 2034 return pendingFuture.future; | 2031 return pendingFuture.future; |
| 2035 } | 2032 } |
| 2036 } | 2033 } |
| OLD | NEW |