| Index: pkg/compiler/lib/src/js_backend/type_variable_handler.dart
|
| diff --git a/pkg/compiler/lib/src/js_backend/type_variable_handler.dart b/pkg/compiler/lib/src/js_backend/type_variable_handler.dart
|
| index ada9d167a6e5f0843640de687723b982450f9086..d7c3281f056ff48349ad0bc3dfd0a8d450816848 100644
|
| --- a/pkg/compiler/lib/src/js_backend/type_variable_handler.dart
|
| +++ b/pkg/compiler/lib/src/js_backend/type_variable_handler.dart
|
| @@ -15,6 +15,7 @@ import '../js_emitter/js_emitter.dart'
|
| show CodeEmitterTask, MetadataCollector, Placeholder;
|
| import '../universe/call_structure.dart' show CallStructure;
|
| import '../universe/use.dart' show StaticUse;
|
| +import '../universe/world_impact.dart';
|
| import '../util/util.dart';
|
| import 'backend.dart';
|
|
|
| @@ -44,6 +45,10 @@ class TypeVariableHandler {
|
| Map<TypeVariableElement, jsAst.Expression> _typeVariableConstants =
|
| new Map<TypeVariableElement, jsAst.Expression>();
|
|
|
| + /// Impact builder used for the codegen world computation.
|
| + // TODO(johnniwinther): Add impact builder for resolution.
|
| + final StagedWorldImpactBuilder impactBuilder = new StagedWorldImpactBuilder();
|
| +
|
| TypeVariableHandler(this._compiler);
|
|
|
| ClassElement get _typeVariableClass => _backend.helpers.typeVariableClass;
|
| @@ -52,6 +57,12 @@ class TypeVariableHandler {
|
| JavaScriptBackend get _backend => _compiler.backend;
|
| DiagnosticReporter get reporter => _compiler.reporter;
|
|
|
| + void onQueueEmpty(Enqueuer enqueuer) {
|
| + if (enqueuer.isResolutionQueue) return;
|
| +
|
| + enqueuer.applyImpact(null, impactBuilder.flush());
|
| + }
|
| +
|
| void registerClassWithTypeVariables(
|
| ClassElement cls, Enqueuer enqueuer, Registry registry) {
|
| if (enqueuer.isResolutionQueue) {
|
| @@ -108,9 +119,8 @@ class TypeVariableHandler {
|
|
|
| _backend.constants.evaluate(constant);
|
| ConstantValue value = _backend.constants.getConstantValue(constant);
|
| - _backend.registerCompileTimeConstant(value, _compiler.globalDependencies);
|
| + _backend.computeImpactForCompileTimeConstant(value, impactBuilder, false);
|
| _backend.addCompileTimeConstantForEmission(value);
|
| - _backend.constants.addCompileTimeConstantForEmission(value);
|
| constants
|
| .add(_reifyTypeVariableConstant(value, currentTypeVariable.element));
|
| }
|
|
|