| OLD | NEW |
| 1 // This code was auto-generated, is not intended to be edited, and is subject to | 1 // This code was auto-generated, is not intended to be edited, and is subject to |
| 2 // significant change. Please see the README file for more information. | 2 // significant change. Please see the README file for more information. |
| 3 library engine; | 3 library engine; |
| 4 import 'java_core.dart'; | 4 import 'java_core.dart'; |
| 5 import 'java_engine.dart'; | 5 import 'java_engine.dart'; |
| 6 import 'utilities_collection.dart'; | 6 import 'utilities_collection.dart'; |
| 7 import 'utilities_general.dart'; | 7 import 'utilities_general.dart'; |
| 8 import 'instrumentation.dart'; | 8 import 'instrumentation.dart'; |
| 9 import 'error.dart'; | 9 import 'error.dart'; |
| 10 import 'source.dart'; | 10 import 'source.dart'; |
| (...skipping 3382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3393 { | 3393 { |
| 3394 for (MapEntry<Source, SourceEntry> mapEntry in _cache.entrySet()) { | 3394 for (MapEntry<Source, SourceEntry> mapEntry in _cache.entrySet()) { |
| 3395 SourceEntry entry = mapEntry.getValue(); | 3395 SourceEntry entry = mapEntry.getValue(); |
| 3396 if (entry is DartEntry) { | 3396 if (entry is DartEntry) { |
| 3397 Source source = mapEntry.getKey(); | 3397 Source source = mapEntry.getKey(); |
| 3398 DartEntry dartEntry = entry as DartEntry; | 3398 DartEntry dartEntry = entry as DartEntry; |
| 3399 SourceKind kind = dartEntry.getValue(DartEntry.SOURCE_KIND); | 3399 SourceKind kind = dartEntry.getValue(DartEntry.SOURCE_KIND); |
| 3400 statistics.putCacheItem(dartEntry, DartEntry.PARSE_ERRORS); | 3400 statistics.putCacheItem(dartEntry, DartEntry.PARSE_ERRORS); |
| 3401 statistics.putCacheItem(dartEntry, DartEntry.PARSED_UNIT); | 3401 statistics.putCacheItem(dartEntry, DartEntry.PARSED_UNIT); |
| 3402 statistics.putCacheItem(dartEntry, DartEntry.SOURCE_KIND); | 3402 statistics.putCacheItem(dartEntry, DartEntry.SOURCE_KIND); |
| 3403 statistics.putCacheItem(dartEntry, DartEntry.LINE_INFO); | 3403 statistics.putCacheItem(dartEntry, SourceEntry.LINE_INFO); |
| 3404 if (identical(kind, SourceKind.LIBRARY)) { | 3404 if (identical(kind, SourceKind.LIBRARY)) { |
| 3405 statistics.putCacheItem(dartEntry, DartEntry.ELEMENT); | 3405 statistics.putCacheItem(dartEntry, DartEntry.ELEMENT); |
| 3406 statistics.putCacheItem(dartEntry, DartEntry.EXPORTED_LIBRARIES); | 3406 statistics.putCacheItem(dartEntry, DartEntry.EXPORTED_LIBRARIES); |
| 3407 statistics.putCacheItem(dartEntry, DartEntry.IMPORTED_LIBRARIES); | 3407 statistics.putCacheItem(dartEntry, DartEntry.IMPORTED_LIBRARIES); |
| 3408 statistics.putCacheItem(dartEntry, DartEntry.INCLUDED_PARTS); | 3408 statistics.putCacheItem(dartEntry, DartEntry.INCLUDED_PARTS); |
| 3409 statistics.putCacheItem(dartEntry, DartEntry.IS_CLIENT); | 3409 statistics.putCacheItem(dartEntry, DartEntry.IS_CLIENT); |
| 3410 statistics.putCacheItem(dartEntry, DartEntry.IS_LAUNCHABLE); | 3410 statistics.putCacheItem(dartEntry, DartEntry.IS_LAUNCHABLE); |
| 3411 } | 3411 } |
| 3412 List<Source> librarySources = getLibrariesContaining(source); | 3412 List<Source> librarySources = getLibrariesContaining(source); |
| 3413 for (Source librarySource in librarySources) { | 3413 for (Source librarySource in librarySources) { |
| (...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4047 | 4047 |
| 4048 /** | 4048 /** |
| 4049 * Look through the cache for a task that needs to be performed. Return the ta
sk that was found, | 4049 * Look through the cache for a task that needs to be performed. Return the ta
sk that was found, |
| 4050 * or `null` if there is no more work to be done. | 4050 * or `null` if there is no more work to be done. |
| 4051 * | 4051 * |
| 4052 * @return the next task that needs to be performed | 4052 * @return the next task that needs to be performed |
| 4053 */ | 4053 */ |
| 4054 AnalysisTask get nextTaskAnalysisTask { | 4054 AnalysisTask get nextTaskAnalysisTask { |
| 4055 { | 4055 { |
| 4056 bool hintsEnabled = _options.hint; | 4056 bool hintsEnabled = _options.hint; |
| 4057 if (_incrementalAnalysisCache != null) { |
| 4058 AnalysisTask task = new IncrementalAnalysisTask(this, _incrementalAnalys
isCache); |
| 4059 _incrementalAnalysisCache = null; |
| 4060 } |
| 4057 for (Source source in _priorityOrder) { | 4061 for (Source source in _priorityOrder) { |
| 4058 AnalysisTask task = getNextTaskAnalysisTask2(source, _cache.get(source),
true, hintsEnabled); | 4062 AnalysisTask task = getNextTaskAnalysisTask2(source, _cache.get(source),
true, hintsEnabled); |
| 4059 if (task != null) { | 4063 if (task != null) { |
| 4060 return task; | 4064 return task; |
| 4061 } | 4065 } |
| 4062 } | 4066 } |
| 4063 for (MapEntry<Source, SourceEntry> entry in _cache.entrySet()) { | 4067 for (MapEntry<Source, SourceEntry> entry in _cache.entrySet()) { |
| 4064 AnalysisTask task = getNextTaskAnalysisTask2(entry.getKey(), entry.getVa
lue(), false, hintsEnabled); | 4068 AnalysisTask task = getNextTaskAnalysisTask2(entry.getKey(), entry.getVa
lue(), false, hintsEnabled); |
| 4065 if (task != null) { | 4069 if (task != null) { |
| 4066 return task; | 4070 return task; |
| (...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4573 } | 4577 } |
| 4574 } | 4578 } |
| 4575 } | 4579 } |
| 4576 if (thrownException != null) { | 4580 if (thrownException != null) { |
| 4577 throw thrownException; | 4581 throw thrownException; |
| 4578 } | 4582 } |
| 4579 return libraryEntry; | 4583 return libraryEntry; |
| 4580 } | 4584 } |
| 4581 | 4585 |
| 4582 /** | 4586 /** |
| 4587 * Record the results produced by performing a [IncrementalAnalysisTask]. |
| 4588 * |
| 4589 * @param task the task that was performed |
| 4590 * @return an entry containing the computed results |
| 4591 * @throws AnalysisException if the results could not be recorded |
| 4592 */ |
| 4593 DartEntry recordIncrementalAnalysisTaskResults(IncrementalAnalysisTask task) { |
| 4594 { |
| 4595 CompilationUnit unit = task.compilationUnit; |
| 4596 if (unit != null) { |
| 4597 ChangeNoticeImpl notice = getNotice(task.source); |
| 4598 notice.compilationUnit = unit; |
| 4599 } |
| 4600 } |
| 4601 return null; |
| 4602 } |
| 4603 |
| 4604 /** |
| 4583 * Record the results produced by performing a [ParseDartTask]. If the results
were computed | 4605 * Record the results produced by performing a [ParseDartTask]. If the results
were computed |
| 4584 * from data that is now out-of-date, then the results will not be recorded. | 4606 * from data that is now out-of-date, then the results will not be recorded. |
| 4585 * | 4607 * |
| 4586 * @param task the task that was performed | 4608 * @param task the task that was performed |
| 4587 * @return an entry containing the computed results | 4609 * @return an entry containing the computed results |
| 4588 * @throws AnalysisException if the results could not be recorded | 4610 * @throws AnalysisException if the results could not be recorded |
| 4589 */ | 4611 */ |
| 4590 DartEntry recordParseDartTaskResults(ParseDartTask task) { | 4612 DartEntry recordParseDartTaskResults(ParseDartTask task) { |
| 4591 Source source = task.source; | 4613 Source source = task.source; |
| 4592 AnalysisException thrownException = task.exception; | 4614 AnalysisException thrownException = task.exception; |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5026 } | 5048 } |
| 5027 /** | 5049 /** |
| 5028 * Instances of the class `AnalysisTaskResultRecorder` are used by an analysis c
ontext to | 5050 * Instances of the class `AnalysisTaskResultRecorder` are used by an analysis c
ontext to |
| 5029 * record the results of a task. | 5051 * record the results of a task. |
| 5030 */ | 5052 */ |
| 5031 class AnalysisContextImpl_AnalysisTaskResultRecorder implements AnalysisTaskVisi
tor<SourceEntry> { | 5053 class AnalysisContextImpl_AnalysisTaskResultRecorder implements AnalysisTaskVisi
tor<SourceEntry> { |
| 5032 final AnalysisContextImpl AnalysisContextImpl_this; | 5054 final AnalysisContextImpl AnalysisContextImpl_this; |
| 5033 AnalysisContextImpl_AnalysisTaskResultRecorder(this.AnalysisContextImpl_this); | 5055 AnalysisContextImpl_AnalysisTaskResultRecorder(this.AnalysisContextImpl_this); |
| 5034 SourceEntry visitGenerateDartErrorsTask(GenerateDartErrorsTask task) => Analys
isContextImpl_this.recordGenerateDartErrorsTask(task); | 5056 SourceEntry visitGenerateDartErrorsTask(GenerateDartErrorsTask task) => Analys
isContextImpl_this.recordGenerateDartErrorsTask(task); |
| 5035 SourceEntry visitGenerateDartHintsTask(GenerateDartHintsTask task) => Analysis
ContextImpl_this.recordGenerateDartHintsTask(task); | 5057 SourceEntry visitGenerateDartHintsTask(GenerateDartHintsTask task) => Analysis
ContextImpl_this.recordGenerateDartHintsTask(task); |
| 5058 SourceEntry visitIncrementalAnalysisTask(IncrementalAnalysisTask task) => Anal
ysisContextImpl_this.recordIncrementalAnalysisTaskResults(task); |
| 5036 DartEntry visitParseDartTask(ParseDartTask task) => AnalysisContextImpl_this.r
ecordParseDartTaskResults(task); | 5059 DartEntry visitParseDartTask(ParseDartTask task) => AnalysisContextImpl_this.r
ecordParseDartTaskResults(task); |
| 5037 HtmlEntry visitParseHtmlTask(ParseHtmlTask task) => AnalysisContextImpl_this.r
ecordParseHtmlTaskResults(task); | 5060 HtmlEntry visitParseHtmlTask(ParseHtmlTask task) => AnalysisContextImpl_this.r
ecordParseHtmlTaskResults(task); |
| 5038 DartEntry visitResolveDartLibraryTask(ResolveDartLibraryTask task) => Analysis
ContextImpl_this.recordResolveDartLibraryTaskResults(task); | 5061 DartEntry visitResolveDartLibraryTask(ResolveDartLibraryTask task) => Analysis
ContextImpl_this.recordResolveDartLibraryTaskResults(task); |
| 5039 SourceEntry visitResolveDartUnitTask(ResolveDartUnitTask task) => AnalysisCont
extImpl_this.recordResolveDartUnitTaskResults(task); | 5062 SourceEntry visitResolveDartUnitTask(ResolveDartUnitTask task) => AnalysisCont
extImpl_this.recordResolveDartUnitTaskResults(task); |
| 5040 SourceEntry visitResolveHtmlTask(ResolveHtmlTask task) => AnalysisContextImpl_
this.recordResolveHtmlTaskResults(task); | 5063 SourceEntry visitResolveHtmlTask(ResolveHtmlTask task) => AnalysisContextImpl_
this.recordResolveHtmlTaskResults(task); |
| 5041 } | 5064 } |
| 5042 class AnalysisContextImpl_ContextRetentionPolicy implements CacheRetentionPolicy
{ | 5065 class AnalysisContextImpl_ContextRetentionPolicy implements CacheRetentionPolicy
{ |
| 5043 final AnalysisContextImpl AnalysisContextImpl_this; | 5066 final AnalysisContextImpl AnalysisContextImpl_this; |
| 5044 AnalysisContextImpl_ContextRetentionPolicy(this.AnalysisContextImpl_this); | 5067 AnalysisContextImpl_ContextRetentionPolicy(this.AnalysisContextImpl_this); |
| 5045 RetentionPriority getAstPriority(Source source, SourceEntry sourceEntry) { | 5068 RetentionPriority getAstPriority(Source source, SourceEntry sourceEntry) { |
| (...skipping 1566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6612 /** | 6635 /** |
| 6613 * Visit a [GenerateDartHintsTask]. | 6636 * Visit a [GenerateDartHintsTask]. |
| 6614 * | 6637 * |
| 6615 * @param task the task to be visited | 6638 * @param task the task to be visited |
| 6616 * @return the result of visiting the task | 6639 * @return the result of visiting the task |
| 6617 * @throws AnalysisException if the visitor throws an exception for some reaso
n | 6640 * @throws AnalysisException if the visitor throws an exception for some reaso
n |
| 6618 */ | 6641 */ |
| 6619 E visitGenerateDartHintsTask(GenerateDartHintsTask task); | 6642 E visitGenerateDartHintsTask(GenerateDartHintsTask task); |
| 6620 | 6643 |
| 6621 /** | 6644 /** |
| 6645 * Visit an [IncrementalAnalysisTask]. |
| 6646 * |
| 6647 * @param task the task to be visited |
| 6648 * @return the result of visiting the task |
| 6649 * @throws AnalysisException if the visitor throws an exception for some reaso
n |
| 6650 */ |
| 6651 E visitIncrementalAnalysisTask(IncrementalAnalysisTask incrementalAnalysisTask
); |
| 6652 |
| 6653 /** |
| 6622 * Visit a [ParseDartTask]. | 6654 * Visit a [ParseDartTask]. |
| 6623 * | 6655 * |
| 6624 * @param task the task to be visited | 6656 * @param task the task to be visited |
| 6625 * @return the result of visiting the task | 6657 * @return the result of visiting the task |
| 6626 * @throws AnalysisException if the visitor throws an exception for some reaso
n | 6658 * @throws AnalysisException if the visitor throws an exception for some reaso
n |
| 6627 */ | 6659 */ |
| 6628 E visitParseDartTask(ParseDartTask task); | 6660 E visitParseDartTask(ParseDartTask task); |
| 6629 | 6661 |
| 6630 /** | 6662 /** |
| 6631 * Visit a [ParseHtmlTask]. | 6663 * Visit a [ParseHtmlTask]. |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6795 /** | 6827 /** |
| 6796 * Return the resolved compilation unit associated with the given source. | 6828 * Return the resolved compilation unit associated with the given source. |
| 6797 * | 6829 * |
| 6798 * @param unitSource the source for the compilation unit whose resolved AST is
to be returned | 6830 * @param unitSource the source for the compilation unit whose resolved AST is
to be returned |
| 6799 * @return the resolved compilation unit associated with the given source | 6831 * @return the resolved compilation unit associated with the given source |
| 6800 * @throws AnalysisException if the resolved compilation unit could not be com
puted | 6832 * @throws AnalysisException if the resolved compilation unit could not be com
puted |
| 6801 */ | 6833 */ |
| 6802 TimestampedData<CompilationUnit> getCompilationUnit(Source unitSource) => cont
ext.internalResolveCompilationUnit(unitSource, libraryElement); | 6834 TimestampedData<CompilationUnit> getCompilationUnit(Source unitSource) => cont
ext.internalResolveCompilationUnit(unitSource, libraryElement); |
| 6803 } | 6835 } |
| 6804 /** | 6836 /** |
| 6837 * Instances of the class `IncrementalAnalysisTask` incrementally update existin
g analysis. |
| 6838 */ |
| 6839 class IncrementalAnalysisTask extends AnalysisTask { |
| 6840 |
| 6841 /** |
| 6842 * The information used to perform incremental analysis. |
| 6843 */ |
| 6844 IncrementalAnalysisCache _cache; |
| 6845 |
| 6846 /** |
| 6847 * The compilation unit that was produced by incrementally updating the existi
ng unit. |
| 6848 */ |
| 6849 CompilationUnit compilationUnit; |
| 6850 |
| 6851 /** |
| 6852 * Initialize a newly created task to perform analysis within the given contex
t. |
| 6853 * |
| 6854 * @param context the context in which the task is to be performed |
| 6855 * @param cache the incremental analysis cache used to perform the analysis |
| 6856 */ |
| 6857 IncrementalAnalysisTask(InternalAnalysisContext context, IncrementalAnalysisCa
che cache) : super(context) { |
| 6858 this._cache = cache; |
| 6859 } |
| 6860 accept(AnalysisTaskVisitor visitor) => visitor.visitIncrementalAnalysisTask(th
is); |
| 6861 |
| 6862 /** |
| 6863 * Return the source that is to be incrementally analyzed. |
| 6864 * |
| 6865 * @return the source |
| 6866 */ |
| 6867 Source get source => _cache != null ? _cache.source : null; |
| 6868 String get taskDescription => "incremental analysis ${(_cache != null ? _cache
.source : "null")}"; |
| 6869 void internalPerform() { |
| 6870 if (_cache == null) { |
| 6871 return; |
| 6872 } |
| 6873 compilationUnit = _cache.resolvedUnit; |
| 6874 } |
| 6875 } |
| 6876 /** |
| 6805 * Instances of the class `ParseDartTask` parse a specific source as a Dart file
. | 6877 * Instances of the class `ParseDartTask` parse a specific source as a Dart file
. |
| 6806 */ | 6878 */ |
| 6807 class ParseDartTask extends AnalysisTask { | 6879 class ParseDartTask extends AnalysisTask { |
| 6808 | 6880 |
| 6809 /** | 6881 /** |
| 6810 * The source to be parsed. | 6882 * The source to be parsed. |
| 6811 */ | 6883 */ |
| 6812 Source source; | 6884 Source source; |
| 6813 | 6885 |
| 6814 /** | 6886 /** |
| (...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7408 } | 7480 } |
| 7409 void logError2(String message, Exception exception) { | 7481 void logError2(String message, Exception exception) { |
| 7410 } | 7482 } |
| 7411 void logError3(Exception exception) { | 7483 void logError3(Exception exception) { |
| 7412 } | 7484 } |
| 7413 void logInformation(String message) { | 7485 void logInformation(String message) { |
| 7414 } | 7486 } |
| 7415 void logInformation2(String message, Exception exception) { | 7487 void logInformation2(String message, Exception exception) { |
| 7416 } | 7488 } |
| 7417 } | 7489 } |
| OLD | NEW |