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

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
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>();
karlklose 2012/11/23 13:07:24 How about the name 'processedClasses'?
sra1 2012/11/24 00:05:50 We already have three sets of classes to do with t
+
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);
karlklose 2012/11/23 13:07:24 Why does this terminate?
sra1 2012/11/24 00:05:50 The check on line 326 is a standard graph algorith
karlklose 2012/11/26 11:24:56 Ah, I did not see l. 327.
+
for (DartType type in cls.allSupertypes) {
List<Element> subtypes = emitter.subtypes.putIfAbsent(
type.element,

Powered by Google App Engine
This is Rietveld 408576698