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 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 String visitCreateBox(CreateBox node) { | 489 String visitCreateBox(CreateBox node) { |
490 return 'CreateBox'; | 490 return 'CreateBox'; |
491 } | 491 } |
492 | 492 |
493 String visitCreateInstance(CreateInstance node) { | 493 String visitCreateInstance(CreateInstance node) { |
494 String className = node.classElement.name; | 494 String className = node.classElement.name; |
495 String arguments = node.arguments.map(visitExpression).join(', '); | 495 String arguments = node.arguments.map(visitExpression).join(', '); |
496 return 'CreateInstance $className($arguments)'; | 496 return 'CreateInstance $className($arguments)'; |
497 } | 497 } |
498 | 498 |
499 | |
500 @override | 499 @override |
501 String visitReadTypeVariable(ReadTypeVariable node) { | 500 String visitReadTypeVariable(ReadTypeVariable node) { |
502 return 'Read ${node.variable.element} ${visitExpression(node.target)}'; | 501 return 'Read ${node.variable.element} ${visitExpression(node.target)}'; |
503 } | 502 } |
504 | 503 |
505 @override | 504 @override |
506 String visitReifyRuntimeType(ReifyRuntimeType node) { | 505 String visitReifyRuntimeType(ReifyRuntimeType node) { |
507 return 'Reify ${node.value}'; | 506 return 'Reify ${node.value}'; |
508 } | 507 } |
509 | 508 |
(...skipping 19 matching lines...) Expand all Loading... |
529 return 'Foreign "${node.codeTemplate.source}"($arguments)'; | 528 return 'Foreign "${node.codeTemplate.source}"($arguments)'; |
530 } | 529 } |
531 | 530 |
532 @override | 531 @override |
533 String visitApplyBuiltinOperator(ApplyBuiltinOperator node) { | 532 String visitApplyBuiltinOperator(ApplyBuiltinOperator node) { |
534 String args = node.arguments.map(visitExpression).join(', '); | 533 String args = node.arguments.map(visitExpression).join(', '); |
535 return 'ApplyBuiltinOperator ${node.operator} ($args)'; | 534 return 'ApplyBuiltinOperator ${node.operator} ($args)'; |
536 } | 535 } |
537 | 536 |
538 @override | 537 @override |
| 538 String visitApplyBuiltinMethod(ApplyBuiltinMethod node) { |
| 539 String receiver = visitExpression(node.receiver); |
| 540 String args = node.arguments.map(visitExpression).join(', '); |
| 541 return 'ApplyBuiltinMethod ${node.method} $receiver ($args)'; |
| 542 } |
| 543 |
| 544 @override |
539 String visitGetLength(GetLength node) { | 545 String visitGetLength(GetLength node) { |
540 String object = visitExpression(node.object); | 546 String object = visitExpression(node.object); |
541 return 'GetLength($object)'; | 547 return 'GetLength($object)'; |
542 } | 548 } |
543 | 549 |
544 @override | 550 @override |
545 String visitGetIndex(GetIndex node) { | 551 String visitGetIndex(GetIndex node) { |
546 String object = visitExpression(node.object); | 552 String object = visitExpression(node.object); |
547 String index = visitExpression(node.index); | 553 String index = visitExpression(node.index); |
548 return 'GetIndex($object, $index)'; | 554 return 'GetIndex($object, $index)'; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 String prefix = v.element == null ? 'v' : '${v.element.name}_'; | 587 String prefix = v.element == null ? 'v' : '${v.element.name}_'; |
582 while (name == null || _usedNames.contains(name)) { | 588 while (name == null || _usedNames.contains(name)) { |
583 name = "$prefix${_counter++}"; | 589 name = "$prefix${_counter++}"; |
584 } | 590 } |
585 _names[v] = name; | 591 _names[v] = name; |
586 _usedNames.add(name); | 592 _usedNames.add(name); |
587 } | 593 } |
588 return name; | 594 return name; |
589 } | 595 } |
590 } | 596 } |
OLD | NEW |