| 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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 f->Print(" v%d <- phi(", ssa_temp_index()); | 387 f->Print(" v%d <- phi(", ssa_temp_index()); |
| 388 for (intptr_t i = 0; i < inputs_.length(); ++i) { | 388 for (intptr_t i = 0; i < inputs_.length(); ++i) { |
| 389 if (inputs_[i] != NULL) inputs_[i]->PrintTo(f); | 389 if (inputs_[i] != NULL) inputs_[i]->PrintTo(f); |
| 390 if (i < inputs_.length() - 1) f->Print(","); | 390 if (i < inputs_.length() - 1) f->Print(","); |
| 391 } | 391 } |
| 392 f->Print(")"); | 392 f->Print(")"); |
| 393 } | 393 } |
| 394 | 394 |
| 395 | 395 |
| 396 void ParameterInstr::PrintTo(BufferFormatter* f) const { | 396 void ParameterInstr::PrintTo(BufferFormatter* f) const { |
| 397 f->Print(" v%d <- parameter(%d)", | 397 f->Print(" v%d <- parameter(%d)", index()); |
| 398 (ssa_temp_index() != -1) ? ssa_temp_index() : temp_index(), | |
| 399 index()); | |
| 400 } | 398 } |
| 401 | 399 |
| 402 | 400 |
| 403 void TargetEntryInstr::PrintTo(BufferFormatter* f) const { | 401 void TargetEntryInstr::PrintTo(BufferFormatter* f) const { |
| 404 f->Print("%2d: [target", block_id()); | 402 f->Print("%2d: [target", block_id()); |
| 405 if (HasTryIndex()) { | 403 if (HasTryIndex()) { |
| 406 f->Print(" catch %d]", try_index()); | 404 f->Print(" catch %d]", try_index()); |
| 407 } else { | 405 } else { |
| 408 f->Print("]"); | 406 f->Print("]"); |
| 409 } | 407 } |
| (...skipping 25 matching lines...) Expand all Loading... |
| 435 | 433 |
| 436 | 434 |
| 437 void ReThrowInstr::PrintTo(BufferFormatter* f) const { | 435 void ReThrowInstr::PrintTo(BufferFormatter* f) const { |
| 438 f->Print(" %s ", DebugName()); | 436 f->Print(" %s ", DebugName()); |
| 439 exception()->PrintTo(f); | 437 exception()->PrintTo(f); |
| 440 f->Print(", "); | 438 f->Print(", "); |
| 441 stack_trace()->PrintTo(f); | 439 stack_trace()->PrintTo(f); |
| 442 } | 440 } |
| 443 | 441 |
| 444 | 442 |
| 445 void GotoInstr::PrintTo(BufferFormatter* f) const { | |
| 446 f->Print(" goto %d", successor()->block_id()); | |
| 447 } | |
| 448 | |
| 449 | |
| 450 void BranchInstr::PrintTo(BufferFormatter* f) const { | 443 void BranchInstr::PrintTo(BufferFormatter* f) const { |
| 451 f->Print(" %s ", DebugName()); | 444 f->Print(" %s ", DebugName()); |
| 452 f->Print("if "); | 445 f->Print("if "); |
| 453 if (is_fused_with_comparison()) { | 446 if (is_fused_with_comparison()) { |
| 454 if (is_negated()) f->Print(" not "); | 447 if (is_negated()) f->Print(" not "); |
| 455 fused_with_comparison_->PrintTo(f); | 448 fused_with_comparison_->PrintTo(f); |
| 456 } else { | 449 } else { |
| 457 value()->PrintTo(f); | 450 value()->PrintTo(f); |
| 458 } | 451 } |
| 459 | 452 |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 | 684 |
| 692 | 685 |
| 693 void ReThrowInstr::PrintToVisualizer(BufferFormatter* f) const { | 686 void ReThrowInstr::PrintToVisualizer(BufferFormatter* f) const { |
| 694 f->Print("_ %s ", DebugName()); | 687 f->Print("_ %s ", DebugName()); |
| 695 exception()->PrintTo(f); | 688 exception()->PrintTo(f); |
| 696 f->Print(", "); | 689 f->Print(", "); |
| 697 stack_trace()->PrintTo(f); | 690 stack_trace()->PrintTo(f); |
| 698 } | 691 } |
| 699 | 692 |
| 700 | 693 |
| 701 void GotoInstr::PrintToVisualizer(BufferFormatter* f) const { | |
| 702 f->Print("_ goto B%d", successor()->block_id()); | |
| 703 } | |
| 704 | |
| 705 | |
| 706 void BranchInstr::PrintToVisualizer(BufferFormatter* f) const { | 694 void BranchInstr::PrintToVisualizer(BufferFormatter* f) const { |
| 707 f->Print("_ %s ", DebugName()); | 695 f->Print("_ %s ", DebugName()); |
| 708 f->Print("if "); | 696 f->Print("if "); |
| 709 value()->PrintTo(f); | 697 value()->PrintTo(f); |
| 710 f->Print(" goto (B%d, B%d)", | 698 f->Print(" goto (B%d, B%d)", |
| 711 true_successor()->block_id(), | 699 true_successor()->block_id(), |
| 712 false_successor()->block_id()); | 700 false_successor()->block_id()); |
| 713 } | 701 } |
| 714 | 702 |
| 715 | 703 |
| 716 void ParallelMoveInstr::PrintToVisualizer(BufferFormatter* f) const { | 704 void ParallelMoveInstr::PrintToVisualizer(BufferFormatter* f) const { |
| 717 UNIMPLEMENTED(); | 705 UNIMPLEMENTED(); |
| 718 } | 706 } |
| 719 | 707 |
| 720 | 708 |
| 721 void Environment::PrintTo(BufferFormatter* f) const { | 709 void Environment::PrintTo(BufferFormatter* f) const { |
| 722 f->Print(" env={ "); | 710 f->Print(" env={ "); |
| 723 for (intptr_t i = 0; i < values_.length(); ++i) { | 711 for (intptr_t i = 0; i < values_.length(); ++i) { |
| 724 if (i > 0) f->Print(", "); | 712 if (i > 0) f->Print(", "); |
| 725 values_[i]->PrintTo(f); | 713 values_[i]->PrintTo(f); |
| 726 if ((i < locations_.length()) && !locations_[i].IsInvalid()) { | 714 if ((i < locations_.length()) && !locations_[i].IsInvalid()) { |
| 727 f->Print(" [%s]", locations_[i].Name()); | 715 f->Print(" [%s]", locations_[i].Name()); |
| 728 } | 716 } |
| 729 } | 717 } |
| 730 f->Print(" }"); | 718 f->Print(" }"); |
| 731 } | 719 } |
| 732 | 720 |
| 733 } // namespace dart | 721 } // namespace dart |
| OLD | NEW |