Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/js_backend/backend.dart |
| diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart |
| index 3bc06c91da6a14d4f45bf466365ad3a304afe449..54ffa9b681b67f8a799b906c8879f1af24891162 100644 |
| --- a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart |
| +++ b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart |
| @@ -662,6 +662,17 @@ class JavaScriptBackend extends Backend { |
| final Map<Element, ReturnInfo> returnInfo; |
| + Iterable<ClassElement> cachedClassesUsingTypeVariableTests; |
|
ngeoffray
2013/02/21 10:26:18
Should that be in the emitter instead? It would li
karlklose
2013/02/21 14:48:44
Done.
|
| + |
| + Iterable<ClassElement> get classesUsingTypeVariableTests { |
| + if (cachedClassesUsingTypeVariableTests == null) { |
| + cachedClassesUsingTypeVariableTests = rti.isChecks |
| + .where((DartType t) => t is TypeVariableType) |
| + .map((TypeVariableType v) => v.element.getEnclosingClass()); |
| + } |
| + return cachedClassesUsingTypeVariableTests; |
| + } |
| + |
| /** |
| * Documentation wanted -- johnniwinther |
| * |
| @@ -995,11 +1006,12 @@ class JavaScriptBackend extends Backend { |
| } |
| void registerIsCheck(DartType type, Enqueuer world) { |
| - if (!type.isRaw) { |
| + if (!type.isRaw || type is TypeVariableType) { |
|
ngeoffray
2013/02/21 10:26:18
use type.kind instead?
karlklose
2013/02/21 14:48:44
Done.
|
| enqueueInResolution(getSetRuntimeTypeInfo()); |
| enqueueInResolution(getGetRuntimeTypeInfo()); |
| enqueueInResolution(getGetRuntimeTypeArgument()); |
| enqueueInResolution(getCheckArguments()); |
| + enqueueInResolution(getGetObjectIsSubtype()); |
|
ngeoffray
2013/02/21 10:26:18
Isn't that one just requires by TypeVariableType?
karlklose
2013/02/21 14:48:44
Done.
|
| } |
| // [registerIsCheck] is also called for checked mode checks, so we |
| // need to register checked mode helpers. |
| @@ -1444,6 +1456,10 @@ class JavaScriptBackend extends Backend { |
| return compiler.findHelper(const SourceString('checkArguments')); |
| } |
| + Element getGetObjectIsSubtype() { |
| + return compiler.findHelper(const SourceString('objectIsSubtype')); |
| + } |
| + |
| Element getThrowNoSuchMethod() { |
| return compiler.findHelper(const SourceString('throwNoSuchMethod')); |
| } |