| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 library analyzer.src.context.context; | 5 library analyzer.src.context.context; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 | 9 |
| 10 import 'package:analyzer/instrumentation/instrumentation.dart'; | 10 import 'package:analyzer/instrumentation/instrumentation.dart'; |
| (...skipping 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1131 entry.setState(RESOLVE_TYPE_NAMES_ERRORS, CacheState.FLUSHED); | 1131 entry.setState(RESOLVE_TYPE_NAMES_ERRORS, CacheState.FLUSHED); |
| 1132 setValue(SCAN_ERRORS, AnalysisError.NO_ERRORS); | 1132 setValue(SCAN_ERRORS, AnalysisError.NO_ERRORS); |
| 1133 setValue(SOURCE_KIND, SourceKind.LIBRARY); | 1133 setValue(SOURCE_KIND, SourceKind.LIBRARY); |
| 1134 entry.setState(TOKEN_STREAM, CacheState.FLUSHED); | 1134 entry.setState(TOKEN_STREAM, CacheState.FLUSHED); |
| 1135 setValue(UNITS, <Source>[librarySource]); | 1135 setValue(UNITS, <Source>[librarySource]); |
| 1136 | 1136 |
| 1137 LibrarySpecificUnit unit = | 1137 LibrarySpecificUnit unit = |
| 1138 new LibrarySpecificUnit(librarySource, librarySource); | 1138 new LibrarySpecificUnit(librarySource, librarySource); |
| 1139 entry = getCacheEntry(unit); | 1139 entry = getCacheEntry(unit); |
| 1140 setValue(HINTS, AnalysisError.NO_ERRORS); | 1140 setValue(HINTS, AnalysisError.NO_ERRORS); |
| 1141 // dartEntry.setValue(LINTS, AnalysisError.NO_ERRORS); | 1141 setValue(LINTS, AnalysisError.NO_ERRORS); |
| 1142 setValue(INFER_STATIC_VARIABLE_TYPES_ERRORS, AnalysisError.NO_ERRORS); | 1142 setValue(INFER_STATIC_VARIABLE_TYPES_ERRORS, AnalysisError.NO_ERRORS); |
| 1143 setValue(LIBRARY_UNIT_ERRORS, AnalysisError.NO_ERRORS); | 1143 setValue(LIBRARY_UNIT_ERRORS, AnalysisError.NO_ERRORS); |
| 1144 setValue(PARTIALLY_RESOLVE_REFERENCES_ERRORS, AnalysisError.NO_ERRORS); | 1144 setValue(PARTIALLY_RESOLVE_REFERENCES_ERRORS, AnalysisError.NO_ERRORS); |
| 1145 setValue(RESOLVE_FUNCTION_BODIES_ERRORS, AnalysisError.NO_ERRORS); | 1145 setValue(RESOLVE_FUNCTION_BODIES_ERRORS, AnalysisError.NO_ERRORS); |
| 1146 setValue(RESOLVE_TYPE_NAMES_ERRORS, AnalysisError.NO_ERRORS); | 1146 setValue(RESOLVE_TYPE_NAMES_ERRORS, AnalysisError.NO_ERRORS); |
| 1147 entry.setState(RESOLVED_UNIT, CacheState.FLUSHED); | 1147 entry.setState(RESOLVED_UNIT, CacheState.FLUSHED); |
| 1148 entry.setState(RESOLVED_UNIT1, CacheState.FLUSHED); | 1148 entry.setState(RESOLVED_UNIT1, CacheState.FLUSHED); |
| 1149 entry.setState(RESOLVED_UNIT2, CacheState.FLUSHED); | 1149 entry.setState(RESOLVED_UNIT2, CacheState.FLUSHED); |
| 1150 entry.setState(RESOLVED_UNIT3, CacheState.FLUSHED); | 1150 entry.setState(RESOLVED_UNIT3, CacheState.FLUSHED); |
| 1151 entry.setState(RESOLVED_UNIT4, CacheState.FLUSHED); | 1151 entry.setState(RESOLVED_UNIT4, CacheState.FLUSHED); |
| (...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1628 if (hintsEnabled) { | 1628 if (hintsEnabled) { |
| 1629 state = unitEntry.getState(HINTS); | 1629 state = unitEntry.getState(HINTS); |
| 1630 if (state == CacheState.INVALID || | 1630 if (state == CacheState.INVALID || |
| 1631 (isPriority && state == CacheState.FLUSHED)) { | 1631 (isPriority && state == CacheState.FLUSHED)) { |
| 1632 sources.add(source); | 1632 sources.add(source); |
| 1633 return; | 1633 return; |
| 1634 } else if (state == CacheState.ERROR) { | 1634 } else if (state == CacheState.ERROR) { |
| 1635 return; | 1635 return; |
| 1636 } | 1636 } |
| 1637 } | 1637 } |
| 1638 // if (lintsEnabled) { | 1638 if (lintsEnabled) { |
| 1639 // state = unitEntry.getState(LINTS); | 1639 state = unitEntry.getState(LINTS); |
| 1640 // if (state == CacheState.INVALID || | 1640 if (state == CacheState.INVALID || |
| 1641 // (isPriority && state == CacheState.FLUSHED)) { | 1641 (isPriority && state == CacheState.FLUSHED)) { |
| 1642 // sources.add(source); | 1642 sources.add(source); |
| 1643 // return; | 1643 return; |
| 1644 // } else if (state == CacheState.ERROR) { | 1644 } else if (state == CacheState.ERROR) { |
| 1645 // return; | 1645 return; |
| 1646 // } | 1646 } |
| 1647 // } | 1647 } |
| 1648 } | 1648 } |
| 1649 } | 1649 } |
| 1650 // } else if (kind == SourceKind.HTML) { | 1650 // } else if (kind == SourceKind.HTML) { |
| 1651 // CacheState parsedUnitState = entry.getState(HtmlEntry.PARSED_UNIT); | 1651 // CacheState parsedUnitState = entry.getState(HtmlEntry.PARSED_UNIT); |
| 1652 // if (parsedUnitState == CacheState.INVALID || | 1652 // if (parsedUnitState == CacheState.INVALID || |
| 1653 // (isPriority && parsedUnitState == CacheState.FLUSHED)) { | 1653 // (isPriority && parsedUnitState == CacheState.FLUSHED)) { |
| 1654 // sources.add(source); | 1654 // sources.add(source); |
| 1655 // return; | 1655 // return; |
| 1656 // } | 1656 // } |
| 1657 // CacheState resolvedUnitState = | 1657 // CacheState resolvedUnitState = |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2088 new PendingFuture<T>(_context, target, computeValue); | 2088 new PendingFuture<T>(_context, target, computeValue); |
| 2089 if (!pendingFuture.evaluate(entry)) { | 2089 if (!pendingFuture.evaluate(entry)) { |
| 2090 _context._pendingFutureTargets | 2090 _context._pendingFutureTargets |
| 2091 .putIfAbsent(target, () => <PendingFuture>[]) | 2091 .putIfAbsent(target, () => <PendingFuture>[]) |
| 2092 .add(pendingFuture); | 2092 .add(pendingFuture); |
| 2093 scheduleComputation(); | 2093 scheduleComputation(); |
| 2094 } | 2094 } |
| 2095 return pendingFuture.future; | 2095 return pendingFuture.future; |
| 2096 } | 2096 } |
| 2097 } | 2097 } |
| OLD | NEW |