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

Unified Diff: lib/compiler/implementation/native_emitter.dart

Issue 10106019: Truley compute direct subtypes of native classes. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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 | « no previous file | lib/compiler/implementation/native_handler.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/native_emitter.dart
===================================================================
--- lib/compiler/implementation/native_emitter.dart (revision 6623)
+++ lib/compiler/implementation/native_emitter.dart (working copy)
@@ -14,9 +14,12 @@
// Native classes found in the application.
Set<ClassElement> nativeClasses;
- // Caches the direct native subtypes of a native class.
+ // Caches the native subtypes of a native class.
Map<ClassElement, List<ClassElement>> subtypes;
+ // Caches the direct native subtypes of a native class.
+ Map<ClassElement, List<ClassElement>> directSubtypes;
+
// Caches the native methods that are overridden by a native class.
// Note that the method that overrides does not have to be native:
// it's the overridden method that must make sure it will dispatch
@@ -27,6 +30,7 @@
: classesWithDynamicDispatch = new Set<ClassElement>(),
nativeClasses = new Set<ClassElement>(),
subtypes = new Map<ClassElement, List<ClassElement>>(),
+ directSubtypes = new Map<ClassElement, List<ClassElement>>(),
overriddenMethods = new Set<FunctionElement>(),
buffer = new StringBuffer();
@@ -132,9 +136,8 @@
}
List<ClassElement> getDirectSubclasses(ClassElement cls) {
- List<ClassElement> result = subtypes[cls];
- if (result === null) result = const<ClassElement>[];
- return result;
+ List<ClassElement> result = directSubtypes[cls];
+ return result === null ? const<ClassElement>[] : result;
}
void potentiallyConvertDartClosuresToJs(StringBuffer code,
« no previous file with comments | « no previous file | lib/compiler/implementation/native_handler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698