OLD | NEW |
---|---|
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 import 'dart:async'; | 5 import 'dart:async'; |
6 import 'dart:collection'; | 6 import 'dart:collection'; |
7 import 'dart:typed_data'; | 7 import 'dart:typed_data'; |
8 | 8 |
9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
10 import 'package:analyzer/error/error.dart'; | 10 import 'package:analyzer/error/error.dart'; |
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
624 return new _LibraryContext(libraryFile, libraryNode, store); | 624 return new _LibraryContext(libraryFile, libraryNode, store); |
625 }); | 625 }); |
626 } | 626 } |
627 | 627 |
628 /** | 628 /** |
629 * Fill [_salt] with data. | 629 * Fill [_salt] with data. |
630 */ | 630 */ |
631 void _fillSalt() { | 631 void _fillSalt() { |
632 int analysisOptionsSalt = 0; | 632 int analysisOptionsSalt = 0; |
633 analysisOptionsSalt |= _analysisOptions.strongMode ? (1 << 0) : 0; | 633 analysisOptionsSalt |= _analysisOptions.strongMode ? (1 << 0) : 0; |
634 analysisOptionsSalt |= _analysisOptions.enableGenericMethods ? (1 << 1) : 0; | |
Brian Wilkerson
2016/11/08 21:15:08
Have you looked at AnalysisOptionsImpl.encodeCross
scheglov
2016/11/09 01:21:38
Done.
| |
634 _salt[0] = DATA_VERSION; | 635 _salt[0] = DATA_VERSION; |
635 _salt[1] = analysisOptionsSalt; | 636 _salt[1] = analysisOptionsSalt; |
636 } | 637 } |
637 | 638 |
638 /** | 639 /** |
639 * If we know the result [key] for the [file], try to load the analysis | 640 * If we know the result [key] for the [file], try to load the analysis |
640 * result from the cache. Return `null` if not found. | 641 * result from the cache. Return `null` if not found. |
641 */ | 642 */ |
642 AnalysisResult _getCachedAnalysisResult(FileState file, String key) { | 643 AnalysisResult _getCachedAnalysisResult(FileState file, String key) { |
643 List<int> bytes = _byteStore.get(key); | 644 List<int> bytes = _byteStore.get(key); |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1022 /** | 1023 /** |
1023 * Complete the [signal] future if it is not completed yet. It is safe to | 1024 * Complete the [signal] future if it is not completed yet. It is safe to |
1024 * call this method multiple times, but the [signal] will complete only once. | 1025 * call this method multiple times, but the [signal] will complete only once. |
1025 */ | 1026 */ |
1026 void notify() { | 1027 void notify() { |
1027 if (!_completer.isCompleted) { | 1028 if (!_completer.isCompleted) { |
1028 _completer.complete(null); | 1029 _completer.complete(null); |
1029 } | 1030 } |
1030 } | 1031 } |
1031 } | 1032 } |
OLD | NEW |