| Index: dart/lib/compiler/implementation/ssa/builder.dart
|
| diff --git a/dart/lib/compiler/implementation/ssa/builder.dart b/dart/lib/compiler/implementation/ssa/builder.dart
|
| index 53bc6683e6b3d5dfa828a8155459ca0642afaf6e..530f4cfc7efa9c0059657324f0e7a6af14323ca8 100644
|
| --- a/dart/lib/compiler/implementation/ssa/builder.dart
|
| +++ b/dart/lib/compiler/implementation/ssa/builder.dart
|
| @@ -1096,42 +1096,44 @@ class SsaBuilder extends ResolvedVisitor implements Visitor {
|
| Link<Node> arguments,
|
| List<FunctionElement> constructors,
|
| Map<Element, HInstruction> fieldValues) {
|
| - assert(invariant(constructor, constructor.isImplementation));
|
| - constructors.addLast(constructor);
|
| -
|
| - List<HInstruction> compiledArguments = new List<HInstruction>();
|
| - bool succeeded = addStaticSendArgumentsToList(selector,
|
| - arguments,
|
| - constructor,
|
| - compiledArguments);
|
| - if (!succeeded) {
|
| - // Non-matching super and redirects are compile-time errors and thus
|
| - // checked by the resolver.
|
| - compiler.internalError(
|
| - "Parameters and arguments didn't match for super/redirect call",
|
| - element: constructor);
|
| - }
|
| + compiler.withCurrentElement(constructor, () {
|
| + assert(invariant(constructor, constructor.isImplementation));
|
| + constructors.addLast(constructor);
|
| +
|
| + List<HInstruction> compiledArguments = new List<HInstruction>();
|
| + bool succeeded = addStaticSendArgumentsToList(selector,
|
| + arguments,
|
| + constructor,
|
| + compiledArguments);
|
| + if (!succeeded) {
|
| + // Non-matching super and redirects are compile-time errors and thus
|
| + // checked by the resolver.
|
| + compiler.internalError(
|
| + "Parameters and arguments didn't match for super/redirect call",
|
| + element: constructor);
|
| + }
|
|
|
| - buildFieldInitializers(constructor.enclosingElement, fieldValues);
|
| + buildFieldInitializers(constructor.enclosingElement, fieldValues);
|
| +
|
| + int index = 0;
|
| + FunctionSignature params = constructor.computeSignature(compiler);
|
| + params.forEachParameter((Element parameter) {
|
| + HInstruction argument = compiledArguments[index++];
|
| + localsHandler.updateLocal(parameter, argument);
|
| + // Don't forget to update the field, if the parameter is of the
|
| + // form [:this.x:].
|
| + if (parameter.kind == ElementKind.FIELD_PARAMETER) {
|
| + FieldParameterElement fieldParameterElement = parameter;
|
| + fieldValues[fieldParameterElement.fieldElement] = argument;
|
| + }
|
| + });
|
|
|
| - int index = 0;
|
| - FunctionSignature params = constructor.computeSignature(compiler);
|
| - params.forEachParameter((Element parameter) {
|
| - HInstruction argument = compiledArguments[index++];
|
| - localsHandler.updateLocal(parameter, argument);
|
| - // Don't forget to update the field, if the parameter is of the
|
| - // form [:this.x:].
|
| - if (parameter.kind == ElementKind.FIELD_PARAMETER) {
|
| - FieldParameterElement fieldParameterElement = parameter;
|
| - fieldValues[fieldParameterElement.fieldElement] = argument;
|
| - }
|
| + // Build the initializers in the context of the new constructor.
|
| + TreeElements oldElements = elements;
|
| + elements = compiler.resolver.resolveMethodElement(constructor);
|
| + buildInitializers(constructor, constructors, fieldValues);
|
| + elements = oldElements;
|
| });
|
| -
|
| - // Build the initializers in the context of the new constructor.
|
| - TreeElements oldElements = elements;
|
| - elements = compiler.resolver.resolveMethodElement(constructor);
|
| - buildInitializers(constructor, constructors, fieldValues);
|
| - elements = oldElements;
|
| }
|
|
|
| /**
|
|
|