Index: pkg/kernel/lib/type_propagation/type_propagation.dart |
diff --git a/pkg/kernel/lib/type_propagation/type_propagation.dart b/pkg/kernel/lib/type_propagation/type_propagation.dart |
index de5f329f25490cad8ec2bfaf2a04428dcb43d9bf..8808c681185fd31e58750578cab562a1d4744543 100644 |
--- a/pkg/kernel/lib/type_propagation/type_propagation.dart |
+++ b/pkg/kernel/lib/type_propagation/type_propagation.dart |
@@ -64,7 +64,7 @@ enum BaseClassKind { |
/// its base class and its bitmask. The InferredValue object represents the |
/// intersection of these two value sets. |
class InferredValue extends Node { |
- final Class baseClass; |
+ final Reference baseClassReference; |
final BaseClassKind baseClassKind; |
/// A bitmask of the flags defined in [ValueBit], refining the set of values. |
@@ -79,12 +79,18 @@ class InferredValue extends Node { |
/// class could be found. |
final int valueBits; |
- InferredValue(this.baseClass, this.baseClassKind, |
- [this.valueBits = ValueBit.all]) { |
+ InferredValue(Class baseClass, BaseClassKind baseClassKind, |
+ [int valueBits = ValueBit.all]) |
+ : this.byReference(baseClass?.reference, baseClassKind, valueBits); |
+ |
+ InferredValue.byReference( |
+ this.baseClassReference, this.baseClassKind, this.valueBits) { |
assert(baseClass != null || baseClassKind == BaseClassKind.None); |
assert(baseClass == null || baseClassKind != BaseClassKind.None); |
} |
+ Class get baseClass => baseClassReference?.asClass; |
+ |
InferredValue withBitmask(int newBitmask) { |
if (newBitmask == valueBits) return this; |
return new InferredValue(this.baseClass, this.baseClassKind, newBitmask); |