Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 '../dart2jslib.dart' as dart2js; | 7 import '../dart2jslib.dart' as dart2js; |
| 8 import '../dart_types.dart'; | 8 import '../dart_types.dart'; |
| 9 import '../elements/elements.dart'; | 9 import '../elements/elements.dart'; |
| 10 import '../cps_ir/cps_ir_nodes.dart' as cps_ir; | 10 import '../cps_ir/cps_ir_nodes.dart' as cps_ir; |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 149 | 149 |
| 150 body = visit(node.body); | 150 body = visit(node.body); |
| 151 } | 151 } |
| 152 return new FieldDefinition(node.element, body); | 152 return new FieldDefinition(node.element, body); |
| 153 } | 153 } |
| 154 | 154 |
| 155 Variable addFunctionParameter(cps_ir.Definition variable) { | 155 Variable addFunctionParameter(cps_ir.Definition variable) { |
| 156 if (variable is cps_ir.Parameter) { | 156 if (variable is cps_ir.Parameter) { |
| 157 return getVariable(variable); | 157 return getVariable(variable); |
| 158 } else { | 158 } else { |
| 159 return addMutableVariable(variable as cps_ir.MutableVariable); | 159 return addMutableVariable(variable as cps_ir.MutableVariable) |
| 160 ..isCaptured = true; | |
|
asgerf
2015/04/15 10:43:39
This is for parameters accessed by initializers.
| |
| 160 } | 161 } |
| 161 } | 162 } |
| 162 | 163 |
| 163 FunctionDefinition buildFunction(cps_ir.FunctionDefinition node) { | 164 FunctionDefinition buildFunction(cps_ir.FunctionDefinition node) { |
| 164 currentElement = node.element; | 165 currentElement = node.element; |
| 165 if (parent != null) { | 166 if (parent != null) { |
| 166 // Local function's 'this' refers to enclosing method's 'this' | 167 // Local function's 'this' refers to enclosing method's 'this' |
| 167 thisParameter = parent.thisParameter; | 168 thisParameter = parent.thisParameter; |
| 168 } else { | 169 } else { |
| 169 thisParameter = node.thisParameter; | 170 thisParameter = node.thisParameter; |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 650 } | 651 } |
| 651 | 652 |
| 652 @override | 653 @override |
| 653 Node visitTypeExpression(cps_ir.TypeExpression node) { | 654 Node visitTypeExpression(cps_ir.TypeExpression node) { |
| 654 return new TypeExpression( | 655 return new TypeExpression( |
| 655 node.dartType, | 656 node.dartType, |
| 656 node.arguments.map(getVariableUse).toList()); | 657 node.arguments.map(getVariableUse).toList()); |
| 657 } | 658 } |
| 658 } | 659 } |
| 659 | 660 |
| OLD | NEW |