| 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:collection'; | 10 import 'dart:collection'; |
| (...skipping 2787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2798 } else { | 2798 } else { |
| 2799 DartEntry dartEntry = new DartEntry(); | 2799 DartEntry dartEntry = new DartEntry(); |
| 2800 dartEntry.modificationTime = getModificationStamp(source); | 2800 dartEntry.modificationTime = getModificationStamp(source); |
| 2801 dartEntry.explicitlyAdded = explicitlyAdded; | 2801 dartEntry.explicitlyAdded = explicitlyAdded; |
| 2802 _cache.put(source, dartEntry); | 2802 _cache.put(source, dartEntry); |
| 2803 return dartEntry; | 2803 return dartEntry; |
| 2804 } | 2804 } |
| 2805 } | 2805 } |
| 2806 | 2806 |
| 2807 /** | 2807 /** |
| 2808 * Return a string with debugging information about the given source (the full
name and | |
| 2809 * modification stamp of the source). | |
| 2810 * | |
| 2811 * @param source the source for which a debugging string is to be produced | |
| 2812 * @return debugging information about the given source | |
| 2813 */ | |
| 2814 String _debuggingString(Source source) => "'${source.fullName}' [${getModifica
tionStamp(source)}]"; | |
| 2815 | |
| 2816 /** | |
| 2817 * Return an array containing all of the change notices that are waiting to be
returned. If there | 2808 * Return an array containing all of the change notices that are waiting to be
returned. If there |
| 2818 * are no notices, then return either `null` or an empty array, depending on t
he value of | 2809 * are no notices, then return either `null` or an empty array, depending on t
he value of |
| 2819 * the argument. | 2810 * the argument. |
| 2820 * | 2811 * |
| 2821 * @param nullIfEmpty `true` if `null` should be returned when there are no no
tices | 2812 * @param nullIfEmpty `true` if `null` should be returned when there are no no
tices |
| 2822 * @return the change notices that are waiting to be returned | 2813 * @return the change notices that are waiting to be returned |
| 2823 */ | 2814 */ |
| 2824 List<ChangeNotice> _getChangeNotices(bool nullIfEmpty) { | 2815 List<ChangeNotice> _getChangeNotices(bool nullIfEmpty) { |
| 2825 if (_pendingNotices.isEmpty) { | 2816 if (_pendingNotices.isEmpty) { |
| 2826 if (nullIfEmpty) { | 2817 if (nullIfEmpty) { |
| (...skipping 5752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8579 */ | 8570 */ |
| 8580 bool _isValidLibraryDescriptor(DataDescriptor descriptor) { | 8571 bool _isValidLibraryDescriptor(DataDescriptor descriptor) { |
| 8581 return descriptor == ANGULAR_ERRORS | 8572 return descriptor == ANGULAR_ERRORS |
| 8582 || descriptor == BUILT_ELEMENT | 8573 || descriptor == BUILT_ELEMENT |
| 8583 || descriptor == BUILT_UNIT | 8574 || descriptor == BUILT_UNIT |
| 8584 || descriptor == HINTS | 8575 || descriptor == HINTS |
| 8585 || descriptor == RESOLUTION_ERRORS | 8576 || descriptor == RESOLUTION_ERRORS |
| 8586 || descriptor == RESOLVED_UNIT | 8577 || descriptor == RESOLVED_UNIT |
| 8587 || descriptor == VERIFICATION_ERRORS; | 8578 || descriptor == VERIFICATION_ERRORS; |
| 8588 } | 8579 } |
| 8589 | |
| 8590 /** | |
| 8591 * Given that the specified flag is being transitioned to the given state, set
the value of the | |
| 8592 * flag to the value that should be kept in the cache. | |
| 8593 * | |
| 8594 * @param index the index of the flag whose state is being set | |
| 8595 * @param state the state to which the value is being transitioned | |
| 8596 */ | |
| 8597 void _updateValueOfFlag(int index, CacheState state) { | |
| 8598 if (state == CacheState.VALID) { | |
| 8599 throw new IllegalArgumentException("Use setValue() to set the state to VAL
ID"); | |
| 8600 } else if (state != CacheState.IN_PROCESS) { | |
| 8601 // | |
| 8602 // If the value is in process, we can leave the current value in the cache
for any 'get' | |
| 8603 // methods to access. | |
| 8604 // | |
| 8605 _setFlag(index, false); | |
| 8606 } | |
| 8607 } | |
| 8608 } | 8580 } |
| 8609 | 8581 |
| 8610 /** | 8582 /** |
| 8611 * Instances of the class `DataDescriptor` are immutable constants representing
data that can | 8583 * Instances of the class `DataDescriptor` are immutable constants representing
data that can |
| 8612 * be stored in the cache. | 8584 * be stored in the cache. |
| 8613 */ | 8585 */ |
| 8614 class DataDescriptor<E> { | 8586 class DataDescriptor<E> { |
| 8615 /** | 8587 /** |
| 8616 * The name of the descriptor, used for debugging purposes. | 8588 * The name of the descriptor, used for debugging purposes. |
| 8617 */ | 8589 */ |
| (...skipping 4514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13132 } | 13104 } |
| 13133 | 13105 |
| 13134 @override | 13106 @override |
| 13135 String toString() { | 13107 String toString() { |
| 13136 StringBuffer buffer = new StringBuffer(); | 13108 StringBuffer buffer = new StringBuffer(); |
| 13137 _writeOn(buffer); | 13109 _writeOn(buffer); |
| 13138 return buffer.toString(); | 13110 return buffer.toString(); |
| 13139 } | 13111 } |
| 13140 | 13112 |
| 13141 /** | 13113 /** |
| 13142 * Set the value of all of the flags with the given [indexes] to false. | |
| 13143 */ | |
| 13144 void _clearFlags(List<int> indexes) { | |
| 13145 for (int i = 0; i < indexes.length; i++) { | |
| 13146 _flags = BooleanArray.set(_flags, indexes[i], false); | |
| 13147 } | |
| 13148 } | |
| 13149 | |
| 13150 /** | |
| 13151 * Flush the value of the data described by the [descriptor]. | 13114 * Flush the value of the data described by the [descriptor]. |
| 13152 */ | 13115 */ |
| 13153 void _flush(DataDescriptor descriptor) { | 13116 void _flush(DataDescriptor descriptor) { |
| 13154 CachedResult result = resultMap[descriptor]; | 13117 CachedResult result = resultMap[descriptor]; |
| 13155 if (result != null && result.state == CacheState.VALID) { | 13118 if (result != null && result.state == CacheState.VALID) { |
| 13156 _validateStateChange(descriptor, CacheState.FLUSHED); | 13119 _validateStateChange(descriptor, CacheState.FLUSHED); |
| 13157 result.state = CacheState.FLUSHED; | 13120 result.state = CacheState.FLUSHED; |
| 13158 result.value = descriptor.defaultValue; | 13121 result.value = descriptor.defaultValue; |
| 13159 } | 13122 } |
| 13160 } | 13123 } |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13569 _index++; | 13532 _index++; |
| 13570 if (_index >= _manager._workQueues[_queueIndex].length) { | 13533 if (_index >= _manager._workQueues[_queueIndex].length) { |
| 13571 _index = 0; | 13534 _index = 0; |
| 13572 _queueIndex++; | 13535 _queueIndex++; |
| 13573 while (_queueIndex < _manager._workQueues.length && _manager._workQueues[_
queueIndex].isEmpty) { | 13536 while (_queueIndex < _manager._workQueues.length && _manager._workQueues[_
queueIndex].isEmpty) { |
| 13574 _queueIndex++; | 13537 _queueIndex++; |
| 13575 } | 13538 } |
| 13576 } | 13539 } |
| 13577 } | 13540 } |
| 13578 } | 13541 } |
| OLD | NEW |