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 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 String visitSetField(SetField node) { | 493 String visitSetField(SetField node) { |
494 String object = visitExpression(node.object); | 494 String object = visitExpression(node.object); |
495 String field = node.field.name; | 495 String field = node.field.name; |
496 if (usesInfixNotation(node.object)) { | 496 if (usesInfixNotation(node.object)) { |
497 object = '($object)'; | 497 object = '($object)'; |
498 } | 498 } |
499 String value = visitExpression(node.value); | 499 String value = visitExpression(node.value); |
500 return '$object.$field = $value'; | 500 return '$object.$field = $value'; |
501 } | 501 } |
502 | 502 |
| 503 String visitGetStatic(GetStatic node) { |
| 504 String element = node.element.name; |
| 505 return element; |
| 506 } |
| 507 |
| 508 String visitSetStatic(SetStatic node) { |
| 509 String element = node.element.name; |
| 510 String value = visitExpression(node.value); |
| 511 return '$element = $value'; |
| 512 } |
| 513 |
503 String visitCreateBox(CreateBox node) { | 514 String visitCreateBox(CreateBox node) { |
504 return 'CreateBox'; | 515 return 'CreateBox'; |
505 } | 516 } |
506 | 517 |
507 String visitCreateInstance(CreateInstance node) { | 518 String visitCreateInstance(CreateInstance node) { |
508 String className = node.classElement.name; | 519 String className = node.classElement.name; |
509 String arguments = node.arguments.map(visitExpression).join(', '); | 520 String arguments = node.arguments.map(visitExpression).join(', '); |
510 return 'CreateInstance $className($arguments)'; | 521 return 'CreateInstance $className($arguments)'; |
511 } | 522 } |
512 | 523 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 String prefix = v.element == null ? 'v' : '${v.element.name}_'; | 562 String prefix = v.element == null ? 'v' : '${v.element.name}_'; |
552 while (name == null || _usedNames.contains(name)) { | 563 while (name == null || _usedNames.contains(name)) { |
553 name = "$prefix${_counter++}"; | 564 name = "$prefix${_counter++}"; |
554 } | 565 } |
555 _names[v] = name; | 566 _names[v] = name; |
556 _usedNames.add(name); | 567 _usedNames.add(name); |
557 } | 568 } |
558 return name; | 569 return name; |
559 } | 570 } |
560 } | 571 } |
OLD | NEW |