| 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 3db52243d2c9f397f7fb24c8331f46a232b53fe8..b084ecd643bd8b2464a706ca98fb6e74221c7e3b 100644
|
| --- a/pkg/compiler/lib/src/ssa/builder.dart
|
| +++ b/pkg/compiler/lib/src/ssa/builder.dart
|
| @@ -798,53 +798,6 @@ class SsaBuilder extends ast.Visitor
|
| }
|
|
|
| /**
|
| - * Returns the constructor body associated with the given constructor or
|
| - * creates a new constructor body, if none can be found.
|
| - *
|
| - * Returns [:null:] if the constructor does not have a body.
|
| - */
|
| - ConstructorBodyElement getConstructorBody(
|
| - ResolvedAst constructorResolvedAst) {
|
| - ConstructorElement constructor =
|
| - constructorResolvedAst.element.implementation;
|
| - assert(constructor.isGenerativeConstructor);
|
| - if (constructorResolvedAst.kind != ResolvedAstKind.PARSED) return null;
|
| -
|
| - ast.FunctionExpression node = constructorResolvedAst.node;
|
| - // If we know the body doesn't have any code, we don't generate it.
|
| - if (!node.hasBody) return null;
|
| - if (node.hasEmptyBody) return null;
|
| - ClassElement classElement = constructor.enclosingClass;
|
| - ConstructorBodyElement bodyElement;
|
| - classElement.forEachBackendMember((Element backendMember) {
|
| - if (backendMember.isGenerativeConstructorBody) {
|
| - ConstructorBodyElement body = backendMember;
|
| - if (body.constructor == constructor) {
|
| - // TODO(kasperl): Find a way of stopping the iteration
|
| - // through the backend members.
|
| - bodyElement = backendMember;
|
| - }
|
| - }
|
| - });
|
| - if (bodyElement == null) {
|
| - bodyElement =
|
| - new ConstructorBodyElementX(constructorResolvedAst, constructor);
|
| - classElement.addBackendMember(bodyElement);
|
| -
|
| - if (constructor.isPatch) {
|
| - // Create origin body element for patched constructors.
|
| - ConstructorBodyElementX patch = bodyElement;
|
| - ConstructorBodyElementX origin = new ConstructorBodyElementX(
|
| - constructorResolvedAst, constructor.origin);
|
| - origin.applyPatch(patch);
|
| - classElement.origin.addBackendMember(bodyElement.origin);
|
| - }
|
| - }
|
| - assert(bodyElement.isGenerativeConstructorBody);
|
| - return bodyElement;
|
| - }
|
| -
|
| - /**
|
| * This method sets up the local state of the builder for inlining [function].
|
| * The arguments of the function are inserted into the [localsHandler].
|
| *
|
| @@ -1351,7 +1304,8 @@ class SsaBuilder extends ast.Visitor
|
| HInstruction interceptor = null;
|
| for (int index = constructorResolvedAsts.length - 1; index >= 0; index--) {
|
| ResolvedAst constructorResolvedAst = constructorResolvedAsts[index];
|
| - ConstructorBodyElement body = getConstructorBody(constructorResolvedAst);
|
| + ConstructorBodyElement body =
|
| + ConstructorBodyElementX.createFromResolvedAst(constructorResolvedAst);
|
| if (body == null) continue;
|
|
|
| List bodyCallInputs = <HInstruction>[];
|
|
|