| 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 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 } | 509 } |
| 510 // TODO(sra): Fix up this. | 510 // TODO(sra): Fix up this. |
| 511 return '$object."is-${node.dartType}"'; | 511 return '$object."is-${node.dartType}"'; |
| 512 } | 512 } |
| 513 | 513 |
| 514 String visitCreateBox(CreateBox node) { | 514 String visitCreateBox(CreateBox node) { |
| 515 return 'CreateBox'; | 515 return 'CreateBox'; |
| 516 } | 516 } |
| 517 | 517 |
| 518 String visitCreateInstance(CreateInstance node) { | 518 String visitCreateInstance(CreateInstance node) { |
| 519 String className = node.classElement.name; | 519 String name = '${node.dartType}'; |
| 520 String arguments = node.arguments.map(visitExpression).join(', '); | 520 String arguments = node.arguments.map(visitExpression).join(', '); |
| 521 return 'CreateInstance $className($arguments)'; | 521 return 'CreateInstance $name($arguments)'; |
| 522 } | 522 } |
| 523 | 523 |
| 524 @override | 524 @override |
| 525 String visitReadTypeVariable(ReadTypeVariable node) { | 525 String visitReadTypeVariable(ReadTypeVariable node) { |
| 526 return 'Read ${node.variable.element} ${visitExpression(node.target)}'; | 526 return 'Read ${node.variable.element} ${visitExpression(node.target)}'; |
| 527 } | 527 } |
| 528 | 528 |
| 529 @override | 529 @override |
| 530 String visitReifyRuntimeType(ReifyRuntimeType node) { | 530 String visitReifyRuntimeType(ReifyRuntimeType node) { |
| 531 return 'Reify ${node.value}'; | 531 return 'Reify ${node.value}'; |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 String prefix = v.element == null ? 'v' : '${v.element.name}_'; | 618 String prefix = v.element == null ? 'v' : '${v.element.name}_'; |
| 619 while (name == null || _usedNames.contains(name)) { | 619 while (name == null || _usedNames.contains(name)) { |
| 620 name = "$prefix${_counter++}"; | 620 name = "$prefix${_counter++}"; |
| 621 } | 621 } |
| 622 _names[v] = name; | 622 _names[v] = name; |
| 623 _usedNames.add(name); | 623 _usedNames.add(name); |
| 624 } | 624 } |
| 625 return name; | 625 return name; |
| 626 } | 626 } |
| 627 } | 627 } |
| OLD | NEW |