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

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

Issue 2665723002: Implement canonical name scheme in kernel. (Closed)
Patch Set: Address Kevin's comments Created 3 years, 10 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
« no previous file with comments | « pkg/kernel/lib/transformations/treeshaker.dart ('k') | pkg/kernel/lib/verifier.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « pkg/kernel/lib/transformations/treeshaker.dart ('k') | pkg/kernel/lib/verifier.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698