Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1269)

Unified Diff: dart/lib/compiler/implementation/ssa/builder.dart

Issue 10970070: Fix bad diagnostic positions when inlining super constructors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
}
/**

Powered by Google App Engine
This is Rietveld 408576698