| Index: pkg/analyzer/lib/src/generated/engine.dart
|
| diff --git a/pkg/analyzer/lib/src/generated/engine.dart b/pkg/analyzer/lib/src/generated/engine.dart
|
| index 90463c0afffa7366fae318200710886aa284cc1d..d92e8db496b3feb624c6b0825f0059a193a2b05f 100644
|
| --- a/pkg/analyzer/lib/src/generated/engine.dart
|
| +++ b/pkg/analyzer/lib/src/generated/engine.dart
|
| @@ -6,6 +6,7 @@ library analyzer.src.generated.engine;
|
|
|
| import 'dart:async';
|
| import 'dart:collection';
|
| +import 'dart:typed_data';
|
|
|
| import 'package:analyzer/dart/ast/ast.dart';
|
| import 'package:analyzer/dart/ast/visitor.dart';
|
| @@ -26,6 +27,7 @@ import 'package:analyzer/src/generated/source.dart';
|
| import 'package:analyzer/src/generated/utilities_general.dart';
|
| import 'package:analyzer/src/plugin/engine_plugin.dart';
|
| import 'package:analyzer/src/services/lint.dart';
|
| +import 'package:analyzer/src/summary/api_signature.dart';
|
| import 'package:analyzer/src/task/dart.dart';
|
| import 'package:analyzer/src/task/general.dart';
|
| import 'package:analyzer/src/task/html.dart';
|
| @@ -1131,7 +1133,7 @@ abstract class AnalysisOptions {
|
| /**
|
| * The length of the list returned by [encodeCrossContextOptions].
|
| */
|
| - static const int crossContextOptionsLength = 1;
|
| + static const int signatureLength = 4;
|
|
|
| /**
|
| * Function that returns `true` if analysis is to parse and analyze function
|
| @@ -1307,6 +1309,13 @@ abstract class AnalysisOptions {
|
| bool get preserveComments;
|
|
|
| /**
|
| + * Return the opaque signature of the options.
|
| + *
|
| + * The length of the list is guaranteed to equal [signatureLength].
|
| + */
|
| + Uint32List get signature;
|
| +
|
| + /**
|
| * Return `true` if strong mode analysis should be used.
|
| */
|
| bool get strongMode;
|
| @@ -1320,15 +1329,6 @@ abstract class AnalysisOptions {
|
| bool get trackCacheDependencies;
|
|
|
| /**
|
| - * Return a list of integers encoding of the values of the options that need
|
| - * to be the same across all of the contexts associated with partitions that
|
| - * are to be shared by a single analysis context.
|
| - *
|
| - * The length of the list is guaranteed to equal [crossContextOptionsLength].
|
| - */
|
| - List<int> encodeCrossContextOptions();
|
| -
|
| - /**
|
| * Reset the state of this set of analysis options to its original state.
|
| */
|
| void resetToDefaults();
|
| @@ -1340,12 +1340,11 @@ abstract class AnalysisOptions {
|
| void setCrossContextOptionsFrom(AnalysisOptions options);
|
|
|
| /**
|
| - * Determine whether two lists returned by [encodeCrossContextOptions] are
|
| - * equal.
|
| + * Determine whether two signatures returned by [signature] are equal.
|
| */
|
| - static bool crossContextOptionsEqual(List<int> a, List<int> b) {
|
| - assert(a.length == crossContextOptionsLength);
|
| - assert(b.length == crossContextOptionsLength);
|
| + static bool signaturesEqual(Uint32List a, Uint32List b) {
|
| + assert(a.length == signatureLength);
|
| + assert(b.length == signatureLength);
|
| if (a.length != b.length) {
|
| return false;
|
| }
|
| @@ -1372,12 +1371,6 @@ class AnalysisOptionsImpl implements AnalysisOptions {
|
| @deprecated
|
| static const int DEFAULT_CACHE_SIZE = 64;
|
|
|
| - static const int ENABLE_LAZY_ASSIGNMENT_OPERATORS = 0x01;
|
| - static const int ENABLE_STRICT_CALL_CHECKS_FLAG = 0x02;
|
| - static const int ENABLE_STRONG_MODE_FLAG = 0x04;
|
| - static const int ENABLE_STRONG_MODE_HINTS_FLAG = 0x08;
|
| - static const int ENABLE_SUPER_MIXINS_FLAG = 0x10;
|
| -
|
| /**
|
| * The default list of non-nullable type names.
|
| */
|
| @@ -1390,6 +1383,11 @@ class AnalysisOptionsImpl implements AnalysisOptions {
|
| AnalyzeFunctionBodiesPredicate _analyzeFunctionBodiesPredicate =
|
| _analyzeAllFunctionBodies;
|
|
|
| + /**
|
| + * The cached [signature].
|
| + */
|
| + Uint32List _signature;
|
| +
|
| @override
|
| @deprecated
|
| int cacheSize = 64;
|
| @@ -1647,14 +1645,28 @@ class AnalysisOptionsImpl implements AnalysisOptions {
|
| }
|
|
|
| @override
|
| - List<int> encodeCrossContextOptions() {
|
| - int flags =
|
| - (enableLazyAssignmentOperators ? ENABLE_LAZY_ASSIGNMENT_OPERATORS : 0) |
|
| - (enableStrictCallChecks ? ENABLE_STRICT_CALL_CHECKS_FLAG : 0) |
|
| - (enableSuperMixins ? ENABLE_SUPER_MIXINS_FLAG : 0) |
|
| - (strongMode ? ENABLE_STRONG_MODE_FLAG : 0) |
|
| - (strongModeHints ? ENABLE_STRONG_MODE_HINTS_FLAG : 0);
|
| - return <int>[flags];
|
| + Uint32List get signature {
|
| + if (_signature == null) {
|
| + ApiSignature buffer = new ApiSignature();
|
| +
|
| + // Append boolean flags.
|
| + buffer.addBool(enableLazyAssignmentOperators);
|
| + buffer.addBool(enableStrictCallChecks);
|
| + buffer.addBool(enableSuperMixins);
|
| + buffer.addBool(strongMode);
|
| + buffer.addBool(strongModeHints);
|
| +
|
| + // Append lints.
|
| + buffer.addInt(lintRules.length);
|
| + for (Linter lintRule in lintRules) {
|
| + buffer.addString(lintRule.lintCode.uniqueName);
|
| + }
|
| +
|
| + // Hash and convert to Uint32List.
|
| + List<int> bytes = buffer.toByteList();
|
| + _signature = new Uint8List.fromList(bytes).buffer.asUint32List();
|
| + }
|
| + return _signature;
|
| }
|
|
|
| @override
|
| @@ -1700,40 +1712,6 @@ class AnalysisOptionsImpl implements AnalysisOptions {
|
| }
|
|
|
| /**
|
| - * Produce a human readable list of option names corresponding to the options
|
| - * encoded in the given [encoding], presumably from invoking the method
|
| - * [encodeCrossContextOptions].
|
| - */
|
| - static String decodeCrossContextOptions(List<int> encoding) {
|
| - List<String> parts = [];
|
| - int flags = encoding[0];
|
| - if (flags & ENABLE_LAZY_ASSIGNMENT_OPERATORS > 0) {
|
| - parts.add('lazyAssignmentOperators');
|
| - }
|
| - if (flags & ENABLE_STRICT_CALL_CHECKS_FLAG > 0) {
|
| - parts.add('strictCallChecks');
|
| - }
|
| - if (flags & ENABLE_SUPER_MIXINS_FLAG > 0) {
|
| - parts.add('superMixins');
|
| - }
|
| - if (flags & ENABLE_STRONG_MODE_FLAG > 0) {
|
| - parts.add('strongMode');
|
| - }
|
| - if (flags & ENABLE_STRONG_MODE_HINTS_FLAG > 0) {
|
| - parts.add('strongModeHints');
|
| - }
|
| - int patchPlatform = encoding[1];
|
| - if (patchPlatform != 0) {
|
| - parts.add('patchPlatform=$patchPlatform');
|
| - }
|
| - if (parts.isEmpty) {
|
| - return 'none';
|
| - } else {
|
| - return parts.join(', ');
|
| - }
|
| - }
|
| -
|
| - /**
|
| * Predicate used for [analyzeFunctionBodiesPredicate] when
|
| * [analyzeFunctionBodies] is set to `true`.
|
| */
|
|
|