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

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: Unify native behavior processing 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
« no previous file with comments | « pkg/compiler/lib/src/resolution/registry.dart ('k') | pkg/compiler/lib/src/ssa/nodes.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..4ac588115e5d3e8801739e662d7d845c5a599215 100644
--- a/pkg/compiler/lib/src/ssa/codegen.dart
+++ b/pkg/compiler/lib/src/ssa/codegen.dart
@@ -154,6 +154,9 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
Compiler get compiler => backend.compiler;
NativeEmitter get nativeEmitter => backend.emitter.nativeEmitter;
CodegenRegistry get registry => work.registry;
+ native.NativeEnqueuer get nativeEnqueuer {
+ return compiler.enqueuer.codegen.nativeEnqueuer;
+ }
bool isGenerateAtUseSite(HInstruction instruction) {
return generateAtUseSite.contains(instruction);
@@ -1598,8 +1601,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.
@@ -1832,11 +1845,7 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
void registerForeignTypes(HForeign node) {
native.NativeBehavior nativeBehavior = node.nativeBehavior;
if (nativeBehavior == null) return;
- nativeBehavior.typesReturned.forEach((type) {
- if (type is InterfaceType) {
- registry.registerInstantiatedType(type);
- }
- });
+ nativeEnqueuer.registerNativeBehavior(nativeBehavior, node);
}
visitForeignCode(HForeignCode node) {
« no previous file with comments | « pkg/compiler/lib/src/resolution/registry.dart ('k') | pkg/compiler/lib/src/ssa/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698