Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: pkg/analyzer/lib/src/context/context.dart

Issue 1220633003: Try incremental analysis before limiting invalidation. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/incremental_resolver.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/incremental_resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698