| Index: pkg/compiler/lib/src/js_backend/codegen_listener.dart
|
| diff --git a/pkg/compiler/lib/src/js_backend/codegen_listener.dart b/pkg/compiler/lib/src/js_backend/codegen_listener.dart
|
| index 2fcda4509a8d6ada014f33b24fff6b86cf455bcb..1f4e0248f5c1e183cdc5fdf9f4f3d106a4e6a202 100644
|
| --- a/pkg/compiler/lib/src/js_backend/codegen_listener.dart
|
| +++ b/pkg/compiler/lib/src/js_backend/codegen_listener.dart
|
| @@ -7,9 +7,7 @@ library js_backend.backend.codegen_listener;
|
| import '../common/names.dart' show Identifiers;
|
| import '../common_elements.dart' show CommonElements, ElementEnvironment;
|
| import '../constants/values.dart';
|
| -import '../elements/elements.dart';
|
| import '../elements/entities.dart';
|
| -import '../elements/resolution_types.dart';
|
| import '../elements/types.dart';
|
| import '../enqueue.dart' show Enqueuer, EnqueuerListener;
|
| import '../native/enqueue.dart';
|
| @@ -76,7 +74,7 @@ class CodegenEnqueuerListener extends EnqueuerListener {
|
| }
|
|
|
| @override
|
| - void registerInstantiatedType(ResolutionInterfaceType type,
|
| + void registerInstantiatedType(InterfaceType type,
|
| {bool isGlobal: false, bool nativeUsage: false}) {
|
| if (nativeUsage) {
|
| _nativeEnqueuer.onInstantiatedType(type);
|
| @@ -86,7 +84,7 @@ class CodegenEnqueuerListener extends EnqueuerListener {
|
|
|
| /// Called to enable support for isolates. Any backend specific [WorldImpact]
|
| /// of this is returned.
|
| - WorldImpact _enableIsolateSupport(MethodElement mainMethod) {
|
| + WorldImpact _enableIsolateSupport(FunctionEntity mainMethod) {
|
| WorldImpactBuilderImpl impactBuilder = new WorldImpactBuilderImpl();
|
| // TODO(floitsch): We should also ensure that the class IsolateMessage is
|
| // instantiated. Currently, just enabling isolate support works.
|
| @@ -182,7 +180,7 @@ class CodegenEnqueuerListener extends EnqueuerListener {
|
|
|
| void _computeImpactForCompileTimeConstantInternal(
|
| ConstantValue constant, WorldImpactBuilder impactBuilder) {
|
| - ResolutionDartType type = constant.getType(_commonElements);
|
| + DartType type = constant.getType(_commonElements);
|
| _computeImpactForInstantiatedConstantType(type, impactBuilder);
|
|
|
| if (constant.isFunction) {
|
| @@ -192,8 +190,9 @@ class CodegenEnqueuerListener extends EnqueuerListener {
|
| } else if (constant.isInterceptor) {
|
| // An interceptor constant references the class's prototype chain.
|
| InterceptorConstantValue interceptor = constant;
|
| - ClassElement cls = interceptor.cls;
|
| - _computeImpactForInstantiatedConstantType(cls.thisType, impactBuilder);
|
| + ClassEntity cls = interceptor.cls;
|
| + _computeImpactForInstantiatedConstantType(
|
| + _elementEnvironment.getThisType(cls), impactBuilder);
|
| } else if (constant.isType) {
|
| impactBuilder
|
| .registerTypeUse(new TypeUse.instantiation(_commonElements.typeType));
|
| @@ -201,7 +200,7 @@ class CodegenEnqueuerListener extends EnqueuerListener {
|
| // available to 'upgrade' the native object.
|
| TypeConstantValue type = constant;
|
| if (type.representedType.isInterfaceType) {
|
| - ResolutionInterfaceType representedType = type.representedType;
|
| + InterfaceType representedType = type.representedType;
|
| _customElementsAnalysis.registerTypeConstant(representedType.element);
|
| _lookupMapAnalysis.registerTypeConstant(representedType.element);
|
| }
|
| @@ -210,8 +209,8 @@ class CodegenEnqueuerListener extends EnqueuerListener {
|
| }
|
|
|
| void _computeImpactForInstantiatedConstantType(
|
| - ResolutionDartType type, WorldImpactBuilder impactBuilder) {
|
| - if (type is ResolutionInterfaceType) {
|
| + DartType type, WorldImpactBuilder impactBuilder) {
|
| + if (type is InterfaceType) {
|
| impactBuilder.registerTypeUse(new TypeUse.instantiation(type));
|
| if (_rtiNeed.classNeedsRtiField(type.element)) {
|
| impactBuilder.registerStaticUse(new StaticUse.staticInvoke(
|
| @@ -255,16 +254,16 @@ class CodegenEnqueuerListener extends EnqueuerListener {
|
| return worldImpact;
|
| }
|
|
|
| - WorldImpact _processClass(ClassElement cls) {
|
| + WorldImpact _processClass(ClassEntity cls) {
|
| WorldImpactBuilderImpl impactBuilder = new WorldImpactBuilderImpl();
|
| - if (!cls.typeVariables.isEmpty) {
|
| + if (_elementEnvironment.isGenericClass(cls)) {
|
| _typeVariableCodegenAnalysis.registerClassWithTypeVariables(cls);
|
| }
|
| if (cls == _commonElements.closureClass) {
|
| _impacts.closureClass.registerImpact(impactBuilder, _elementEnvironment);
|
| }
|
|
|
| - void registerInstantiation(ClassElement cls) {
|
| + void registerInstantiation(ClassEntity cls) {
|
| impactBuilder.registerTypeUse(
|
| new TypeUse.instantiation(_elementEnvironment.getRawType(cls)));
|
| }
|
|
|