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

Unified Diff: pkg/compiler/lib/src/js_emitter/old_emitter/type_test_emitter.dart

Issue 795633003: dart2js: Simplify type test emitter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_emitter/old_emitter/type_test_emitter.dart
diff --git a/pkg/compiler/lib/src/js_emitter/old_emitter/type_test_emitter.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/type_test_emitter.dart
index aba512bd66dec10ea23f8da7eb0beac753ecdc3d..c926461bd958328d091dc79253510b5d1bb266ce 100644
--- a/pkg/compiler/lib/src/js_emitter/old_emitter/type_test_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/old_emitter/type_test_emitter.dart
@@ -111,21 +111,19 @@ class TypeTestEmitter extends CodeEmitterHelper {
}
for (DartType supertype in cls.allSupertypes) {
ClassElement superclass = supertype.element;
- if (classesUsingTypeVariableTests.contains(superclass)) {
+ if (emitted.contains(superclass)) continue;
+
+ if (classesUsingTypeVariableTests.contains(superclass) ||
+ checkedClasses.contains(superclass)) {
+ // Generate substitution. If no substitution is necessary, emit
+ // `null` to overwrite a (possibly) existing substitution from the
+ // super classes.
emitSubstitution(superclass, emitNull: true);
- emitted.add(superclass);
- }
- for (ClassElement check in checkedClasses) {
- if (supertype.element == check && !emitted.contains(check)) {
- // Generate substitution. If no substitution is necessary, emit
- // [:null:] to overwrite a (possibly) existing substitution from the
- // super classes.
- emitSubstitution(check, emitNull: true);
- emitted.add(check);
- }
}
}
+
void emitNothing(_, {emitNull}) {};
+
emitSubstitution = emitNothing;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698