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

Side by Side Diff: lib/compiler/implementation/ssa/builder.dart

Issue 10991035: Fix invalid location in inline super constructor. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/compiler/dart2js_extra/source_mapping_crash_source.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 class Interceptors { 5 class Interceptors {
6 Compiler compiler; 6 Compiler compiler;
7 Interceptors(Compiler this.compiler); 7 Interceptors(Compiler this.compiler);
8 8
9 SourceString mapOperatorToMethodName(Operator op) { 9 SourceString mapOperatorToMethodName(Operator op) {
10 String name = op.source.stringValue; 10 String name = op.source.stringValue;
(...skipping 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after
1106 constructor, 1106 constructor,
1107 compiledArguments); 1107 compiledArguments);
1108 if (!succeeded) { 1108 if (!succeeded) {
1109 // Non-matching super and redirects are compile-time errors and thus 1109 // Non-matching super and redirects are compile-time errors and thus
1110 // checked by the resolver. 1110 // checked by the resolver.
1111 compiler.internalError( 1111 compiler.internalError(
1112 "Parameters and arguments didn't match for super/redirect call", 1112 "Parameters and arguments didn't match for super/redirect call",
1113 element: constructor); 1113 element: constructor);
1114 } 1114 }
1115 1115
1116 sourceElementStack.add(constructor.enclosingElement);
1116 buildFieldInitializers(constructor.enclosingElement, fieldValues); 1117 buildFieldInitializers(constructor.enclosingElement, fieldValues);
1118 sourceElementStack.removeLast();
1117 1119
1118 int index = 0; 1120 int index = 0;
1119 FunctionSignature params = constructor.computeSignature(compiler); 1121 FunctionSignature params = constructor.computeSignature(compiler);
1120 params.forEachParameter((Element parameter) { 1122 params.forEachParameter((Element parameter) {
1121 HInstruction argument = compiledArguments[index++]; 1123 HInstruction argument = compiledArguments[index++];
1122 localsHandler.updateLocal(parameter, argument); 1124 localsHandler.updateLocal(parameter, argument);
1123 // Don't forget to update the field, if the parameter is of the 1125 // Don't forget to update the field, if the parameter is of the
1124 // form [:this.x:]. 1126 // form [:this.x:].
1125 if (parameter.kind == ElementKind.FIELD_PARAMETER) { 1127 if (parameter.kind == ElementKind.FIELD_PARAMETER) {
1126 FieldParameterElement fieldParameterElement = parameter; 1128 FieldParameterElement fieldParameterElement = parameter;
(...skipping 1163 matching lines...) Expand 10 before | Expand all | Expand 10 after
2290 isNot = true; 2292 isNot = true;
2291 } 2293 }
2292 2294
2293 DartType type = elements.getType(typeAnnotation); 2295 DartType type = elements.getType(typeAnnotation);
2294 HInstruction typeInfo = null; 2296 HInstruction typeInfo = null;
2295 if (compiler.codegenWorld.rti.hasTypeArguments(type)) { 2297 if (compiler.codegenWorld.rti.hasTypeArguments(type)) {
2296 pushInvokeHelper1(interceptors.getGetRuntimeTypeInfo(), expression); 2298 pushInvokeHelper1(interceptors.getGetRuntimeTypeInfo(), expression);
2297 typeInfo = pop(); 2299 typeInfo = pop();
2298 } 2300 }
2299 if (type.element.isTypeVariable()) { 2301 if (type.element.isTypeVariable()) {
2300 // TODO(karlklose): We currently answer true to any is check 2302 // TODO(karlklose): We currently answer true to any is check
2301 // involving a type variable -- both is T and is !T -- until 2303 // involving a type variable -- both is T and is !T -- until
2302 // we have a proper implementation of reified generics. 2304 // we have a proper implementation of reified generics.
2303 stack.add(graph.addConstantBool(true, constantSystem)); 2305 stack.add(graph.addConstantBool(true, constantSystem));
2304 } else { 2306 } else {
2305 HInstruction instruction; 2307 HInstruction instruction;
2306 if (typeInfo !== null) { 2308 if (typeInfo !== null) {
2307 instruction = new HIs.withTypeInfoCall(type, expression, typeInfo); 2309 instruction = new HIs.withTypeInfoCall(type, expression, typeInfo);
2308 } else { 2310 } else {
2309 instruction = new HIs(type, expression); 2311 instruction = new HIs(type, expression);
2310 } 2312 }
2311 if (isNot) { 2313 if (isNot) {
(...skipping 2031 matching lines...) Expand 10 before | Expand all | Expand 10 after
4343 new HSubGraphBlockInformation(elseBranch.graph)); 4345 new HSubGraphBlockInformation(elseBranch.graph));
4344 4346
4345 HBasicBlock conditionStartBlock = conditionBranch.block; 4347 HBasicBlock conditionStartBlock = conditionBranch.block;
4346 conditionStartBlock.setBlockFlow(info, joinBlock); 4348 conditionStartBlock.setBlockFlow(info, joinBlock);
4347 SubGraph conditionGraph = conditionBranch.graph; 4349 SubGraph conditionGraph = conditionBranch.graph;
4348 HIf branch = conditionGraph.end.last; 4350 HIf branch = conditionGraph.end.last;
4349 assert(branch is HIf); 4351 assert(branch is HIf);
4350 branch.blockInformation = conditionStartBlock.blockFlow; 4352 branch.blockInformation = conditionStartBlock.blockFlow;
4351 } 4353 }
4352 } 4354 }
OLDNEW
« no previous file with comments | « no previous file | tests/compiler/dart2js_extra/source_mapping_crash_source.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698