| 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 bd8027a881ccaca01be7bb5c90f18ece60e5bda2..5843aeeb305f7f2c84c244bac0ac3a38074a4e24 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
|
| @@ -200,6 +200,7 @@ class JavaScriptBackend extends Backend {
|
| ClassElement typeLiteralClass;
|
| ClassElement mapLiteralClass;
|
| ClassElement constMapLiteralClass;
|
| + ClassElement typeVariableClass;
|
|
|
| Element getInterceptorMethod;
|
| Element interceptedNames;
|
| @@ -406,6 +407,8 @@ class JavaScriptBackend extends Backend {
|
| checkedModeHelpers,
|
| key: (helper) => helper.name.slowToString());
|
|
|
| + TypeVariableHandler typeVariableHandler;
|
| +
|
| /// Number of methods compiled before considering reflection.
|
| int preMirrorsMethodCount = 0;
|
|
|
| @@ -420,6 +423,7 @@ class JavaScriptBackend extends Backend {
|
| builder = new SsaBuilderTask(this);
|
| optimizer = new SsaOptimizerTask(this);
|
| generator = new SsaCodeGeneratorTask(this);
|
| + typeVariableHandler = new TypeVariableHandler(this);
|
| }
|
|
|
| static Namer determineNamer(Compiler compiler) {
|
| @@ -665,6 +669,9 @@ class JavaScriptBackend extends Backend {
|
| new TypeMask.nonNullExact(jsFixedArrayClass));
|
| extendableArrayType = new HBoundedType(
|
| new TypeMask.nonNullExact(jsExtendableArrayClass));
|
| +
|
| + typeVariableClass =
|
| + compiler.findHelper(const SourceString('TypeVariable'));
|
| }
|
|
|
| void validateInterceptorImplementsAllObjectMethods(
|
| @@ -792,6 +799,10 @@ class JavaScriptBackend extends Backend {
|
| void registerInstantiatedClass(ClassElement cls,
|
| Enqueuer enqueuer,
|
| TreeElements elements) {
|
| + if (!cls.typeVariables.isEmpty) {
|
| + typeVariableHandler.registerClassWithTypeVariables(cls);
|
| + }
|
| +
|
| if (!seenAnyClass) {
|
| seenAnyClass = true;
|
| if (enqueuer.isResolutionQueue) {
|
| @@ -1854,6 +1865,14 @@ class JavaScriptBackend extends Backend {
|
| }
|
| metadataConstants.clear();
|
| }
|
| +
|
| + if (isTreeShakingDisabled) {
|
| + if (enqueuer.isResolutionQueue) {
|
| + typeVariableHandler.onResolutionQueueEmpty(enqueuer);
|
| + } else {
|
| + typeVariableHandler.onCodegenQueueEmpty();
|
| + }
|
| + }
|
| }
|
| }
|
|
|
|
|