| Index: pkg/compiler/lib/src/ssa/builder.dart
|
| diff --git a/pkg/compiler/lib/src/ssa/builder.dart b/pkg/compiler/lib/src/ssa/builder.dart
|
| index 748fccfba38809d7b516045d0a1b0c04748c540b..66a24867ca35506fe0685602754be6f81ce6abae 100644
|
| --- a/pkg/compiler/lib/src/ssa/builder.dart
|
| +++ b/pkg/compiler/lib/src/ssa/builder.dart
|
| @@ -11,6 +11,7 @@ import '../common.dart';
|
| import '../common/codegen.dart' show CodegenRegistry, CodegenWorkItem;
|
| import '../common/names.dart' show Identifiers, Selectors;
|
| import '../common/tasks.dart' show CompilerTask;
|
| +import '../compiler.dart';
|
| import '../constants/constant_system.dart';
|
| import '../constants/expressions.dart';
|
| import '../constants/values.dart';
|
| @@ -150,6 +151,9 @@ class SsaBuilder extends ast.Visitor
|
| GlobalTypeInferenceElementResult elementInferenceResults;
|
|
|
| final JavaScriptBackend backend;
|
| +
|
| + Compiler get compiler => backend.compiler;
|
| +
|
| final ConstantSystem constantSystem;
|
| final RuntimeTypesSubstitutions rtiSubstitutions;
|
|
|
| @@ -202,7 +206,6 @@ class SsaBuilder extends ast.Visitor
|
| this.constantSystem = backend.constantSystem,
|
| this.rtiSubstitutions = backend.rtiSubstitutions {
|
| assert(target.isImplementation);
|
| - compiler = backend.compiler;
|
| elementInferenceResults = _resultOf(target);
|
| assert(elementInferenceResults != null);
|
| graph.element = target;
|
| @@ -490,7 +493,7 @@ class SsaBuilder extends ast.Visitor
|
|
|
| // Don't inline across deferred import to prevent leaking code. The only
|
| // exception is an empty function (which does not contain code).
|
| - bool hasOnlyNonDeferredImportPaths = compiler.deferredLoadTask
|
| + bool hasOnlyNonDeferredImportPaths = deferredLoadTask
|
| .hasOnlyNonDeferredImportPaths(compiler.currentElement, function);
|
|
|
| if (!hasOnlyNonDeferredImportPaths) {
|
| @@ -1211,7 +1214,7 @@ class SsaBuilder extends ast.Visitor
|
| // Uninitialized native fields are pre-initialized by the native
|
| // implementation.
|
| assert(invariant(
|
| - member, isNativeUpgradeFactory || compiler.compilationFailed));
|
| + member, isNativeUpgradeFactory || reporter.hasReportedError));
|
| } else {
|
| fields.add(member);
|
| ResolutionDartType type = localsHandler.substInContext(member.type);
|
| @@ -1791,7 +1794,7 @@ class SsaBuilder extends ast.Visitor
|
|
|
| visitFunctionExpression(ast.FunctionExpression node) {
|
| LocalFunctionElement methodElement = elements[node];
|
| - ClosureClassMap nestedClosureData = compiler.closureToClassMapper
|
| + ClosureClassMap nestedClosureData = closureToClassMapper
|
| .getClosureToClassMapping(methodElement.resolvedAst);
|
| assert(nestedClosureData != null);
|
| assert(nestedClosureData.closureClassElement != null);
|
| @@ -2023,7 +2026,7 @@ class SsaBuilder extends ast.Visitor
|
| PrefixElement prefixElement, ast.Node location) {
|
| if (prefixElement == null) return;
|
| String loadId =
|
| - compiler.deferredLoadTask.getImportDeferName(location, prefixElement);
|
| + deferredLoadTask.getImportDeferName(location, prefixElement);
|
| HInstruction loadIdConstant = addConstantString(loadId);
|
| String uri = prefixElement.deferredImport.uri.toString();
|
| HInstruction uriConstant = addConstantString(uri);
|
| @@ -2036,7 +2039,7 @@ class SsaBuilder extends ast.Visitor
|
| /// resolves to a deferred library.
|
| void generateIsDeferredLoadedCheckOfSend(ast.Send node) {
|
| generateIsDeferredLoadedCheckIfNeeded(
|
| - compiler.deferredLoadTask.deferredPrefixElement(node, elements), node);
|
| + deferredLoadTask.deferredPrefixElement(node, elements), node);
|
| }
|
|
|
| void handleInvalidStaticGet(ast.Send node, Element element) {
|
| @@ -2070,7 +2073,7 @@ class SsaBuilder extends ast.Visitor
|
| // Constants that are referred via a deferred prefix should be referred
|
| // by reference.
|
| PrefixElement prefix =
|
| - compiler.deferredLoadTask.deferredPrefixElement(node, elements);
|
| + deferredLoadTask.deferredPrefixElement(node, elements);
|
| if (prefix != null) {
|
| instruction = graph.addDeferredConstant(
|
| value, prefix, sourceInformation, compiler, closedWorld);
|
| @@ -2979,8 +2982,7 @@ class SsaBuilder extends ast.Visitor
|
| invariant(node, deferredLoader.isDeferredLoaderGetter);
|
| FunctionEntity loadFunction = helpers.loadLibraryWrapper;
|
| PrefixElement prefixElement = deferredLoader.enclosingElement;
|
| - String loadId =
|
| - compiler.deferredLoadTask.getImportDeferName(node, prefixElement);
|
| + String loadId = deferredLoadTask.getImportDeferName(node, prefixElement);
|
| var inputs = [
|
| graph.addConstantString(new ast.DartString.literal(loadId), closedWorld)
|
| ];
|
| @@ -3502,8 +3504,7 @@ class SsaBuilder extends ast.Visitor
|
| ResolutionDartType bound) {
|
| if (definitelyFails) return;
|
|
|
| - int subtypeRelation =
|
| - compiler.types.computeSubtypeRelation(typeArgument, bound);
|
| + int subtypeRelation = types.computeSubtypeRelation(typeArgument, bound);
|
| if (subtypeRelation == Types.IS_SUBTYPE) return;
|
|
|
| String message = "Can't create an instance of malbounded type '$type': "
|
| @@ -3528,14 +3529,13 @@ class SsaBuilder extends ast.Visitor
|
| }
|
| }
|
|
|
| - compiler.types.checkTypeVariableBounds(type, addTypeVariableBoundCheck);
|
| + types.checkTypeVariableBounds(type, addTypeVariableBoundCheck);
|
| if (definitelyFails) {
|
| return true;
|
| }
|
| for (ResolutionInterfaceType supertype in type.element.allSupertypes) {
|
| ResolutionDartType instance = type.asInstanceOf(supertype.element);
|
| - compiler.types
|
| - .checkTypeVariableBounds(instance, addTypeVariableBoundCheck);
|
| + types.checkTypeVariableBounds(instance, addTypeVariableBoundCheck);
|
| if (definitelyFails) {
|
| return true;
|
| }
|
|
|