Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(441)

Unified Diff: pkg/kernel/lib/type_propagation/type_propagation.dart

Issue 2665723002: Implement canonical name scheme in kernel. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..1073edefb1a3a4b4672fb1c70c2c6a1753ba65d9 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 CanonicalName baseClassName;
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.byName(
+ getCanonicalNameOfClass(baseClass), baseClassKind, valueBits);
+
+ InferredValue.byName(this.baseClassName, this.baseClassKind, this.valueBits) {
assert(baseClass != null || baseClassKind == BaseClassKind.None);
assert(baseClass == null || baseClassKind != BaseClassKind.None);
}
+ Class get baseClass => baseClassName?.asClass;
+
InferredValue withBitmask(int newBitmask) {
if (newBitmask == valueBits) return this;
return new InferredValue(this.baseClass, this.baseClassKind, newBitmask);

Powered by Google App Engine
This is Rietveld 408576698