| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 #include "vm/il_printer.h" | 5 #include "vm/il_printer.h" |
| 6 | 6 |
| 7 #include "vm/intermediate_language.h" | 7 #include "vm/intermediate_language.h" |
| 8 #include "vm/os.h" | 8 #include "vm/os.h" |
| 9 #include "vm/parser.h" | 9 #include "vm/parser.h" |
| 10 | 10 |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 } | 439 } |
| 440 | 440 |
| 441 | 441 |
| 442 void CheckClassInstr::PrintOperandsTo(BufferFormatter* f) const { | 442 void CheckClassInstr::PrintOperandsTo(BufferFormatter* f) const { |
| 443 value()->PrintTo(f); | 443 value()->PrintTo(f); |
| 444 PrintICData(f, unary_checks()); | 444 PrintICData(f, unary_checks()); |
| 445 } | 445 } |
| 446 | 446 |
| 447 | 447 |
| 448 void GraphEntryInstr::PrintTo(BufferFormatter* f) const { | 448 void GraphEntryInstr::PrintTo(BufferFormatter* f) const { |
| 449 const GrowableArray<Definition*>& defns = initial_definitions_; |
| 449 f->Print("B%"Pd"[graph]", block_id()); | 450 f->Print("B%"Pd"[graph]", block_id()); |
| 450 if ((constant_null() != NULL) || (start_env() != NULL)) { | 451 if (defns.length() > 0) { |
| 451 f->Print(" {"); | 452 f->Print(" {"); |
| 452 if (constant_null() != NULL) { | 453 for (intptr_t i = 0; i < defns.length(); ++i) { |
| 454 Definition* def = defns[i]; |
| 453 f->Print("\n "); | 455 f->Print("\n "); |
| 454 constant_null()->PrintTo(f); | 456 def->PrintTo(f); |
| 455 } | |
| 456 if (start_env() != NULL) { | |
| 457 for (intptr_t i = 0; i < start_env()->Length(); ++i) { | |
| 458 Definition* def = start_env()->ValueAt(i)->definition(); | |
| 459 if (def->IsParameter()) { | |
| 460 f->Print("\n "); | |
| 461 def->PrintTo(f); | |
| 462 } | |
| 463 } | |
| 464 } | 457 } |
| 465 f->Print("\n}"); | 458 f->Print("\n}"); |
| 466 } | 459 } |
| 467 } | 460 } |
| 468 | 461 |
| 469 | 462 |
| 470 void JoinEntryInstr::PrintTo(BufferFormatter* f) const { | 463 void JoinEntryInstr::PrintTo(BufferFormatter* f) const { |
| 471 f->Print("B%"Pd"[join]", block_id()); | 464 f->Print("B%"Pd"[join]", block_id()); |
| 472 if (phis_ != NULL) { | 465 if (phis_ != NULL) { |
| 473 f->Print(" {"); | 466 f->Print(" {"); |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 } | 690 } |
| 698 #undef BEGIN | 691 #undef BEGIN |
| 699 #undef END | 692 #undef END |
| 700 } | 693 } |
| 701 | 694 |
| 702 | 695 |
| 703 // === Printing instructions in a visualizer-understandable format: | 696 // === Printing instructions in a visualizer-understandable format: |
| 704 // "result instruction(op1, op2)" where result is a temporary name | 697 // "result instruction(op1, op2)" where result is a temporary name |
| 705 // or _ for instruction without result. | 698 // or _ for instruction without result. |
| 706 void GraphEntryInstr::PrintToVisualizer(BufferFormatter* f) const { | 699 void GraphEntryInstr::PrintToVisualizer(BufferFormatter* f) const { |
| 700 const GrowableArray<Definition*>& defns = initial_definitions_; |
| 707 f->Print("_ [graph]"); | 701 f->Print("_ [graph]"); |
| 708 if (start_env_ != NULL) { | 702 if (defns.length() > 0) { |
| 709 start_env_->PrintTo(f); | 703 f->Print(" init={ "); |
| 704 for (intptr_t i = 0; i < defns.length(); ++i) { |
| 705 if (i > 0) f->Print(", "); |
| 706 defns[i]->PrintTo(f); |
| 707 } |
| 708 f->Print(" }"); |
| 710 } | 709 } |
| 711 } | 710 } |
| 712 | 711 |
| 713 | 712 |
| 714 void JoinEntryInstr::PrintToVisualizer(BufferFormatter* f) const { | 713 void JoinEntryInstr::PrintToVisualizer(BufferFormatter* f) const { |
| 715 f->Print("_ [join]"); | 714 f->Print("_ [join]"); |
| 716 } | 715 } |
| 717 | 716 |
| 718 | 717 |
| 719 void PhiInstr::PrintToVisualizer(BufferFormatter* f) const { | 718 void PhiInstr::PrintToVisualizer(BufferFormatter* f) const { |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 799 f->Print(" ["); | 798 f->Print(" ["); |
| 800 locations_[i].PrintTo(f); | 799 locations_[i].PrintTo(f); |
| 801 f->Print("]"); | 800 f->Print("]"); |
| 802 } | 801 } |
| 803 } | 802 } |
| 804 f->Print(" }"); | 803 f->Print(" }"); |
| 805 if (outer_ != NULL) outer_->PrintTo(f); | 804 if (outer_ != NULL) outer_->PrintTo(f); |
| 806 } | 805 } |
| 807 | 806 |
| 808 } // namespace dart | 807 } // namespace dart |
| OLD | NEW |