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

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

Issue 2091883002: Add '--finer-grained-invalidation' option to Analysis Server. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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
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/dart/ast/ast.dart'; 10 import 'package:analyzer/dart/ast/ast.dart';
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 this._options.enableSuperMixins = options.enableSuperMixins; 302 this._options.enableSuperMixins = options.enableSuperMixins;
303 this._options.enableTiming = options.enableTiming; 303 this._options.enableTiming = options.enableTiming;
304 this._options.hint = options.hint; 304 this._options.hint = options.hint;
305 this._options.incremental = options.incremental; 305 this._options.incremental = options.incremental;
306 this._options.incrementalApi = options.incrementalApi; 306 this._options.incrementalApi = options.incrementalApi;
307 this._options.incrementalValidation = options.incrementalValidation; 307 this._options.incrementalValidation = options.incrementalValidation;
308 this._options.lint = options.lint; 308 this._options.lint = options.lint;
309 this._options.preserveComments = options.preserveComments; 309 this._options.preserveComments = options.preserveComments;
310 this._options.strongMode = options.strongMode; 310 this._options.strongMode = options.strongMode;
311 this._options.trackCacheDependencies = options.trackCacheDependencies; 311 this._options.trackCacheDependencies = options.trackCacheDependencies;
312 this._options.finerGrainedInvalidation = options.finerGrainedInvalidation;
312 if (options is AnalysisOptionsImpl) { 313 if (options is AnalysisOptionsImpl) {
313 this._options.strongModeHints = options.strongModeHints; 314 this._options.strongModeHints = options.strongModeHints;
314 this._options.implicitCasts = options.implicitCasts; 315 this._options.implicitCasts = options.implicitCasts;
315 } 316 }
316 if (needsRecompute) { 317 if (needsRecompute) {
317 for (WorkManager workManager in workManagers) { 318 for (WorkManager workManager in workManagers) {
318 workManager.onAnalysisOptionsChanged(); 319 workManager.onAnalysisOptionsChanged();
319 } 320 }
320 } 321 }
321 } 322 }
(...skipping 1543 matching lines...) Expand 10 before | Expand all | Expand 10 after
1865 } 1866 }
1866 return; 1867 return;
1867 } 1868 }
1868 } catch (e) { 1869 } catch (e) {
1869 entry.modificationTime = -1; 1870 entry.modificationTime = -1;
1870 } 1871 }
1871 } 1872 }
1872 // We need to invalidate the cache. 1873 // We need to invalidate the cache.
1873 { 1874 {
1874 Object delta = null; 1875 Object delta = null;
1875 if (AnalysisEngine.instance.limitInvalidationInTaskModel && 1876 if (analysisOptions.finerGrainedInvalidation &&
1876 AnalysisEngine.isDartFileName(source.fullName)) { 1877 AnalysisEngine.isDartFileName(source.fullName)) {
1877 // TODO(scheglov) Incorrect implementation in general. 1878 // TODO(scheglov) Incorrect implementation in general.
1878 entry.setState(TOKEN_STREAM, CacheState.FLUSHED); 1879 entry.setState(TOKEN_STREAM, CacheState.FLUSHED);
1879 entry.setState(PARSED_UNIT, CacheState.FLUSHED); 1880 entry.setState(PARSED_UNIT, CacheState.FLUSHED);
1880 List<Source> librarySources = getLibrariesContaining(source); 1881 List<Source> librarySources = getLibrariesContaining(source);
1881 if (librarySources.length == 1) { 1882 if (librarySources.length == 1) {
1882 Source librarySource = librarySources[0]; 1883 Source librarySource = librarySources[0];
1883 CompilationUnit oldUnit = 1884 CompilationUnit oldUnit =
1884 getResolvedCompilationUnit2(source, librarySource); 1885 getResolvedCompilationUnit2(source, librarySource);
1885 if (oldUnit != null) { 1886 if (oldUnit != null) {
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
2239 } 2240 }
2240 DartSdk sdk = factory.dartSdk; 2241 DartSdk sdk = factory.dartSdk;
2241 if (sdk == null) { 2242 if (sdk == null) {
2242 throw new IllegalArgumentException( 2243 throw new IllegalArgumentException(
2243 "The source factory for an SDK analysis context must have a DartUriRes olver"); 2244 "The source factory for an SDK analysis context must have a DartUriRes olver");
2244 } 2245 }
2245 return new AnalysisCache( 2246 return new AnalysisCache(
2246 <CachePartition>[AnalysisEngine.instance.partitionManager.forSdk(sdk)]); 2247 <CachePartition>[AnalysisEngine.instance.partitionManager.forSdk(sdk)]);
2247 } 2248 }
2248 } 2249 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/server/driver.dart ('k') | pkg/analyzer/lib/src/generated/engine.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698