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

Side by Side Diff: pkg/analyzer/lib/src/generated/engine.dart

Issue 1210603002: Add an analyzer method to flush resolved ASTs (for testing). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine; 8 library engine;
9 9
10 import 'dart:async'; 10 import 'dart:async';
(...skipping 2562 matching lines...) Expand 10 before | Expand all | Expand 10 after
2573 if (source.isInSystemLibrary) { 2573 if (source.isInSystemLibrary) {
2574 return _generateSdkErrors; 2574 return _generateSdkErrors;
2575 } else if (!dartEntry.explicitlyAdded) { 2575 } else if (!dartEntry.explicitlyAdded) {
2576 return _generateImplicitErrors; 2576 return _generateImplicitErrors;
2577 } else { 2577 } else {
2578 return true; 2578 return true;
2579 } 2579 }
2580 } 2580 }
2581 2581
2582 @override 2582 @override
2583 void test_flushResolvedUnit(Source source) {
2584 DartEntry dartEntry = getReadableSourceEntryOrNull(source);
2585 dartEntry.flushAstStructures();
2586 }
2587
2588 @override
2583 bool validateCacheConsistency() { 2589 bool validateCacheConsistency() {
2584 int consistencyCheckStart = JavaSystem.nanoTime(); 2590 int consistencyCheckStart = JavaSystem.nanoTime();
2585 List<Source> changedSources = new List<Source>(); 2591 List<Source> changedSources = new List<Source>();
2586 List<Source> missingSources = new List<Source>(); 2592 List<Source> missingSources = new List<Source>();
2587 MapIterator<Source, SourceEntry> iterator = _cache.iterator(); 2593 MapIterator<Source, SourceEntry> iterator = _cache.iterator();
2588 while (iterator.moveNext()) { 2594 while (iterator.moveNext()) {
2589 Source source = iterator.key; 2595 Source source = iterator.key;
2590 SourceEntry sourceEntry = iterator.value; 2596 SourceEntry sourceEntry = iterator.value;
2591 int sourceTime = getModificationStamp(source); 2597 int sourceTime = getModificationStamp(source);
2592 if (sourceTime != sourceEntry.modificationTime) { 2598 if (sourceTime != sourceEntry.modificationTime) {
(...skipping 1493 matching lines...) Expand 10 before | Expand all | Expand 10 after
4086 if (_isClient(exported, htmlSource, visitedLibraries)) { 4092 if (_isClient(exported, htmlSource, visitedLibraries)) {
4087 return true; 4093 return true;
4088 } 4094 }
4089 } 4095 }
4090 return false; 4096 return false;
4091 } 4097 }
4092 4098
4093 bool _isTooBigHtmlSourceEntry(Source source, SourceEntry sourceEntry) => 4099 bool _isTooBigHtmlSourceEntry(Source source, SourceEntry sourceEntry) =>
4094 false; 4100 false;
4095 4101
4096 /**
4097 * Log the given debugging [message].
4098 */
4099 void _logInformation(String message) {
4100 AnalysisEngine.instance.logger.logInformation(message);
4101 }
4102
4103 // /** 4102 // /**
4104 // * Notify all of the analysis listeners that the given source is no longer i ncluded in the set of 4103 // * Notify all of the analysis listeners that the given source is no longer i ncluded in the set of
4105 // * sources that are being analyzed. 4104 // * sources that are being analyzed.
4106 // * 4105 // *
4107 // * @param source the source that is no longer being analyzed 4106 // * @param source the source that is no longer being analyzed
4108 // */ 4107 // */
4109 // void _notifyExcludedSource(Source source) { 4108 // void _notifyExcludedSource(Source source) {
4110 // int count = _listeners.length; 4109 // int count = _listeners.length;
4111 // for (int i = 0; i < count; i++) { 4110 // for (int i = 0; i < count; i++) {
4112 // _listeners[i].excludedSource(this, source); 4111 // _listeners[i].excludedSource(this, source);
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
4172 // * @param unit the result of resolving the source 4171 // * @param unit the result of resolving the source
4173 // */ 4172 // */
4174 // void _notifyResolvedHtml(Source source, ht.HtmlUnit unit) { 4173 // void _notifyResolvedHtml(Source source, ht.HtmlUnit unit) {
4175 // int count = _listeners.length; 4174 // int count = _listeners.length;
4176 // for (int i = 0; i < count; i++) { 4175 // for (int i = 0; i < count; i++) {
4177 // _listeners[i].resolvedHtml(this, source, unit); 4176 // _listeners[i].resolvedHtml(this, source, unit);
4178 // } 4177 // }
4179 // } 4178 // }
4180 4179
4181 /** 4180 /**
4181 * Log the given debugging [message].
4182 */
4183 void _logInformation(String message) {
Brian Wilkerson 2015/06/24 16:56:58 I would have expected "_l" to sort before "_n". Is
Paul Berry 2015/06/24 20:08:32 Fixed.
4184 AnalysisEngine.instance.logger.logInformation(message);
4185 }
4186
4187 /**
4182 * Notify all of the analysis listeners that a task is about to be performed. 4188 * Notify all of the analysis listeners that a task is about to be performed.
4183 */ 4189 */
4184 void _notifyAboutToPerformTask(String taskDescription) { 4190 void _notifyAboutToPerformTask(String taskDescription) {
4185 int count = _listeners.length; 4191 int count = _listeners.length;
4186 for (int i = 0; i < count; i++) { 4192 for (int i = 0; i < count; i++) {
4187 _listeners[i].aboutToPerformTask(this, taskDescription); 4193 _listeners[i].aboutToPerformTask(this, taskDescription);
4188 } 4194 }
4189 } 4195 }
4190 4196
4191 /** 4197 /**
(...skipping 5108 matching lines...) Expand 10 before | Expand all | Expand 10 after
9300 /** 9306 /**
9301 * Return `true` if errors should be produced for the given [source]. 9307 * Return `true` if errors should be produced for the given [source].
9302 * The [entry] associated with the source is passed in for efficiency. 9308 * The [entry] associated with the source is passed in for efficiency.
9303 * 9309 *
9304 * TODO(scheglov) remove [entry] after migration to the new task model. 9310 * TODO(scheglov) remove [entry] after migration to the new task model.
9305 * It is not used there anyway. 9311 * It is not used there anyway.
9306 */ 9312 */
9307 bool shouldErrorsBeAnalyzed(Source source, Object entry); 9313 bool shouldErrorsBeAnalyzed(Source source, Object entry);
9308 9314
9309 /** 9315 /**
9316 * For testing only: flush any resolution information for the given [source]
9317 * out of the cache.
9318 */
9319 void test_flushResolvedUnit(Source source);
9320
9321 /**
9310 * Call the given callback function for eache cache item in the context. 9322 * Call the given callback function for eache cache item in the context.
9311 */ 9323 */
9312 void visitCacheItems(void callback(Source source, SourceEntry dartEntry, 9324 void visitCacheItems(void callback(Source source, SourceEntry dartEntry,
9313 DataDescriptor rowDesc, CacheState state)); 9325 DataDescriptor rowDesc, CacheState state));
9314 } 9326 }
9315 9327
9316 /** 9328 /**
9317 * An object that can be used to receive information about errors within the 9329 * An object that can be used to receive information about errors within the
9318 * analysis engine. Implementations usually write this information to a file, 9330 * analysis engine. Implementations usually write this information to a file,
9319 * but can also record the information for later use (such as during testing) or 9331 * but can also record the information for later use (such as during testing) or
(...skipping 2513 matching lines...) Expand 10 before | Expand all | Expand 10 after
11833 PendingFuture pendingFuture = 11845 PendingFuture pendingFuture =
11834 new PendingFuture<T>(_context, source, computeValue); 11846 new PendingFuture<T>(_context, source, computeValue);
11835 if (!pendingFuture.evaluate(sourceEntry)) { 11847 if (!pendingFuture.evaluate(sourceEntry)) {
11836 _context._pendingFutureSources 11848 _context._pendingFutureSources
11837 .putIfAbsent(source, () => <PendingFuture>[]) 11849 .putIfAbsent(source, () => <PendingFuture>[])
11838 .add(pendingFuture); 11850 .add(pendingFuture);
11839 } 11851 }
11840 return pendingFuture.future; 11852 return pendingFuture.future;
11841 } 11853 }
11842 } 11854 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698