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

Side by Side Diff: pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart

Issue 1772703002: Add source information to variable declarations in CPS. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 library tree_ir_builder; 5 library tree_ir_builder;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../constants/values.dart'; 8 import '../constants/values.dart';
9 import '../cps_ir/cps_ir_nodes.dart' as cps_ir; 9 import '../cps_ir/cps_ir_nodes.dart' as cps_ir;
10 import '../elements/elements.dart'; 10 import '../elements/elements.dart';
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 // Local function's 'this' refers to enclosing method's 'this' 138 // Local function's 'this' refers to enclosing method's 'this'
139 thisParameter = parent.thisParameter; 139 thisParameter = parent.thisParameter;
140 } else { 140 } else {
141 thisParameter = node.thisParameter; 141 thisParameter = node.thisParameter;
142 } 142 }
143 List<Variable> parameters = 143 List<Variable> parameters =
144 node.parameters.map(addFunctionParameter).toList(); 144 node.parameters.map(addFunctionParameter).toList();
145 returnContinuation = node.returnContinuation; 145 returnContinuation = node.returnContinuation;
146 phiTempVar = new Variable(node.element, null); 146 phiTempVar = new Variable(node.element, null);
147 Statement body = translateExpression(node.body); 147 Statement body = translateExpression(node.body);
148 return new FunctionDefinition(node.element, parameters, body); 148 return new FunctionDefinition(node.element, parameters, body,
149 sourceInformation: node.sourceInformation);
149 } 150 }
150 151
151 /// Returns a list of variables corresponding to the arguments to a method 152 /// Returns a list of variables corresponding to the arguments to a method
152 /// call or similar construct. 153 /// call or similar construct.
153 /// 154 ///
154 /// The `readCount` for these variables will be incremented. 155 /// The `readCount` for these variables will be incremented.
155 /// 156 ///
156 /// The list will be typed as a list of [Expression] to allow inplace updates 157 /// The list will be typed as a list of [Expression] to allow inplace updates
157 /// on the list during the rewrite phases. 158 /// on the list during the rewrite phases.
158 List<Expression> translateArguments(List<cps_ir.Reference> args) { 159 List<Expression> translateArguments(List<cps_ir.Reference> args) {
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 743
743 visitFunctionDefinition(cps_ir.FunctionDefinition node) { 744 visitFunctionDefinition(cps_ir.FunctionDefinition node) {
744 unexpectedNode(node); 745 unexpectedNode(node);
745 } 746 }
746 visitParameter(cps_ir.Parameter node) => unexpectedNode(node); 747 visitParameter(cps_ir.Parameter node) => unexpectedNode(node);
747 visitContinuation(cps_ir.Continuation node) => unexpectedNode(node); 748 visitContinuation(cps_ir.Continuation node) => unexpectedNode(node);
748 visitMutableVariable(cps_ir.MutableVariable node) => unexpectedNode(node); 749 visitMutableVariable(cps_ir.MutableVariable node) => unexpectedNode(node);
749 visitRethrow(cps_ir.Rethrow node) => unexpectedNode(node); 750 visitRethrow(cps_ir.Rethrow node) => unexpectedNode(node);
750 visitBoundsCheck(cps_ir.BoundsCheck node) => unexpectedNode(node); 751 visitBoundsCheck(cps_ir.BoundsCheck node) => unexpectedNode(node);
751 } 752 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/codegen/codegen.dart ('k') | pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698