| Index: pkg/compiler/lib/src/js_backend/backend_impact.dart
|
| diff --git a/pkg/compiler/lib/src/js_backend/backend_impact.dart b/pkg/compiler/lib/src/js_backend/backend_impact.dart
|
| index e9440908c5bed0b76bd0c6508a5e7120a52dac0f..f92da95e76a74983db250de8ec3c1b8fa17ce3b5 100644
|
| --- a/pkg/compiler/lib/src/js_backend/backend_impact.dart
|
| +++ b/pkg/compiler/lib/src/js_backend/backend_impact.dart
|
| @@ -14,7 +14,6 @@ import '../universe/world_impact.dart'
|
| show WorldImpact, WorldImpactBuilder, WorldImpactBuilderImpl;
|
| import '../universe/use.dart';
|
| import '../util/enumset.dart';
|
| -import 'backend_helpers.dart';
|
|
|
| /// Backend specific features required by a backend impact.
|
| enum BackendFeature {
|
| @@ -92,16 +91,15 @@ class BackendImpact {
|
| class BackendImpacts {
|
| final CompilerOptions _options;
|
| final CommonElements _commonElements;
|
| - final BackendHelpers _helpers;
|
|
|
| - BackendImpacts(this._options, this._commonElements, this._helpers);
|
| + BackendImpacts(this._options, this._commonElements);
|
|
|
| BackendImpact _getRuntimeTypeArgument;
|
|
|
| BackendImpact get getRuntimeTypeArgument {
|
| return _getRuntimeTypeArgument ??= new BackendImpact(globalUses: [
|
| - _helpers.getRuntimeTypeArgument,
|
| - _helpers.getTypeArgumentByIndex,
|
| + _commonElements.getRuntimeTypeArgument,
|
| + _commonElements.getTypeArgumentByIndex,
|
| ]);
|
| }
|
|
|
| @@ -109,10 +107,10 @@ class BackendImpacts {
|
|
|
| BackendImpact get computeSignature {
|
| return _computeSignature ??= new BackendImpact(globalUses: [
|
| - _helpers.setRuntimeTypeInfo,
|
| - _helpers.getRuntimeTypeInfo,
|
| - _helpers.computeSignature,
|
| - _helpers.getRuntimeTypeArguments
|
| + _commonElements.setRuntimeTypeInfo,
|
| + _commonElements.getRuntimeTypeInfo,
|
| + _commonElements.computeSignature,
|
| + _commonElements.getRuntimeTypeArguments
|
| ], otherImpacts: [
|
| listValues
|
| ]);
|
| @@ -121,18 +119,20 @@ class BackendImpacts {
|
| BackendImpact _mainWithArguments;
|
|
|
| BackendImpact get mainWithArguments {
|
| - return _mainWithArguments ??= new BackendImpact(
|
| - instantiatedClasses: [_helpers.jsArrayClass, _helpers.jsStringClass]);
|
| + return _mainWithArguments ??= new BackendImpact(instantiatedClasses: [
|
| + _commonElements.jsArrayClass,
|
| + _commonElements.jsStringClass
|
| + ]);
|
| }
|
|
|
| BackendImpact _asyncBody;
|
|
|
| BackendImpact get asyncBody {
|
| return _asyncBody ??= new BackendImpact(staticUses: [
|
| - _helpers.asyncHelper,
|
| - _helpers.syncCompleterConstructor,
|
| - _helpers.streamIteratorConstructor,
|
| - _helpers.wrapBody
|
| + _commonElements.asyncHelper,
|
| + _commonElements.syncCompleterConstructor,
|
| + _commonElements.streamIteratorConstructor,
|
| + _commonElements.wrapBody
|
| ]);
|
| }
|
|
|
| @@ -140,12 +140,12 @@ class BackendImpacts {
|
|
|
| BackendImpact get syncStarBody {
|
| return _syncStarBody ??= new BackendImpact(staticUses: [
|
| - _helpers.syncStarIterableConstructor,
|
| - _helpers.endOfIteration,
|
| - _helpers.yieldStar,
|
| - _helpers.syncStarUncaughtError
|
| + _commonElements.syncStarIterableConstructor,
|
| + _commonElements.endOfIteration,
|
| + _commonElements.yieldStar,
|
| + _commonElements.syncStarUncaughtError
|
| ], instantiatedClasses: [
|
| - _helpers.syncStarIterable
|
| + _commonElements.syncStarIterable
|
| ]);
|
| }
|
|
|
| @@ -153,30 +153,32 @@ class BackendImpacts {
|
|
|
| BackendImpact get asyncStarBody {
|
| return _asyncStarBody ??= new BackendImpact(staticUses: [
|
| - _helpers.asyncStarHelper,
|
| - _helpers.streamOfController,
|
| - _helpers.yieldSingle,
|
| - _helpers.yieldStar,
|
| - _helpers.asyncStarControllerConstructor,
|
| - _helpers.streamIteratorConstructor,
|
| - _helpers.wrapBody
|
| + _commonElements.asyncStarHelper,
|
| + _commonElements.streamOfController,
|
| + _commonElements.yieldSingle,
|
| + _commonElements.yieldStar,
|
| + _commonElements.asyncStarControllerConstructor,
|
| + _commonElements.streamIteratorConstructor,
|
| + _commonElements.wrapBody
|
| ], instantiatedClasses: [
|
| - _helpers.asyncStarController
|
| + _commonElements.asyncStarController
|
| ]);
|
| }
|
|
|
| BackendImpact _typeVariableBoundCheck;
|
|
|
| BackendImpact get typeVariableBoundCheck {
|
| - return _typeVariableBoundCheck ??= new BackendImpact(
|
| - staticUses: [_helpers.throwTypeError, _helpers.assertIsSubtype]);
|
| + return _typeVariableBoundCheck ??= new BackendImpact(staticUses: [
|
| + _commonElements.throwTypeError,
|
| + _commonElements.assertIsSubtype
|
| + ]);
|
| }
|
|
|
| BackendImpact _abstractClassInstantiation;
|
|
|
| BackendImpact get abstractClassInstantiation {
|
| return _abstractClassInstantiation ??= new BackendImpact(
|
| - staticUses: [_helpers.throwAbstractClassInstantiationError],
|
| + staticUses: [_commonElements.throwAbstractClassInstantiationError],
|
| otherImpacts: [_needsString('Needed to encode the message.')]);
|
| }
|
|
|
| @@ -184,14 +186,14 @@ class BackendImpacts {
|
|
|
| BackendImpact get fallThroughError {
|
| return _fallThroughError ??=
|
| - new BackendImpact(staticUses: [_helpers.fallThroughError]);
|
| + new BackendImpact(staticUses: [_commonElements.fallThroughError]);
|
| }
|
|
|
| BackendImpact _asCheck;
|
|
|
| BackendImpact get asCheck {
|
| return _asCheck ??=
|
| - new BackendImpact(staticUses: [_helpers.throwRuntimeError]);
|
| + new BackendImpact(staticUses: [_commonElements.throwRuntimeError]);
|
| }
|
|
|
| BackendImpact _throwNoSuchMethod;
|
| @@ -205,18 +207,18 @@ class BackendImpacts {
|
| : [],
|
| staticUses: _options.useKernel
|
| ? [
|
| - _helpers.genericNoSuchMethod,
|
| - _helpers.unresolvedConstructorError,
|
| - _helpers.unresolvedStaticMethodError,
|
| - _helpers.unresolvedStaticGetterError,
|
| - _helpers.unresolvedStaticSetterError,
|
| - _helpers.unresolvedTopLevelMethodError,
|
| - _helpers.unresolvedTopLevelGetterError,
|
| - _helpers.unresolvedTopLevelSetterError,
|
| + _commonElements.genericNoSuchMethod,
|
| + _commonElements.unresolvedConstructorError,
|
| + _commonElements.unresolvedStaticMethodError,
|
| + _commonElements.unresolvedStaticGetterError,
|
| + _commonElements.unresolvedStaticSetterError,
|
| + _commonElements.unresolvedTopLevelMethodError,
|
| + _commonElements.unresolvedTopLevelGetterError,
|
| + _commonElements.unresolvedTopLevelSetterError,
|
| _commonElements.symbolConstructor,
|
| ]
|
| : [
|
| - _helpers.throwNoSuchMethod,
|
| + _commonElements.throwNoSuchMethod,
|
| ],
|
| otherImpacts: [
|
| // Also register the types of the arguments passed to this method.
|
| @@ -230,19 +232,19 @@ class BackendImpacts {
|
|
|
| BackendImpact get stringValues {
|
| return _stringValues ??=
|
| - new BackendImpact(instantiatedClasses: [_helpers.jsStringClass]);
|
| + new BackendImpact(instantiatedClasses: [_commonElements.jsStringClass]);
|
| }
|
|
|
| BackendImpact _numValues;
|
|
|
| BackendImpact get numValues {
|
| return _numValues ??= new BackendImpact(instantiatedClasses: [
|
| - _helpers.jsIntClass,
|
| - _helpers.jsPositiveIntClass,
|
| - _helpers.jsUInt32Class,
|
| - _helpers.jsUInt31Class,
|
| - _helpers.jsNumberClass,
|
| - _helpers.jsDoubleClass
|
| + _commonElements.jsIntClass,
|
| + _commonElements.jsPositiveIntClass,
|
| + _commonElements.jsUInt32Class,
|
| + _commonElements.jsUInt31Class,
|
| + _commonElements.jsNumberClass,
|
| + _commonElements.jsDoubleClass
|
| ]);
|
| }
|
|
|
| @@ -254,25 +256,25 @@ class BackendImpacts {
|
|
|
| BackendImpact get boolValues {
|
| return _boolValues ??=
|
| - new BackendImpact(instantiatedClasses: [_helpers.jsBoolClass]);
|
| + new BackendImpact(instantiatedClasses: [_commonElements.jsBoolClass]);
|
| }
|
|
|
| BackendImpact _nullValue;
|
|
|
| BackendImpact get nullValue {
|
| return _nullValue ??=
|
| - new BackendImpact(instantiatedClasses: [_helpers.jsNullClass]);
|
| + new BackendImpact(instantiatedClasses: [_commonElements.jsNullClass]);
|
| }
|
|
|
| BackendImpact _listValues;
|
|
|
| BackendImpact get listValues {
|
| return _listValues ??= new BackendImpact(globalClasses: [
|
| - _helpers.jsArrayClass,
|
| - _helpers.jsMutableArrayClass,
|
| - _helpers.jsFixedArrayClass,
|
| - _helpers.jsExtendableArrayClass,
|
| - _helpers.jsUnmodifiableArrayClass
|
| + _commonElements.jsArrayClass,
|
| + _commonElements.jsMutableArrayClass,
|
| + _commonElements.jsFixedArrayClass,
|
| + _commonElements.jsExtendableArrayClass,
|
| + _commonElements.jsUnmodifiableArrayClass
|
| ]);
|
| }
|
|
|
| @@ -284,11 +286,11 @@ class BackendImpacts {
|
| ? [
|
| // TODO(sra): Refactor impacts so that we know which of these
|
| // are called.
|
| - _helpers.malformedTypeError,
|
| - _helpers.throwRuntimeError,
|
| + _commonElements.malformedTypeError,
|
| + _commonElements.throwRuntimeError,
|
| ]
|
| : [
|
| - _helpers.throwRuntimeError,
|
| + _commonElements.throwRuntimeError,
|
| ],
|
| otherImpacts: [
|
| // Also register the types of the arguments passed to this method.
|
| @@ -300,8 +302,8 @@ class BackendImpacts {
|
|
|
| BackendImpact get superNoSuchMethod {
|
| return _superNoSuchMethod ??= new BackendImpact(staticUses: [
|
| - _helpers.createInvocationMirror,
|
| - _helpers.objectNoSuchMethod
|
| + _commonElements.createInvocationMirror,
|
| + _commonElements.objectNoSuchMethod
|
| ], otherImpacts: [
|
| _needsInt('Needed to encode the invocation kind of super.noSuchMethod.'),
|
| _needsList('Needed to encode the arguments of super.noSuchMethod.'),
|
| @@ -313,18 +315,18 @@ class BackendImpacts {
|
|
|
| BackendImpact get constantMapLiteral {
|
| return _constantMapLiteral ??= new BackendImpact(instantiatedClasses: [
|
| - _helpers.constantMapClass,
|
| - _helpers.constantProtoMapClass,
|
| - _helpers.constantStringMapClass,
|
| - _helpers.generalConstantMapClass,
|
| + _commonElements.constantMapClass,
|
| + _commonElements.constantProtoMapClass,
|
| + _commonElements.constantStringMapClass,
|
| + _commonElements.generalConstantMapClass,
|
| ]);
|
| }
|
|
|
| BackendImpact _symbolConstructor;
|
|
|
| BackendImpact get symbolConstructor {
|
| - return _symbolConstructor ??=
|
| - new BackendImpact(staticUses: [_helpers.symbolValidatedConstructor]);
|
| + return _symbolConstructor ??= new BackendImpact(
|
| + staticUses: [_commonElements.symbolValidatedConstructor]);
|
| }
|
|
|
| BackendImpact _constSymbol;
|
| @@ -357,21 +359,21 @@ class BackendImpacts {
|
|
|
| BackendImpact get assertWithoutMessage {
|
| return _assertWithoutMessage ??=
|
| - new BackendImpact(staticUses: [_helpers.assertHelper]);
|
| + new BackendImpact(staticUses: [_commonElements.assertHelper]);
|
| }
|
|
|
| BackendImpact _assertWithMessage;
|
|
|
| BackendImpact get assertWithMessage {
|
| return _assertWithMessage ??= new BackendImpact(
|
| - staticUses: [_helpers.assertTest, _helpers.assertThrow]);
|
| + staticUses: [_commonElements.assertTest, _commonElements.assertThrow]);
|
| }
|
|
|
| BackendImpact _asyncForIn;
|
|
|
| BackendImpact get asyncForIn {
|
| - return _asyncForIn ??=
|
| - new BackendImpact(staticUses: [_helpers.streamIteratorConstructor]);
|
| + return _asyncForIn ??= new BackendImpact(
|
| + staticUses: [_commonElements.streamIteratorConstructor]);
|
| }
|
|
|
| BackendImpact _stringInterpolation;
|
| @@ -379,7 +381,7 @@ class BackendImpacts {
|
| BackendImpact get stringInterpolation {
|
| return _stringInterpolation ??= new BackendImpact(
|
| dynamicUses: [Selectors.toString_],
|
| - staticUses: [_helpers.stringInterpolationHelper],
|
| + staticUses: [_commonElements.stringInterpolationHelper],
|
| otherImpacts: [_needsString('Strings are created.')]);
|
| }
|
|
|
| @@ -403,10 +405,10 @@ class BackendImpacts {
|
|
|
| BackendImpact get catchStatement {
|
| return _catchStatement ??= new BackendImpact(staticUses: [
|
| - _helpers.exceptionUnwrapper
|
| + _commonElements.exceptionUnwrapper
|
| ], instantiatedClasses: [
|
| - _helpers.jsPlainJavaScriptObjectClass,
|
| - _helpers.jsUnknownJavaScriptObjectClass
|
| + _commonElements.jsPlainJavaScriptObjectClass,
|
| + _commonElements.jsUnknownJavaScriptObjectClass
|
| ]);
|
| }
|
|
|
| @@ -418,8 +420,8 @@ class BackendImpacts {
|
| // statement context or an expression context, so we register both
|
| // here, even though we may not need the throwExpression helper.
|
| staticUses: [
|
| - _helpers.wrapExceptionHelper,
|
| - _helpers.throwExpressionHelper
|
| + _commonElements.wrapExceptionHelper,
|
| + _commonElements.throwExpressionHelper
|
| ]);
|
| }
|
|
|
| @@ -427,23 +429,23 @@ class BackendImpacts {
|
|
|
| BackendImpact get lazyField {
|
| return _lazyField ??=
|
| - new BackendImpact(staticUses: [_helpers.cyclicThrowHelper]);
|
| + new BackendImpact(staticUses: [_commonElements.cyclicThrowHelper]);
|
| }
|
|
|
| BackendImpact _typeLiteral;
|
|
|
| BackendImpact get typeLiteral {
|
| return _typeLiteral ??= new BackendImpact(
|
| - instantiatedClasses: [_helpers.typeLiteralClass],
|
| - staticUses: [_helpers.createRuntimeType]);
|
| + instantiatedClasses: [_commonElements.typeLiteralClass],
|
| + staticUses: [_commonElements.createRuntimeType]);
|
| }
|
|
|
| BackendImpact _stackTraceInCatch;
|
|
|
| BackendImpact get stackTraceInCatch {
|
| return _stackTraceInCatch ??= new BackendImpact(
|
| - instantiatedClasses: [_helpers.stackTraceClass],
|
| - staticUses: [_helpers.traceFromException]);
|
| + instantiatedClasses: [_commonElements.stackTraceHelperClass],
|
| + staticUses: [_commonElements.traceFromException]);
|
| }
|
|
|
| BackendImpact _syncForIn;
|
| @@ -452,17 +454,17 @@ class BackendImpacts {
|
| return _syncForIn ??= new BackendImpact(
|
| // The SSA builder recognizes certain for-in loops and can generate
|
| // calls to throwConcurrentModificationError.
|
| - staticUses: [_helpers.checkConcurrentModificationError]);
|
| + staticUses: [_commonElements.checkConcurrentModificationError]);
|
| }
|
|
|
| BackendImpact _typeVariableExpression;
|
|
|
| BackendImpact get typeVariableExpression {
|
| return _typeVariableExpression ??= new BackendImpact(staticUses: [
|
| - _helpers.setRuntimeTypeInfo,
|
| - _helpers.getRuntimeTypeInfo,
|
| - _helpers.runtimeTypeToString,
|
| - _helpers.createRuntimeType
|
| + _commonElements.setRuntimeTypeInfo,
|
| + _commonElements.getRuntimeTypeInfo,
|
| + _commonElements.runtimeTypeToString,
|
| + _commonElements.createRuntimeType
|
| ], otherImpacts: [
|
| listValues,
|
| getRuntimeTypeArgument,
|
| @@ -480,7 +482,7 @@ class BackendImpacts {
|
|
|
| BackendImpact get checkedModeTypeCheck {
|
| return _checkedModeTypeCheck ??=
|
| - new BackendImpact(staticUses: [_helpers.throwRuntimeError]);
|
| + new BackendImpact(staticUses: [_commonElements.throwRuntimeError]);
|
| }
|
|
|
| BackendImpact _malformedTypeCheck;
|
| @@ -489,10 +491,10 @@ class BackendImpacts {
|
| return _malformedTypeCheck ??= new BackendImpact(
|
| staticUses: _options.useKernel
|
| ? [
|
| - _helpers.malformedTypeError,
|
| + _commonElements.malformedTypeError,
|
| ]
|
| : [
|
| - _helpers.throwTypeError,
|
| + _commonElements.throwTypeError,
|
| ]);
|
| }
|
|
|
| @@ -500,10 +502,10 @@ class BackendImpacts {
|
|
|
| BackendImpact get genericTypeCheck {
|
| return _genericTypeCheck ??= new BackendImpact(staticUses: [
|
| - _helpers.checkSubtype,
|
| + _commonElements.checkSubtype,
|
| // TODO(johnniwinther): Investigate why this is needed.
|
| - _helpers.setRuntimeTypeInfo,
|
| - _helpers.getRuntimeTypeInfo
|
| + _commonElements.setRuntimeTypeInfo,
|
| + _commonElements.getRuntimeTypeInfo
|
| ], otherImpacts: [
|
| listValues,
|
| getRuntimeTypeArgument
|
| @@ -520,21 +522,21 @@ class BackendImpacts {
|
|
|
| BackendImpact get genericCheckedModeTypeCheck {
|
| return _genericCheckedModeTypeCheck ??=
|
| - new BackendImpact(staticUses: [_helpers.assertSubtype]);
|
| + new BackendImpact(staticUses: [_commonElements.assertSubtype]);
|
| }
|
|
|
| BackendImpact _typeVariableTypeCheck;
|
|
|
| BackendImpact get typeVariableTypeCheck {
|
| - return _typeVariableTypeCheck ??=
|
| - new BackendImpact(staticUses: [_helpers.checkSubtypeOfRuntimeType]);
|
| + return _typeVariableTypeCheck ??= new BackendImpact(
|
| + staticUses: [_commonElements.checkSubtypeOfRuntimeType]);
|
| }
|
|
|
| BackendImpact _typeVariableCheckedModeTypeCheck;
|
|
|
| BackendImpact get typeVariableCheckedModeTypeCheck {
|
| - return _typeVariableCheckedModeTypeCheck ??=
|
| - new BackendImpact(staticUses: [_helpers.assertSubtypeOfRuntimeType]);
|
| + return _typeVariableCheckedModeTypeCheck ??= new BackendImpact(
|
| + staticUses: [_commonElements.assertSubtypeOfRuntimeType]);
|
| }
|
|
|
| BackendImpact _functionTypeCheck;
|
| @@ -551,7 +553,7 @@ class BackendImpacts {
|
| // We will neeed to add the "$is" and "$as" properties on the
|
| // JavaScript object prototype, so we make sure
|
| // [:defineProperty:] is compiled.
|
| - _helpers.defineProperty
|
| + _commonElements.defineProperty
|
| ]);
|
| }
|
|
|
| @@ -567,12 +569,12 @@ class BackendImpacts {
|
| BackendImpact get interceptorUse {
|
| return _interceptorUse ??= new BackendImpact(
|
| staticUses: [
|
| - _helpers.getNativeInterceptorMethod
|
| + _commonElements.getNativeInterceptorMethod
|
| ],
|
| instantiatedClasses: [
|
| - _helpers.jsJavaScriptObjectClass,
|
| - _helpers.jsPlainJavaScriptObjectClass,
|
| - _helpers.jsJavaScriptFunctionClass
|
| + _commonElements.jsJavaScriptObjectClass,
|
| + _commonElements.jsPlainJavaScriptObjectClass,
|
| + _commonElements.jsJavaScriptFunctionClass
|
| ],
|
| features: new EnumSet<BackendFeature>.fromValues([
|
| BackendFeature.needToInitializeDispatchProperty,
|
| @@ -586,7 +588,7 @@ class BackendImpacts {
|
| return _numClasses ??= new BackendImpact(
|
| // The backend will try to optimize number operations and use the
|
| // `iae` helper directly.
|
| - globalUses: [_helpers.throwIllegalArgumentException]);
|
| + globalUses: [_commonElements.throwIllegalArgumentException]);
|
| }
|
|
|
| BackendImpact _listOrStringClasses;
|
| @@ -594,10 +596,10 @@ class BackendImpacts {
|
| BackendImpact get listOrStringClasses {
|
| return _listOrStringClasses ??= new BackendImpact(
|
| // The backend will try to optimize array and string access and use the
|
| - // `ioore` and `iae` _helpers directly.
|
| + // `ioore` and `iae` _commonElements directly.
|
| globalUses: [
|
| - _helpers.throwIndexOutOfRangeException,
|
| - _helpers.throwIllegalArgumentException
|
| + _commonElements.throwIndexOutOfRangeException,
|
| + _commonElements.throwIllegalArgumentException
|
| ]);
|
| }
|
|
|
| @@ -605,7 +607,7 @@ class BackendImpacts {
|
|
|
| BackendImpact get functionClass {
|
| return _functionClass ??=
|
| - new BackendImpact(globalClasses: [_helpers.closureClass]);
|
| + new BackendImpact(globalClasses: [_commonElements.closureClass]);
|
| }
|
|
|
| BackendImpact _mapClass;
|
| @@ -614,26 +616,29 @@ class BackendImpacts {
|
| return _mapClass ??= new BackendImpact(
|
| // The backend will use a literal list to initialize the entries
|
| // of the map.
|
| - globalClasses: [_commonElements.listClass, _helpers.mapLiteralClass]);
|
| + globalClasses: [
|
| + _commonElements.listClass,
|
| + _commonElements.mapLiteralClass
|
| + ]);
|
| }
|
|
|
| BackendImpact _boundClosureClass;
|
|
|
| BackendImpact get boundClosureClass {
|
| return _boundClosureClass ??=
|
| - new BackendImpact(globalClasses: [_helpers.boundClosureClass]);
|
| + new BackendImpact(globalClasses: [_commonElements.boundClosureClass]);
|
| }
|
|
|
| BackendImpact _nativeOrExtendsClass;
|
|
|
| BackendImpact get nativeOrExtendsClass {
|
| return _nativeOrExtendsClass ??= new BackendImpact(globalUses: [
|
| - _helpers.getNativeInterceptorMethod
|
| + _commonElements.getNativeInterceptorMethod
|
| ], globalClasses: [
|
| - _helpers.jsInterceptorClass,
|
| - _helpers.jsJavaScriptObjectClass,
|
| - _helpers.jsPlainJavaScriptObjectClass,
|
| - _helpers.jsJavaScriptFunctionClass
|
| + _commonElements.jsInterceptorClass,
|
| + _commonElements.jsJavaScriptObjectClass,
|
| + _commonElements.jsPlainJavaScriptObjectClass,
|
| + _commonElements.jsJavaScriptFunctionClass
|
| ]);
|
| }
|
|
|
| @@ -641,10 +646,10 @@ class BackendImpacts {
|
|
|
| BackendImpact get mapLiteralClass {
|
| return _mapLiteralClass ??= new BackendImpact(globalUses: [
|
| - _helpers.mapLiteralConstructor,
|
| - _helpers.mapLiteralConstructorEmpty,
|
| - _helpers.mapLiteralUntypedMaker,
|
| - _helpers.mapLiteralUntypedEmptyMaker
|
| + _commonElements.mapLiteralConstructor,
|
| + _commonElements.mapLiteralConstructorEmpty,
|
| + _commonElements.mapLiteralUntypedMaker,
|
| + _commonElements.mapLiteralUntypedEmptyMaker
|
| ]);
|
| }
|
|
|
| @@ -652,7 +657,7 @@ class BackendImpacts {
|
|
|
| BackendImpact get closureClass {
|
| return _closureClass ??=
|
| - new BackendImpact(globalUses: [_helpers.closureFromTearOff]);
|
| + new BackendImpact(globalUses: [_commonElements.closureFromTearOff]);
|
| }
|
|
|
| BackendImpact _listClasses;
|
| @@ -661,9 +666,9 @@ class BackendImpacts {
|
| return _listClasses ??= new BackendImpact(
|
| // Literal lists can be translated into calls to these functions:
|
| globalUses: [
|
| - _helpers.jsArrayTypedConstructor,
|
| - _helpers.setRuntimeTypeInfo,
|
| - _helpers.getTypeArgumentByIndex
|
| + _commonElements.jsArrayTypedConstructor,
|
| + _commonElements.setRuntimeTypeInfo,
|
| + _commonElements.getTypeArgumentByIndex
|
| ]);
|
| }
|
|
|
| @@ -671,10 +676,10 @@ class BackendImpacts {
|
|
|
| BackendImpact get jsIndexingBehavior {
|
| return _jsIndexingBehavior ??= new BackendImpact(
|
| - // These two _helpers are used by the emitter and the codegen.
|
| + // These two _commonElements are used by the emitter and the codegen.
|
| // Because we cannot enqueue elements at the time of emission,
|
| // we make sure they are always generated.
|
| - globalUses: [_helpers.isJsIndexable]);
|
| + globalUses: [_commonElements.isJsIndexable]);
|
| }
|
|
|
| BackendImpact _enableTypeAssertions;
|
| @@ -685,37 +690,42 @@ class BackendImpacts {
|
| // is a boolean.
|
| // TODO(johnniwinther): Should this be registered through a [Feature]
|
| // instead?
|
| - globalUses: [_helpers.boolConversionCheck]);
|
| + globalUses: [_commonElements.boolConversionCheck]);
|
| }
|
|
|
| BackendImpact _traceHelper;
|
|
|
| BackendImpact get traceHelper {
|
| return _traceHelper ??=
|
| - new BackendImpact(globalUses: [_helpers.traceHelper]);
|
| + new BackendImpact(globalUses: [_commonElements.traceHelper]);
|
| }
|
|
|
| BackendImpact _assertUnreachable;
|
|
|
| BackendImpact get assertUnreachable {
|
| - return _assertUnreachable ??=
|
| - new BackendImpact(globalUses: [_helpers.assertUnreachableMethod]);
|
| + return _assertUnreachable ??= new BackendImpact(
|
| + globalUses: [_commonElements.assertUnreachableMethod]);
|
| }
|
|
|
| BackendImpact _runtimeTypeSupport;
|
|
|
| BackendImpact get runtimeTypeSupport {
|
| - return _runtimeTypeSupport ??= new BackendImpact(
|
| - globalClasses: [_commonElements.listClass],
|
| - globalUses: [_helpers.setRuntimeTypeInfo, _helpers.getRuntimeTypeInfo],
|
| - otherImpacts: [getRuntimeTypeArgument, computeSignature]);
|
| + return _runtimeTypeSupport ??= new BackendImpact(globalClasses: [
|
| + _commonElements.listClass
|
| + ], globalUses: [
|
| + _commonElements.setRuntimeTypeInfo,
|
| + _commonElements.getRuntimeTypeInfo
|
| + ], otherImpacts: [
|
| + getRuntimeTypeArgument,
|
| + computeSignature
|
| + ]);
|
| }
|
|
|
| BackendImpact _deferredLoading;
|
|
|
| BackendImpact get deferredLoading {
|
| return _deferredLoading ??=
|
| - new BackendImpact(globalUses: [_helpers.checkDeferredIsLoaded],
|
| + new BackendImpact(globalUses: [_commonElements.checkDeferredIsLoaded],
|
| // Also register the types of the arguments passed to this method.
|
| globalClasses: [_commonElements.stringClass]);
|
| }
|
| @@ -724,7 +734,7 @@ class BackendImpacts {
|
|
|
| BackendImpact get noSuchMethodSupport {
|
| return _noSuchMethodSupport ??= new BackendImpact(
|
| - staticUses: [_helpers.createInvocationMirror],
|
| + staticUses: [_commonElements.createInvocationMirror],
|
| dynamicUses: [Selectors.noSuchMethod_]);
|
| }
|
|
|
| @@ -733,15 +743,17 @@ class BackendImpacts {
|
| /// Backend impact for isolate support.
|
| BackendImpact get isolateSupport {
|
| return _isolateSupport ??=
|
| - new BackendImpact(globalUses: [_helpers.startRootIsolate]);
|
| + new BackendImpact(globalUses: [_commonElements.startRootIsolate]);
|
| }
|
|
|
| BackendImpact _isolateSupportForResolution;
|
|
|
| /// Additional backend impact for isolate support in resolution.
|
| BackendImpact get isolateSupportForResolution {
|
| - return _isolateSupportForResolution ??= new BackendImpact(
|
| - globalUses: [_helpers.currentIsolate, _helpers.callInIsolate]);
|
| + return _isolateSupportForResolution ??= new BackendImpact(globalUses: [
|
| + _commonElements.currentIsolate,
|
| + _commonElements.callInIsolate
|
| + ]);
|
| }
|
|
|
| BackendImpact _loadLibrary;
|
| @@ -750,7 +762,7 @@ class BackendImpacts {
|
| /// prefix.
|
| BackendImpact get loadLibrary {
|
| return _loadLibrary ??=
|
| - new BackendImpact(globalUses: [_helpers.loadLibraryWrapper]);
|
| + new BackendImpact(globalUses: [_commonElements.loadLibraryWrapper]);
|
| }
|
|
|
| BackendImpact _memberClosure;
|
| @@ -758,7 +770,7 @@ class BackendImpacts {
|
| /// Backend impact for performing member closurization.
|
| BackendImpact get memberClosure {
|
| return _memberClosure ??=
|
| - new BackendImpact(globalClasses: [_helpers.boundClosureClass]);
|
| + new BackendImpact(globalClasses: [_commonElements.boundClosureClass]);
|
| }
|
|
|
| BackendImpact _staticClosure;
|
| @@ -767,7 +779,7 @@ class BackendImpacts {
|
| /// function.
|
| BackendImpact get staticClosure {
|
| return _staticClosure ??=
|
| - new BackendImpact(globalClasses: [_helpers.closureClass]);
|
| + new BackendImpact(globalClasses: [_commonElements.closureClass]);
|
| }
|
|
|
| BackendImpact _typeVariableMirror;
|
| @@ -775,10 +787,10 @@ class BackendImpacts {
|
| /// Backend impact for type variables through mirrors.
|
| BackendImpact get typeVariableMirror {
|
| return _typeVariableMirror ??= new BackendImpact(staticUses: [
|
| - _helpers.typeVariableConstructor,
|
| - _helpers.createRuntimeType
|
| + _commonElements.typeVariableConstructor,
|
| + _commonElements.createRuntimeType
|
| ], instantiatedClasses: [
|
| - _helpers.typeVariableClass
|
| + _commonElements.typeVariableClass
|
| ]);
|
| }
|
| }
|
|
|