| 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 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 String element = node.element.name; | 491 String element = node.element.name; |
| 492 return element; | 492 return element; |
| 493 } | 493 } |
| 494 | 494 |
| 495 String visitSetStatic(SetStatic node) { | 495 String visitSetStatic(SetStatic node) { |
| 496 String element = node.element.name; | 496 String element = node.element.name; |
| 497 String value = visitExpression(node.value); | 497 String value = visitExpression(node.value); |
| 498 return '$element = $value'; | 498 return '$element = $value'; |
| 499 } | 499 } |
| 500 | 500 |
| 501 String visitGetTypeTestProperty(GetTypeTestProperty node) { | |
| 502 String object = visitExpression(node.object); | |
| 503 if (usesInfixNotation(node.object)) { | |
| 504 object = '($object)'; | |
| 505 } | |
| 506 // TODO(sra): Fix up this. | |
| 507 return '$object."is-${node.dartType}"'; | |
| 508 } | |
| 509 | |
| 510 String visitCreateBox(CreateBox node) { | 501 String visitCreateBox(CreateBox node) { |
| 511 return 'CreateBox'; | 502 return 'CreateBox'; |
| 512 } | 503 } |
| 513 | 504 |
| 514 String visitCreateInstance(CreateInstance node) { | 505 String visitCreateInstance(CreateInstance node) { |
| 515 String className = node.classElement.name; | 506 String className = node.classElement.name; |
| 516 String arguments = node.arguments.map(visitExpression).join(', '); | 507 String arguments = node.arguments.map(visitExpression).join(', '); |
| 517 return 'CreateInstance $className($arguments)'; | 508 return 'CreateInstance $className($arguments)'; |
| 518 } | 509 } |
| 519 | 510 |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 if (name == null) { | 604 if (name == null) { |
| 614 String prefix = v.element == null ? 'v' : '${v.element.name}_'; | 605 String prefix = v.element == null ? 'v' : '${v.element.name}_'; |
| 615 while (name == null || _usedNames.contains(name)) { | 606 while (name == null || _usedNames.contains(name)) { |
| 616 name = "$prefix${_counter++}"; | 607 name = "$prefix${_counter++}"; |
| 617 } | 608 } |
| 618 _names[v] = name; | 609 _names[v] = name; |
| 619 _usedNames.add(name); | 610 _usedNames.add(name); |
| 620 } | 611 } |
| 621 return name; | 612 return name; |
| 622 } | 613 } |
| 623 } | 614 } |
| OLD | NEW |