| 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 '../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 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 getVariableUse(node.entries[index].key), | 493 getVariableUse(node.entries[index].key), |
| 494 getVariableUse(node.entries[index].value)); | 494 getVariableUse(node.entries[index].value)); |
| 495 }) | 495 }) |
| 496 ); | 496 ); |
| 497 } | 497 } |
| 498 | 498 |
| 499 FunctionDefinition makeSubFunction(cps_ir.FunctionDefinition function) { | 499 FunctionDefinition makeSubFunction(cps_ir.FunctionDefinition function) { |
| 500 return createInnerBuilder().buildFunction(function); | 500 return createInnerBuilder().buildFunction(function); |
| 501 } | 501 } |
| 502 | 502 |
| 503 Expression visitCreateFunction(cps_ir.CreateFunction node) { | |
| 504 FunctionDefinition def = makeSubFunction(node.definition); | |
| 505 return new FunctionExpression(def); | |
| 506 } | |
| 507 | |
| 508 Expression visitReifyRuntimeType(cps_ir.ReifyRuntimeType node) { | 503 Expression visitReifyRuntimeType(cps_ir.ReifyRuntimeType node) { |
| 509 return new ReifyRuntimeType( | 504 return new ReifyRuntimeType( |
| 510 getVariableUse(node.value), node.sourceInformation); | 505 getVariableUse(node.value), node.sourceInformation); |
| 511 } | 506 } |
| 512 | 507 |
| 513 Expression visitReadTypeVariable(cps_ir.ReadTypeVariable node) { | 508 Expression visitReadTypeVariable(cps_ir.ReadTypeVariable node) { |
| 514 return new ReadTypeVariable( | 509 return new ReadTypeVariable( |
| 515 node.variable, | 510 node.variable, |
| 516 getVariableUse(node.target), | 511 getVariableUse(node.target), |
| 517 node.sourceInformation); | 512 node.sourceInformation); |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 702 --enclosingFunctions; | 697 --enclosingFunctions; |
| 703 } | 698 } |
| 704 | 699 |
| 705 @override | 700 @override |
| 706 visitInterpolatedNode(js.InterpolatedNode node) { | 701 visitInterpolatedNode(js.InterpolatedNode node) { |
| 707 if (enclosingFunctions > 0) { | 702 if (enclosingFunctions > 0) { |
| 708 found = true; | 703 found = true; |
| 709 } | 704 } |
| 710 } | 705 } |
| 711 } | 706 } |
| OLD | NEW |