| 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 | 9 |
| 10 namespace dart { | 10 namespace dart { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 PrintInstruction(block_order_[i]); | 41 PrintInstruction(block_order_[i]); |
| 42 // And all the successors until an exit, branch, or a block entry. | 42 // And all the successors until an exit, branch, or a block entry. |
| 43 Instruction* current = block_order_[i]; | 43 Instruction* current = block_order_[i]; |
| 44 for (ForwardInstructionIterator it(current->AsBlockEntry()); | 44 for (ForwardInstructionIterator it(current->AsBlockEntry()); |
| 45 !it.Done(); | 45 !it.Done(); |
| 46 it.Advance()) { | 46 it.Advance()) { |
| 47 current = it.Current(); | 47 current = it.Current(); |
| 48 OS::Print("\n"); | 48 OS::Print("\n"); |
| 49 PrintInstruction(current); | 49 PrintInstruction(current); |
| 50 } | 50 } |
| 51 if (current->successor() != NULL) { | 51 if (current->next() != NULL) { |
| 52 ASSERT(current->successor()->IsBlockEntry()); | 52 ASSERT(current->next()->IsBlockEntry()); |
| 53 OS::Print(" goto %d", current->successor()->AsBlockEntry()->block_id()); | 53 OS::Print(" goto %d", current->next()->AsBlockEntry()->block_id()); |
| 54 } | 54 } |
| 55 OS::Print("\n"); | 55 OS::Print("\n"); |
| 56 } | 56 } |
| 57 } | 57 } |
| 58 | 58 |
| 59 | 59 |
| 60 void FlowGraphPrinter::PrintInstruction(Instruction* instr) { | 60 void FlowGraphPrinter::PrintInstruction(Instruction* instr) { |
| 61 char str[1000]; | 61 char str[1000]; |
| 62 BufferFormatter f(str, sizeof(str)); | 62 BufferFormatter f(str, sizeof(str)); |
| 63 instr->PrintTo(&f); | 63 instr->PrintTo(&f); |
| (...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 PrintInstruction(block_order_[i]); | 532 PrintInstruction(block_order_[i]); |
| 533 // And all the successors until an exit, branch, or a block entry. | 533 // And all the successors until an exit, branch, or a block entry. |
| 534 Instruction* current = block_order_[i]; | 534 Instruction* current = block_order_[i]; |
| 535 for (ForwardInstructionIterator it(current->AsBlockEntry()); | 535 for (ForwardInstructionIterator it(current->AsBlockEntry()); |
| 536 !it.Done(); | 536 !it.Done(); |
| 537 it.Advance()) { | 537 it.Advance()) { |
| 538 current = it.Current(); | 538 current = it.Current(); |
| 539 Print("0 0 "); | 539 Print("0 0 "); |
| 540 PrintInstruction(current); | 540 PrintInstruction(current); |
| 541 } | 541 } |
| 542 if (current->successor() != NULL) { | 542 if (current->next() != NULL) { |
| 543 ASSERT(current->successor()->IsBlockEntry()); | 543 ASSERT(current->next()->IsBlockEntry()); |
| 544 Print("0 0 _ Goto B%d <|@\n", | 544 Print("0 0 _ Goto B%d <|@\n", |
| 545 current->successor()->AsBlockEntry()->block_id()); | 545 current->next()->AsBlockEntry()->block_id()); |
| 546 } | 546 } |
| 547 END("HIR"); | 547 END("HIR"); |
| 548 } | 548 } |
| 549 END("block"); | 549 END("block"); |
| 550 } | 550 } |
| 551 END("cfg"); | 551 END("cfg"); |
| 552 } | 552 } |
| 553 #undef BEGIN | 553 #undef BEGIN |
| 554 #undef END | 554 #undef END |
| 555 } | 555 } |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 666 void Environment::PrintTo(BufferFormatter* f) const { | 666 void Environment::PrintTo(BufferFormatter* f) const { |
| 667 f->Print(" env={ "); | 667 f->Print(" env={ "); |
| 668 for (intptr_t i = 0; i < values_.length(); ++i) { | 668 for (intptr_t i = 0; i < values_.length(); ++i) { |
| 669 if (i > 0) f->Print(", "); | 669 if (i > 0) f->Print(", "); |
| 670 values_[i]->PrintTo(f); | 670 values_[i]->PrintTo(f); |
| 671 } | 671 } |
| 672 f->Print(" }"); | 672 f->Print(" }"); |
| 673 } | 673 } |
| 674 | 674 |
| 675 } // namespace dart | 675 } // namespace dart |
| OLD | NEW |