| Index: sdk/lib/_internal/compiler/implementation/universe/full_function_set.dart
|
| ===================================================================
|
| --- sdk/lib/_internal/compiler/implementation/universe/full_function_set.dart (revision 22031)
|
| +++ sdk/lib/_internal/compiler/implementation/universe/full_function_set.dart (working copy)
|
| @@ -33,14 +33,16 @@
|
| // TODO(kasperl): Check if any of the found classes may have a
|
| // non-throwing noSuchMethod implementation in a subclass instead
|
| // of always disabling the class list computation.
|
| - if (compiler.enabledNoSuchMethod) return null;
|
| + if (compiler.enabledNoSuchMethod) {
|
| + return <ClassElement>[compiler.objectClass];
|
| + }
|
| List<ClassElement> classes = <ClassElement>[];
|
| int budget = MAX_CLASSES_STEPS;
|
| L: for (Element element in functions) {
|
| ClassElement enclosing = element.getEnclosingClass();
|
| for (int i = 0; i < classes.length; i++) {
|
| if (--budget <= 0) {
|
| - return null;
|
| + return <ClassElement>[compiler.objectClass];
|
| } else if (enclosing.isSubclassOf(classes[i])) {
|
| continue L;
|
| } else if (classes[i].isSubclassOf(enclosing)) {
|
| @@ -48,26 +50,28 @@
|
| continue L;
|
| }
|
| }
|
| - if (classes.length >= MAX_CLASSES) return null;
|
| + if (classes.length >= MAX_CLASSES) {
|
| + return <ClassElement>[compiler.objectClass];
|
| + }
|
| classes.add(enclosing);
|
| }
|
| return classes;
|
| }
|
|
|
| static bool isExactClass(List<ClassElement> classes, Compiler compiler) {
|
| - if (classes == null || classes.length != 1) return false;
|
| + if (classes.length != 1) return false;
|
| ClassElement single = classes[0];
|
| // Return true if the single class in our list does not have a
|
| // single instantiated subclass.
|
| - Set<ClassElement> subtypes = compiler.world.subtypes[single];
|
| - return subtypes == null
|
| - || subtypes.every((ClassElement each) => !each.isSubclassOf(single));
|
| + Set<ClassElement> subclasses = compiler.world.subclasses[single];
|
| + return subclasses == null || subclasses.isEmpty;
|
| }
|
| }
|
|
|
| class FullFunctionSetQuery extends FunctionSetQuery {
|
| - final List<ClassElement> classes;
|
| final bool isExact;
|
| - FullFunctionSetQuery(List<Element> functions, this.classes, this.isExact)
|
| - : super(functions);
|
| + FullFunctionSetQuery(List<Element> functions,
|
| + Iterable<ClassElement> classes,
|
| + this.isExact)
|
| + : super(functions, classes);
|
| }
|
|
|