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

Unified Diff: pkg/compiler/lib/src/ssa/codegen.dart

Issue 1352533002: Enqueue superclasses instead of supertypes. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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/compiler/lib/src/ssa/codegen.dart
diff --git a/pkg/compiler/lib/src/ssa/codegen.dart b/pkg/compiler/lib/src/ssa/codegen.dart
index 3e25aa987269621d3f4e8b1336dcfc27303214e4..3fd0bff250aa784ca53599c0e70954cfa0fe6b28 100644
--- a/pkg/compiler/lib/src/ssa/codegen.dart
+++ b/pkg/compiler/lib/src/ssa/codegen.dart
@@ -1598,8 +1598,18 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
// type because our optimizations might end up in a state where the
// invoke dynamic knows more than the receiver.
ClassElement enclosing = node.element.enclosingClass;
- return
- new TypeMask.nonNullExact(enclosing.declaration, compiler.world);
+ if (compiler.world.isInstantiated(enclosing)) {
+ return new TypeMask.nonNullExact(
+ enclosing.declaration, compiler.world);
+ } else {
+ // The element is mixed in so a non-null subtype mask is the most
+ // precise we have.
+ assert(invariant(node, compiler.world.isUsedAsMixin(enclosing),
+ message: "Element ${node.element} from $enclosing expected "
+ "to be mixed in."));
+ return new TypeMask.nonNullSubtype(
+ enclosing.declaration, compiler.world);
+ }
}
// If [JSInvocationMirror._invokeOn] is enabled, and this call
// might hit a `noSuchMethod`, we register an untyped selector.

Powered by Google App Engine
This is Rietveld 408576698