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

Side by Side Diff: pkg/compiler/lib/src/enqueue.dart

Issue 1413613010: Normalize type masks to use the least upper instantiated subclass/type. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library dart2js.enqueue; 5 library dart2js.enqueue;
6 6
7 import 'dart:collection' show 7 import 'dart:collection' show
8 Queue; 8 Queue;
9 9
10 import 'common.dart'; 10 import 'common.dart';
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 } 175 }
176 worldImpact.onCatchTypes.forEach(registerIsCheck); 176 worldImpact.onCatchTypes.forEach(registerIsCheck);
177 worldImpact.closures.forEach(registerClosure); 177 worldImpact.closures.forEach(registerClosure);
178 } 178 }
179 179
180 void registerInstantiatedType(InterfaceType type, 180 void registerInstantiatedType(InterfaceType type,
181 {bool mirrorUsage: false}) { 181 {bool mirrorUsage: false}) {
182 task.measure(() { 182 task.measure(() {
183 ClassElement cls = type.element; 183 ClassElement cls = type.element;
184 cls.ensureResolved(resolution); 184 cls.ensureResolved(resolution);
185 bool isNative = compiler.backend.isNative(cls);
185 universe.registerTypeInstantiation( 186 universe.registerTypeInstantiation(
186 type, 187 type,
187 isNative: compiler.backend.isNative(cls), 188 isNative: isNative,
188 byMirrors: mirrorUsage, 189 byMirrors: mirrorUsage,
189 onImplemented: (ClassElement cls) { 190 onImplemented: (ClassElement cls) {
190 compiler.backend.registerImplementedClass( 191 compiler.backend.registerImplementedClass(
191 cls, this, compiler.globalDependencies); 192 cls, this, compiler.globalDependencies);
192 }); 193 });
193 processInstantiatedClass(cls); 194 if (!cls.isAbstract || isNative || mirrorUsage) {
Johnni Winther 2015/11/03 13:20:02 Make a variable and use for universe.register...
Johnni Winther 2015/11/06 13:43:23 Done.
195 processInstantiatedClass(cls);
196 }
194 }); 197 });
195 } 198 }
196 199
197 bool checkNoEnqueuedInvokedInstanceMethods() { 200 bool checkNoEnqueuedInvokedInstanceMethods() {
198 return filter.checkNoEnqueuedInvokedInstanceMethods(this); 201 return filter.checkNoEnqueuedInvokedInstanceMethods(this);
199 } 202 }
200 203
201 void processInstantiatedClassMembers(ClassElement cls) { 204 void processInstantiatedClassMembers(ClassElement cls) {
202 strategy.processInstantiatedClass(this, cls); 205 strategy.processInstantiatedClass(this, cls);
203 } 206 }
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 if (isResolutionQueue && !superclass.isSynthesized) { 335 if (isResolutionQueue && !superclass.isSynthesized) {
333 compiler.resolver.checkClass(superclass); 336 compiler.resolver.checkClass(superclass);
334 } 337 }
335 // We only tell the backend once that [superclass] was instantiated, so 338 // We only tell the backend once that [superclass] was instantiated, so
336 // any additional dependencies must be treated as global 339 // any additional dependencies must be treated as global
337 // dependencies. 340 // dependencies.
338 compiler.backend.registerInstantiatedClass( 341 compiler.backend.registerInstantiatedClass(
339 superclass, this, compiler.globalDependencies); 342 superclass, this, compiler.globalDependencies);
340 } 343 }
341 344
342 while (cls != null) { 345 ClassElement superclass = cls;
343 processClass(cls); 346 while (superclass != null) {
344 cls = cls.superclass; 347 processClass(superclass);
348 superclass = superclass.superclass;
345 } 349 }
346 }); 350 });
347 } 351 }
348 352
349 void registerDynamicUse(DynamicUse dynamicUse) { 353 void registerDynamicUse(DynamicUse dynamicUse) {
350 task.measure(() { 354 task.measure(() {
351 if (universe.registerDynamicUse(dynamicUse)) { 355 if (universe.registerDynamicUse(dynamicUse)) {
352 handleUnseenSelector(dynamicUse); 356 handleUnseenSelector(dynamicUse);
353 } 357 }
354 }); 358 });
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
1012 @override 1016 @override
1013 void processStaticUse(Enqueuer enqueuer, StaticUse staticUse) { 1017 void processStaticUse(Enqueuer enqueuer, StaticUse staticUse) {
1014 enqueuer.registerStaticUseInternal(staticUse); 1018 enqueuer.registerStaticUseInternal(staticUse);
1015 } 1019 }
1016 1020
1017 @override 1021 @override
1018 void processDynamicUse(Enqueuer enqueuer, DynamicUse dynamicUse) { 1022 void processDynamicUse(Enqueuer enqueuer, DynamicUse dynamicUse) {
1019 enqueuer.handleUnseenSelectorInternal(dynamicUse); 1023 enqueuer.handleUnseenSelectorInternal(dynamicUse);
1020 } 1024 }
1021 } 1025 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698