Chromium Code Reviews| 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 1168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1179 if (source.isInSystemLibrary) { | 1179 if (source.isInSystemLibrary) { |
| 1180 return _options.generateSdkErrors; | 1180 return _options.generateSdkErrors; |
| 1181 } else if (!entry.explicitlyAdded) { | 1181 } else if (!entry.explicitlyAdded) { |
| 1182 return _options.generateImplicitErrors; | 1182 return _options.generateImplicitErrors; |
| 1183 } else { | 1183 } else { |
| 1184 return true; | 1184 return true; |
| 1185 } | 1185 } |
| 1186 } | 1186 } |
| 1187 | 1187 |
| 1188 @override | 1188 @override |
| 1189 void test_flushResolvedUnit(Source source) { | |
|
Brian Wilkerson
2015/06/24 16:56:58
The non-task-model version of this method flushes
Paul Berry
2015/06/24 20:08:31
Ok, as per our discussion, I've renamed this to te
| |
| 1190 CacheEntry entry = getCacheEntry(source); | |
| 1191 entry.setState(RESOLVED_UNIT1, CacheState.FLUSHED); | |
| 1192 entry.setState(RESOLVED_UNIT2, CacheState.FLUSHED); | |
| 1193 entry.setState(RESOLVED_UNIT4, CacheState.FLUSHED); | |
| 1194 entry.setState(RESOLVED_UNIT5, CacheState.FLUSHED); | |
| 1195 entry.setState(RESOLVED_UNIT6, CacheState.FLUSHED); | |
| 1196 entry.setState(RESOLVED_UNIT, CacheState.FLUSHED); | |
| 1197 } | |
| 1198 | |
| 1199 @override | |
| 1189 bool validateCacheConsistency() { | 1200 bool validateCacheConsistency() { |
| 1190 int consistencyCheckStart = JavaSystem.nanoTime(); | 1201 int consistencyCheckStart = JavaSystem.nanoTime(); |
| 1191 HashSet<Source> changedSources = new HashSet<Source>(); | 1202 HashSet<Source> changedSources = new HashSet<Source>(); |
| 1192 HashSet<Source> missingSources = new HashSet<Source>(); | 1203 HashSet<Source> missingSources = new HashSet<Source>(); |
| 1193 for (Source source in _cache.sources) { | 1204 for (Source source in _cache.sources) { |
| 1194 CacheEntry entry = _cache.get(source); | 1205 CacheEntry entry = _cache.get(source); |
| 1195 int sourceTime = getModificationStamp(source); | 1206 int sourceTime = getModificationStamp(source); |
| 1196 if (sourceTime != entry.modificationTime) { | 1207 if (sourceTime != entry.modificationTime) { |
| 1197 changedSources.add(source); | 1208 changedSources.add(source); |
| 1198 } | 1209 } |
| (...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2003 new PendingFuture<T>(_context, target, computeValue); | 2014 new PendingFuture<T>(_context, target, computeValue); |
| 2004 if (!pendingFuture.evaluate(entry)) { | 2015 if (!pendingFuture.evaluate(entry)) { |
| 2005 _context._pendingFutureTargets | 2016 _context._pendingFutureTargets |
| 2006 .putIfAbsent(target, () => <PendingFuture>[]) | 2017 .putIfAbsent(target, () => <PendingFuture>[]) |
| 2007 .add(pendingFuture); | 2018 .add(pendingFuture); |
| 2008 scheduleComputation(); | 2019 scheduleComputation(); |
| 2009 } | 2020 } |
| 2010 return pendingFuture.future; | 2021 return pendingFuture.future; |
| 2011 } | 2022 } |
| 2012 } | 2023 } |
| OLD | NEW |