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 library engine.incremental_resolver; | 5 library engine.incremental_resolver; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 import 'dart:math' as math; | 8 import 'dart:math' as math; |
9 | 9 |
10 import 'package:analyzer/src/context/cache.dart' | 10 import 'package:analyzer/src/context/cache.dart' |
(...skipping 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1037 } | 1037 } |
1038 // resolve | 1038 // resolve |
1039 _resolveReferences(rootNode); | 1039 _resolveReferences(rootNode); |
1040 _computeConstants(rootNode); | 1040 _computeConstants(rootNode); |
1041 _resolveErrors = errorListener.getErrorsForSource(_source); | 1041 _resolveErrors = errorListener.getErrorsForSource(_source); |
1042 // verify | 1042 // verify |
1043 _verify(rootNode); | 1043 _verify(rootNode); |
1044 _context.invalidateLibraryHints(_librarySource); | 1044 _context.invalidateLibraryHints(_librarySource); |
1045 // update entry errors | 1045 // update entry errors |
1046 _updateEntry(); | 1046 _updateEntry(); |
1047 // notify unit | |
1048 _definingUnit.afterIncrementalResolution(); | |
1049 // OK | 1047 // OK |
1050 return true; | 1048 return true; |
1051 } finally { | 1049 } finally { |
1052 logger.exit(); | 1050 logger.exit(); |
1053 } | 1051 } |
1054 } | 1052 } |
1055 | 1053 |
1056 void _buildElements(AstNode node) { | 1054 void _buildElements(AstNode node) { |
1057 LoggingTimer timer = logger.startTimer(); | 1055 LoggingTimer timer = logger.startTimer(); |
1058 try { | 1056 try { |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1272 timer.stop('invalidate cache with delta'); | 1270 timer.stop('invalidate cache with delta'); |
1273 } | 1271 } |
1274 } | 1272 } |
1275 } | 1273 } |
1276 | 1274 |
1277 void _updateElementNameOffsets() { | 1275 void _updateElementNameOffsets() { |
1278 LoggingTimer timer = logger.startTimer(); | 1276 LoggingTimer timer = logger.startTimer(); |
1279 try { | 1277 try { |
1280 _definingUnit | 1278 _definingUnit |
1281 .accept(new _ElementNameOffsetUpdater(_updateOffset, _updateDelta)); | 1279 .accept(new _ElementNameOffsetUpdater(_updateOffset, _updateDelta)); |
| 1280 _definingUnit.afterIncrementalResolution(); |
1282 } finally { | 1281 } finally { |
1283 timer.stop('update element offsets'); | 1282 timer.stop('update element offsets'); |
1284 } | 1283 } |
1285 } | 1284 } |
1286 | 1285 |
1287 void _updateEntry() { | 1286 void _updateEntry() { |
1288 if (oldEntry != null) { | 1287 if (oldEntry != null) { |
1289 _updateEntry_OLD(); | 1288 _updateEntry_OLD(); |
1290 } else { | 1289 } else { |
1291 _updateEntry_NEW(); | 1290 _updateEntry_NEW(); |
(...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2126 @override | 2125 @override |
2127 String toString() => name; | 2126 String toString() => name; |
2128 } | 2127 } |
2129 | 2128 |
2130 class _TokenPair { | 2129 class _TokenPair { |
2131 final _TokenDifferenceKind kind; | 2130 final _TokenDifferenceKind kind; |
2132 final Token oldToken; | 2131 final Token oldToken; |
2133 final Token newToken; | 2132 final Token newToken; |
2134 _TokenPair(this.kind, this.oldToken, this.newToken); | 2133 _TokenPair(this.kind, this.oldToken, this.newToken); |
2135 } | 2134 } |
OLD | NEW |