| 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_tracer; | 5 library tree_ir_tracer; |
| 6 | 6 |
| 7 import 'dart:async' show EventSink; | 7 import 'dart:async' show EventSink; |
| 8 import '../tracer.dart'; | 8 import '../tracer.dart'; |
| 9 import 'tree_ir_nodes.dart'; | 9 import 'tree_ir_nodes.dart'; |
| 10 | 10 |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 } | 457 } |
| 458 | 458 |
| 459 String visitNot(Not node) { | 459 String visitNot(Not node) { |
| 460 String operand = visitExpression(node.operand); | 460 String operand = visitExpression(node.operand); |
| 461 if (usesInfixNotation(node.operand)) { | 461 if (usesInfixNotation(node.operand)) { |
| 462 operand = '($operand)'; | 462 operand = '($operand)'; |
| 463 } | 463 } |
| 464 return '!$operand'; | 464 return '!$operand'; |
| 465 } | 465 } |
| 466 | 466 |
| 467 String visitFunctionExpression(FunctionExpression node) { | |
| 468 return "function ${node.definition.element.name}"; | |
| 469 } | |
| 470 | |
| 471 String visitGetField(GetField node) { | 467 String visitGetField(GetField node) { |
| 472 String object = visitExpression(node.object); | 468 String object = visitExpression(node.object); |
| 473 String field = node.field.name; | 469 String field = node.field.name; |
| 474 if (usesInfixNotation(node.object)) { | 470 if (usesInfixNotation(node.object)) { |
| 475 object = '($object)'; | 471 object = '($object)'; |
| 476 } | 472 } |
| 477 return '$object.$field'; | 473 return '$object.$field'; |
| 478 } | 474 } |
| 479 | 475 |
| 480 String visitSetField(SetField node) { | 476 String visitSetField(SetField node) { |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 String prefix = v.element == null ? 'v' : '${v.element.name}_'; | 610 String prefix = v.element == null ? 'v' : '${v.element.name}_'; |
| 615 while (name == null || _usedNames.contains(name)) { | 611 while (name == null || _usedNames.contains(name)) { |
| 616 name = "$prefix${_counter++}"; | 612 name = "$prefix${_counter++}"; |
| 617 } | 613 } |
| 618 _names[v] = name; | 614 _names[v] = name; |
| 619 _usedNames.add(name); | 615 _usedNames.add(name); |
| 620 } | 616 } |
| 621 return name; | 617 return name; |
| 622 } | 618 } |
| 623 } | 619 } |
| OLD | NEW |