Chromium Code Reviews| Index: pkg/compiler/lib/src/js_backend/backend.dart |
| diff --git a/pkg/compiler/lib/src/js_backend/backend.dart b/pkg/compiler/lib/src/js_backend/backend.dart |
| index 241eb978d7536d4fb00e8ce4278f4b7e80796a1e..9adc9042edbed557082e7044923ad1a6e008f69d 100644 |
| --- a/pkg/compiler/lib/src/js_backend/backend.dart |
| +++ b/pkg/compiler/lib/src/js_backend/backend.dart |
| @@ -1015,6 +1015,26 @@ class JavaScriptBackend extends Backend { |
| }); |
| } |
| + /// True if the given class is an internal class used for type inference |
| + /// and never exists at runtime. |
| + bool isCompileTimeOnlyClass(ClassElement class_) { |
| + return class_ == jsPositiveIntClass || |
|
sra1
2015/10/28 02:31:52
indent
asgerf
2015/10/28 10:06:31
Done.
|
| + class_ == jsUInt32Class || |
| + class_ == jsUInt31Class || |
| + class_ == jsFixedArrayClass || |
| + class_ == jsUnmodifiableArrayClass || |
| + class_ == jsMutableArrayClass || |
| + class_ == jsExtendableArrayClass; |
| + } |
| + |
| + /// Maps compile-time classes to their runtime class. The runtime class is |
| + /// always a superclass or the class itself. |
| + ClassElement getRuntimeClass(ClassElement class_) { |
| + if (class_.isSubclassOf(jsIntClass)) return jsIntClass; |
| + if (class_.isSubclassOf(jsArrayClass)) return jsArrayClass; |
| + return class_; |
| + } |
| + |
| final Map<String, Set<ClassElement>> interceptedClassesCache = |
| new Map<String, Set<ClassElement>>(); |
| @@ -1031,6 +1051,7 @@ class JavaScriptBackend extends Backend { |
| Set<ClassElement> result = new Set<ClassElement>(); |
| for (Element element in intercepted) { |
| ClassElement classElement = element.enclosingClass; |
| + if (isCompileTimeOnlyClass(classElement)) continue; |
| if (isNativeOrExtendsNative(classElement) |
| || interceptedClasses.contains(classElement)) { |
| result.add(classElement); |
| @@ -3220,4 +3241,3 @@ class Dependency { |
| const Dependency(this.constant, this.annotatedElement); |
| } |
| - |