|
2 | 2 | // for details. All rights reserved. Use of this source code is governed by a |
3 | 3 | // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
|
5 | | -// @dart = 2.10 |
6 | | - |
7 | 5 | library dart2js.abstract_value_domain; |
8 | 6 |
|
9 | 7 | import '../constants/values.dart' show ConstantValue, PrimitiveConstantValue; |
10 | 8 | import '../elements/entities.dart'; |
11 | 9 | import '../elements/names.dart'; |
12 | 10 | import '../elements/types.dart' show DartType; |
13 | | -import '../ir/static_type.dart'; |
14 | | -import '../serialization/serialization.dart'; |
| 11 | +import '../ir/class_relation.dart'; |
| 12 | +import '../serialization/serialization_interfaces.dart'; |
15 | 13 | import '../universe/selector.dart'; |
16 | | -import '../universe/world_builder.dart'; |
17 | | -import '../world.dart'; |
18 | 14 |
|
19 | 15 | /// Enum-like values used for reporting known and unknown truth values. |
20 | 16 | class AbstractBool { |
21 | | - final bool _value; |
| 17 | + final bool? _value; |
22 | 18 |
|
23 | 19 | const AbstractBool._(this._value); |
24 | 20 |
|
@@ -75,17 +71,7 @@ class AbstractBool { |
75 | 71 |
|
76 | 72 | @override |
77 | 73 | String toString() => |
78 | | - 'AbstractBool.${_value == null ? 'Maybe' : (_value ? 'True' : 'False')}'; |
79 | | -} |
80 | | - |
81 | | -/// Strategy for the abstraction of runtime values used by the global type |
82 | | -/// inference. |
83 | | -abstract class AbstractValueStrategy { |
84 | | - /// Creates the abstract value domain for [closedWorld]. |
85 | | - AbstractValueDomain createDomain(JClosedWorld closedWorld); |
86 | | - |
87 | | - /// Creates the [SelectorConstraintsStrategy] used by the backend enqueuer. |
88 | | - SelectorConstraintsStrategy createSelectorStrategy(); |
| 74 | + 'AbstractBool.${_value == null ? 'Maybe' : (_value! ? 'True' : 'False')}'; |
89 | 75 | } |
90 | 76 |
|
91 | 77 | /// A value in an abstraction of runtime values. |
@@ -634,8 +620,12 @@ abstract class AbstractValueDomain { |
634 | 620 | String getCompactText(AbstractValue value); |
635 | 621 |
|
636 | 622 | /// Deserializes an [AbstractValue] for this domain from [source]. |
637 | | - AbstractValue readAbstractValueFromDataSource(DataSourceReader source); |
| 623 | + // TODO(48820): Remove covariant when DataSourceReader is migrated. |
| 624 | + AbstractValue readAbstractValueFromDataSource( |
| 625 | + covariant DataSourceReader source); |
638 | 626 |
|
639 | 627 | /// Serializes this [value] for this domain to [sink]. |
640 | | - void writeAbstractValueToDataSink(DataSinkWriter sink, AbstractValue value); |
| 628 | + // TODO(48820): Remove covariant when DataSinkWriter is migrated. |
| 629 | + void writeAbstractValueToDataSink( |
| 630 | + covariant DataSinkWriter sink, AbstractValue value); |
641 | 631 | } |
0 commit comments