| OLD | NEW |
| 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 6694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6705 * it's cached AST structure flushed. | 6705 * it's cached AST structure flushed. |
| 6706 */ | 6706 */ |
| 6707 List<Source> _recentlyUsed; | 6707 List<Source> _recentlyUsed; |
| 6708 | 6708 |
| 6709 /** | 6709 /** |
| 6710 * Initialize a newly created cache to maintain at most [maxCacheSize] AST | 6710 * Initialize a newly created cache to maintain at most [maxCacheSize] AST |
| 6711 * structures in the cache. The cache is owned by the give [context], and the | 6711 * structures in the cache. The cache is owned by the give [context], and the |
| 6712 * [retentionPolicy] will be used to determine which pieces of data to remove | 6712 * [retentionPolicy] will be used to determine which pieces of data to remove |
| 6713 * from the cache. | 6713 * from the cache. |
| 6714 */ | 6714 */ |
| 6715 CachePartition(this.context, int maxCacheSize, this._retentionPolicy) { | 6715 CachePartition(this.context, this._maxCacheSize, this._retentionPolicy) { |
| 6716 this._maxCacheSize = maxCacheSize; | |
| 6717 _recentlyUsed = new List<Source>(); | 6716 _recentlyUsed = new List<Source>(); |
| 6718 } | 6717 } |
| 6719 | 6718 |
| 6720 /** | 6719 /** |
| 6721 * Return the number of entries in this partition that have an AST associated | 6720 * Return the number of entries in this partition that have an AST associated |
| 6722 * with them. | 6721 * with them. |
| 6723 */ | 6722 */ |
| 6724 int get astSize { | 6723 int get astSize { |
| 6725 int astSize = 0; | 6724 int astSize = 0; |
| 6726 int count = _recentlyUsed.length; | 6725 int count = _recentlyUsed.length; |
| (...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7363 | 7362 |
| 7364 /** | 7363 /** |
| 7365 * The (source, entry) pairs representing the compilation units in the | 7364 * The (source, entry) pairs representing the compilation units in the |
| 7366 * library. | 7365 * library. |
| 7367 */ | 7366 */ |
| 7368 List<CycleBuilder_SourceEntryPair> entryPairs; | 7367 List<CycleBuilder_SourceEntryPair> entryPairs; |
| 7369 | 7368 |
| 7370 /** | 7369 /** |
| 7371 * Initialize a newly created pair from the given [library] and [entryPairs]. | 7370 * Initialize a newly created pair from the given [library] and [entryPairs]. |
| 7372 */ | 7371 */ |
| 7373 CycleBuilder_LibraryPair(ResolvableLibrary library, | 7372 CycleBuilder_LibraryPair(this.library, this.entryPairs); |
| 7374 List<CycleBuilder_SourceEntryPair> entryPairs) { | |
| 7375 this.library = library; | |
| 7376 this.entryPairs = entryPairs; | |
| 7377 } | |
| 7378 } | 7373 } |
| 7379 | 7374 |
| 7380 /** | 7375 /** |
| 7381 * A pair containing a source and the cache entry associated with that source. | 7376 * A pair containing a source and the cache entry associated with that source. |
| 7382 * They are used to reduce the number of times an entry must be looked up in the | 7377 * They are used to reduce the number of times an entry must be looked up in the |
| 7383 * cache. | 7378 * cache. |
| 7384 */ | 7379 */ |
| 7385 class CycleBuilder_SourceEntryPair { | 7380 class CycleBuilder_SourceEntryPair { |
| 7386 /** | 7381 /** |
| 7387 * The source associated with the entry. | 7382 * The source associated with the entry. |
| 7388 */ | 7383 */ |
| 7389 Source source; | 7384 Source source; |
| 7390 | 7385 |
| 7391 /** | 7386 /** |
| 7392 * The entry associated with the source. | 7387 * The entry associated with the source. |
| 7393 */ | 7388 */ |
| 7394 DartEntry entry; | 7389 DartEntry entry; |
| 7395 | 7390 |
| 7396 /** | 7391 /** |
| 7397 * Initialize a newly created pair from the given [source] and [entry]. | 7392 * Initialize a newly created pair from the given [source] and [entry]. |
| 7398 */ | 7393 */ |
| 7399 CycleBuilder_SourceEntryPair(Source source, DartEntry entry) { | 7394 CycleBuilder_SourceEntryPair(this.source, this.entry); |
| 7400 this.source = source; | |
| 7401 this.entry = entry; | |
| 7402 } | |
| 7403 } | 7395 } |
| 7404 | 7396 |
| 7405 /** | 7397 /** |
| 7406 * The information cached by an analysis context about an individual Dart file. | 7398 * The information cached by an analysis context about an individual Dart file. |
| 7407 */ | 7399 */ |
| 7408 class DartEntry extends SourceEntry { | 7400 class DartEntry extends SourceEntry { |
| 7409 /** | 7401 /** |
| 7410 * The data descriptor representing the element model representing a single | 7402 * The data descriptor representing the element model representing a single |
| 7411 * compilation unit. This model is incomplete and should not be used except as | 7403 * compilation unit. This model is incomplete and should not be used except as |
| 7412 * input to another task. | 7404 * input to another task. |
| (...skipping 1536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8949 | 8941 |
| 8950 String _newContents; | 8942 String _newContents; |
| 8951 | 8943 |
| 8952 int _offset = 0; | 8944 int _offset = 0; |
| 8953 | 8945 |
| 8954 int _oldLength = 0; | 8946 int _oldLength = 0; |
| 8955 | 8947 |
| 8956 int _newLength = 0; | 8948 int _newLength = 0; |
| 8957 | 8949 |
| 8958 IncrementalAnalysisCache(this.librarySource, this.source, this.resolvedUnit, | 8950 IncrementalAnalysisCache(this.librarySource, this.source, this.resolvedUnit, |
| 8959 this.oldContents, String newContents, int offset, int oldLength, | 8951 this.oldContents, this._newContents, this._offset, this._oldLength, |
| 8960 int newLength) { | 8952 this._newLength); |
| 8961 this._newContents = newContents; | |
| 8962 this._offset = offset; | |
| 8963 this._oldLength = oldLength; | |
| 8964 this._newLength = newLength; | |
| 8965 } | |
| 8966 | 8953 |
| 8967 /** | 8954 /** |
| 8968 * Determine if the cache contains source changes that need to be analyzed | 8955 * Determine if the cache contains source changes that need to be analyzed |
| 8969 * | 8956 * |
| 8970 * @return `true` if the cache contains changes to be analyzed, else `false` | 8957 * @return `true` if the cache contains changes to be analyzed, else `false` |
| 8971 */ | 8958 */ |
| 8972 bool get hasWork => _oldLength > 0 || _newLength > 0; | 8959 bool get hasWork => _oldLength > 0 || _newLength > 0; |
| 8973 | 8960 |
| 8974 /** | 8961 /** |
| 8975 * Return the current contents for the receiver's source. | 8962 * Return the current contents for the receiver's source. |
| (...skipping 2944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11920 PendingFuture pendingFuture = | 11907 PendingFuture pendingFuture = |
| 11921 new PendingFuture<T>(_context, source, computeValue); | 11908 new PendingFuture<T>(_context, source, computeValue); |
| 11922 if (!pendingFuture.evaluate(sourceEntry)) { | 11909 if (!pendingFuture.evaluate(sourceEntry)) { |
| 11923 _context._pendingFutureSources | 11910 _context._pendingFutureSources |
| 11924 .putIfAbsent(source, () => <PendingFuture>[]) | 11911 .putIfAbsent(source, () => <PendingFuture>[]) |
| 11925 .add(pendingFuture); | 11912 .add(pendingFuture); |
| 11926 } | 11913 } |
| 11927 return pendingFuture.future; | 11914 return pendingFuture.future; |
| 11928 } | 11915 } |
| 11929 } | 11916 } |
| OLD | NEW |