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 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 if (usesInfixNotation(node.left)) { | 449 if (usesInfixNotation(node.left)) { |
450 left = "($left)"; | 450 left = "($left)"; |
451 } | 451 } |
452 if (usesInfixNotation(node.right)) { | 452 if (usesInfixNotation(node.right)) { |
453 right = "($right)"; | 453 right = "($right)"; |
454 } | 454 } |
455 return "$left ${node.operator} $right"; | 455 return "$left ${node.operator} $right"; |
456 } | 456 } |
457 | 457 |
458 String visitTypeOperator(TypeOperator node) { | 458 String visitTypeOperator(TypeOperator node) { |
459 String value = visitExpression(node.value); | 459 String receiver = visitExpression(node.receiver); |
460 String type = "${node.type}"; | 460 String type = "${node.type}"; |
461 return "TypeOperator $value ${node.operator} $type"; | 461 return "TypeOperator $receiver ${node.operator} $type"; |
462 } | 462 } |
463 | 463 |
464 String visitNot(Not node) { | 464 String visitNot(Not node) { |
465 String operand = visitExpression(node.operand); | 465 String operand = visitExpression(node.operand); |
466 if (usesInfixNotation(node.operand)) { | 466 if (usesInfixNotation(node.operand)) { |
467 operand = '($operand)'; | 467 operand = '($operand)'; |
468 } | 468 } |
469 return '!$operand'; | 469 return '!$operand'; |
470 } | 470 } |
471 | 471 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 String prefix = v.element == null ? 'v' : '${v.element.name}_'; | 562 String prefix = v.element == null ? 'v' : '${v.element.name}_'; |
563 while (name == null || _usedNames.contains(name)) { | 563 while (name == null || _usedNames.contains(name)) { |
564 name = "$prefix${_counter++}"; | 564 name = "$prefix${_counter++}"; |
565 } | 565 } |
566 _names[v] = name; | 566 _names[v] = name; |
567 _usedNames.add(name); | 567 _usedNames.add(name); |
568 } | 568 } |
569 return name; | 569 return name; |
570 } | 570 } |
571 } | 571 } |
OLD | NEW |