| 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 1521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1532 return namespace; | 1532 return namespace; |
| 1533 } | 1533 } |
| 1534 | 1534 |
| 1535 @override | 1535 @override |
| 1536 List<Source> get refactoringUnsafeSources { | 1536 List<Source> get refactoringUnsafeSources { |
| 1537 List<Source> sources = new List<Source>(); | 1537 List<Source> sources = new List<Source>(); |
| 1538 MapIterator<Source, SourceEntry> iterator = _cache.iterator(); | 1538 MapIterator<Source, SourceEntry> iterator = _cache.iterator(); |
| 1539 while (iterator.moveNext()) { | 1539 while (iterator.moveNext()) { |
| 1540 SourceEntry sourceEntry = iterator.value; | 1540 SourceEntry sourceEntry = iterator.value; |
| 1541 if (sourceEntry is DartEntry) { | 1541 if (sourceEntry is DartEntry) { |
| 1542 if (!sourceEntry.isRefactoringSafe) { | 1542 Source source = iterator.key; |
| 1543 sources.add(iterator.key); | 1543 if (!source.isInSystemLibrary && !sourceEntry.isRefactoringSafe) { |
| 1544 sources.add(source); |
| 1544 } | 1545 } |
| 1545 } | 1546 } |
| 1546 } | 1547 } |
| 1547 return new List.from(sources); | 1548 return sources; |
| 1548 } | 1549 } |
| 1549 | 1550 |
| 1550 @override | 1551 @override |
| 1551 CompilationUnit getResolvedCompilationUnit(Source unitSource, LibraryElement l
ibrary) { | 1552 CompilationUnit getResolvedCompilationUnit(Source unitSource, LibraryElement l
ibrary) { |
| 1552 if (library == null) { | 1553 if (library == null) { |
| 1553 return null; | 1554 return null; |
| 1554 } | 1555 } |
| 1555 return getResolvedCompilationUnit2(unitSource, library.source); | 1556 return getResolvedCompilationUnit2(unitSource, library.source); |
| 1556 } | 1557 } |
| 1557 | 1558 |
| (...skipping 10409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11967 static int _DEFAULT_SDK_CACHE_SIZE = 256; | 11968 static int _DEFAULT_SDK_CACHE_SIZE = 256; |
| 11968 | 11969 |
| 11969 /** | 11970 /** |
| 11970 * Clear any cached data being maintained by this manager. | 11971 * Clear any cached data being maintained by this manager. |
| 11971 */ | 11972 */ |
| 11972 void clearCache() { | 11973 void clearCache() { |
| 11973 _sdkPartitions.clear(); | 11974 _sdkPartitions.clear(); |
| 11974 } | 11975 } |
| 11975 | 11976 |
| 11976 /** | 11977 /** |
| 11977 * Return the partition being used for the given SDK, creating the partition i
f necessary. | 11978 * Return the partition being used for the given SDK, creating the partition |
| 11979 * if necessary. |
| 11978 * | 11980 * |
| 11979 * @param sdk the SDK for which a partition is being requested | 11981 * [sdk] - the SDK for which a partition is being requested. |
| 11980 * @return the partition being used for the given SDK | |
| 11981 */ | 11982 */ |
| 11982 SdkCachePartition forSdk(DartSdk sdk) { | 11983 SdkCachePartition forSdk(DartSdk sdk) { |
| 11984 // Call sdk.context now, because when it creates a new |
| 11985 // InternalAnalysisContext instance, it calls forSdk() again, so creates an |
| 11986 // SdkCachePartition instance. |
| 11987 // So, if we initialize context after "partition == null", we end up |
| 11988 // with two SdkCachePartition instances. |
| 11989 InternalAnalysisContext sdkContext = sdk.context; |
| 11990 // Check cache for an existing partition. |
| 11983 SdkCachePartition partition = _sdkPartitions[sdk]; | 11991 SdkCachePartition partition = _sdkPartitions[sdk]; |
| 11984 if (partition == null) { | 11992 if (partition == null) { |
| 11985 partition = new SdkCachePartition(sdk.context as InternalAnalysisContext,
_DEFAULT_SDK_CACHE_SIZE); | 11993 partition = new SdkCachePartition(sdkContext, _DEFAULT_SDK_CACHE_SIZE); |
| 11986 _sdkPartitions[sdk] = partition; | 11994 _sdkPartitions[sdk] = partition; |
| 11987 } | 11995 } |
| 11988 return partition; | 11996 return partition; |
| 11989 } | 11997 } |
| 11990 } | 11998 } |
| 11991 | 11999 |
| 11992 /** | 12000 /** |
| 11993 * Container with global [AnalysisContext] performance statistics. | 12001 * Container with global [AnalysisContext] performance statistics. |
| 11994 */ | 12002 */ |
| 11995 class PerformanceStatistics { | 12003 class PerformanceStatistics { |
| (...skipping 2554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14550 _index++; | 14558 _index++; |
| 14551 if (_index >= _manager._workQueues[_queueIndex].length) { | 14559 if (_index >= _manager._workQueues[_queueIndex].length) { |
| 14552 _index = 0; | 14560 _index = 0; |
| 14553 _queueIndex++; | 14561 _queueIndex++; |
| 14554 while (_queueIndex < _manager._workQueues.length && _manager._workQueues[_
queueIndex].isEmpty) { | 14562 while (_queueIndex < _manager._workQueues.length && _manager._workQueues[_
queueIndex].isEmpty) { |
| 14555 _queueIndex++; | 14563 _queueIndex++; |
| 14556 } | 14564 } |
| 14557 } | 14565 } |
| 14558 } | 14566 } |
| 14559 } | 14567 } |
| OLD | NEW |