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

Unified Diff: sdk/lib/_internal/compiler/implementation/native_handler.dart

Issue 11421049: Fix missing classes in native emitters superclass info. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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 | « sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/native_handler.dart
diff --git a/sdk/lib/_internal/compiler/implementation/native_handler.dart b/sdk/lib/_internal/compiler/implementation/native_handler.dart
index 0c1579b538351b24c9572dfdf7ea94f6632210af..8de208fbf826c224fa23617670c0dccaa7569c2f 100644
--- a/sdk/lib/_internal/compiler/implementation/native_handler.dart
+++ b/sdk/lib/_internal/compiler/implementation/native_handler.dart
@@ -296,6 +296,8 @@ class NativeCodegenEnqueuer extends NativeEnqueuerBase {
final CodeEmitterTask emitter;
+ final Set<ClassElement> doneAddSubtypes = new Set<ClassElement>();
+
NativeCodegenEnqueuer(Enqueuer world, Compiler compiler, this.emitter)
: super(world, compiler, compiler.enableNativeLiveTypeAnalysis);
@@ -320,6 +322,14 @@ class NativeCodegenEnqueuer extends NativeEnqueuerBase {
}
void addSubtypes(ClassElement cls, NativeEmitter emitter) {
+ if (!cls.isNative()) return;
+ if (doneAddSubtypes.contains(cls)) return;
+ doneAddSubtypes.add(cls);
+
+ // Walk the superclass chain since classes on the superclass chain might not
+ // be instantiated (abstract or simply unused).
+ addSubtypes(cls.superclass, emitter);
+
for (DartType type in cls.allSupertypes) {
List<Element> subtypes = emitter.subtypes.putIfAbsent(
type.element,
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698