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

Unified Diff: pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart

Issue 2301733002: fast-startup: do not emit inherit calls for classes from different fragments (Closed)
Patch Set: Created 4 years, 4 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 | tests/compiler/dart2js_extra/deferred_inheritance_lib1.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart
diff --git a/pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart b/pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart
index 69e3deaa21a3b486efac3a8551506f72e54028b8..3e1127847a59d29fe78f0bd8f7f61786925ac1f9 100644
--- a/pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart
@@ -794,13 +794,20 @@ class FragmentEmitter {
List<js.Expression> inheritCalls = <js.Expression>[];
List<js.Expression> mixinCalls = <js.Expression>[];
+ Set<Class> classesInFragment = new Set<Class>();
+ for (Library library in fragment.libraries) {
+ classesInFragment.addAll(library.classes);
+ }
+
Set<Class> emittedClasses = new Set<Class>();
void emitInheritanceForClass(cls) {
if (cls == null || emittedClasses.contains(cls)) return;
Class superclass = cls.superclass;
- emitInheritanceForClass(superclass);
+ if (classesInFragment.contains(superclass)) {
+ emitInheritanceForClass(superclass);
+ }
js.Expression superclassReference = (superclass == null)
? new js.LiteralNull()
« no previous file with comments | « no previous file | tests/compiler/dart2js_extra/deferred_inheritance_lib1.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698